When we were beginners to the programming, we found the most interesting thing about programming is to be telling the computer to do whatever you want through commands. However, it is always the case that the difficult programming language grammar daunts the beginners to explore them further. It is not easy to write or understand very complicated codes. So, we built a game that eases the complex grammar but keeps the logics. The player can feel the magic of programming through building the world.
What it does
Our character, Rick, is controlled by commands written by the player, with pretty much the same syntax as C/C++/Java. With the initial curiosity, the player can joyfully type in commands as they familiar themselves with the programming syntax. For instance,
This command moves Rick forward by 40 pixels on screen.
world.add(apple, 300, 200)
This command creates an apple in the game at point (300, 200).
In the future, we will add more interactive elements to the game. Therefore, the player can freely make their own world through codes, and, at the same time, learn programming and have fun. Be creative ; )
How we built it
We first split the task into several pieces, e.g. graphics game panel, text input interface, control panel, and syntax analysis. Each team member contributed to a part which he is best at. During the development process, the group was in active communication regarding interface compatibility and changes of design to face previously not considered incidences. Group members were also actively helping each other to solve bugs. After a part is finished, codes is assembled, compiled and tested to make sure they worked as intended. Then the whole project is compiled, debugged and tested.
Since we are using Java, we used three JFrames in coordinate with each other, one for control panel, one for text input and the other one for game interface. A center controlling class GameController is used to control the game. In the main method, text input frame and control panel are set up and linked to GameController, whose responsible for setting up the GameFrame. Then GameController.startGame() method is invoked, causing a new World object to be built from WorldFactory class with level 1 and assigned to a GameView. GameView reads in the assigned World object for its dimensions, paintable objects and paint respective objects on the Screen. World object embodies an ArrayList of PaintableObjects(namely PaintObject class), which GUI GameView gets and paints them one by one, are assembled in the WorldFactory, Each PaintObject has these properties, x, y, width, height, orientation, and tag. Every property assists the painting of objects. The routine is that, WorldFactory creates a World object, which contains all the information about the game, then the information is passed to GUI for display.
The commands typed from the console are passed into the Game using a mechanism called Events and Actions. Every world or scene has events attached to them. Each event has a category and a name. When user types in a command, syntax analysis will work to figure out the category (in Java, the receiver), the name(in Java, the method name/field name) along with the arguments. Then, the world will match the category and the name against the all the events it is aware of ( from the scene event table or global events table). If a match is found, the associated action of the event will be executed, with the parameters read from the console. Actions are responsible for altering the world in certain ways as described by the command, e.g. reset the character's position, add things to the paintable objects array. In this way, the player can create the world using a wide variety of available commands and takes advantage of the flexibility of programming languages.
Challenges we ran into
The biggest challenge for us is that we did not come up with an idea of what we were going to hack at the beginning. We spent a huge amount of time brainstorming and researching ideas, but each time when we thought something great, we found the exact same idea had already been taken by someone else. It frustrated us a lot. We strongly believe a great and unique idea is essentially important for us to create something entertaining and inspiring. The next challenge is the collaboration. All of us are freshman and new to the programming. None of us had an idea of how we are going to finish the work together. In this process of exploring, we learned new things, made many mistakes and know more about each other. This is the most valuable price we earned in this hackathon.
Accomplishments that we're proud of
At the moment when we integrate our codes together and press the start button, and “boom!” everything was running fine, just as we expected, we were so excited about our accomplishment. This is the first time for all of us to work together by designing the frame of the code and splitting the jobs evenly by ourselves! We wrote different parts of the code, and it just worked, like a magic to all of us. Probably as we are all beginners to the programming, we did not understand how hard our goal is. Eventually we realized that what we had accomplished is a new language and an interpreter! This sounds incredible to all of us and none of us believe that we could have done this without cooperating with each other.
What we learned
As this is our first time to be here at hackathon as freshmen, we learned that what is it like to work in a team in software development. In our high school, we often completes the projects on our own without help from others or any kind of collaboration. In hackathon, however, we worked the first twenty hours to come up with a great idea, then we worked as a team instead of as individuals. We need to help others along the way in order to accomplish our common goal. The joy we get, after the project finally completes, however, was also four times the individual fulfillment.
What's next for Rick's Adventure
After a few introductory levels, Rick's World will eventually be a commpletely free game. What we want to accomplish is that the program can give players with no previous programming knowledge a hand-on experience to learn about the basic logic of programing, but not the exact grammar, because the idea is more important; and the real game begins when they finish the adventure and enters Rick's World. The world is a blank sheet and the only object that pre-exists in the world is Rick. We design the controll panel allowing the player to create new methods or even classes into the program itself, thus, adding new objects, events or actions to the game. Also, we want multiple players to be able to edit the same world together, each one of them contributing their power. We believe that the creative community would be able to show the magic that beyond our imagination.