Reference no: EM132221740
Frogger - Part 2 - Represtenting the game state information
Stage 1
With your Android project you started last lab:
• Make a "Welcome" activity, which will be the main activity. This should include a button for starting to play a game.
• Make a "Game" activity which will be used for playing the game.
• Use an "Intent", triggered from the button on the "Welcome" activity, to start the "Game" activity.
• add, commit, and push your changes.
Stage 2
Design the core classes for your simple game. Do this using a UML class diagram. This design and implementation should be mostly independent of the platform the rest of the game runs on. That is, as much as possible think how you could take these core classes and
use them within different application GUI frameworks. This code couples with the rest of the game in three main ways:
• input from the user - assume you have a touch event calling a method within your code. This method will have attributes with the position on the screen the touch event occurred.
• a timer event - so at some fix time rate a "step" method is called in your core code.
• a draw method - when this method is called the current state of the game is drawn. This method would have as attributes the "canvas" to paint the current game state to. There would also be the starting of a new game and the end of a game that would need to be connected with this core part of the game design.
Your UML class diagram should also include the fields and methods. Is there any duplication in your fields? Does this indicate a better possible design?
Consider the following questions:
• How will the "step" method work for the "frog", the "log" and the "truck"?
• "Logs" float across the river. If a "frog" jumps on a "log" it will move with the log? How will you do this? Which class will this code be located?
• Where will you put the code that determines if a frog gets run over by a "truck"?
Once you have completed stages 1 and 2 show your results to your tutor to have today's participation marked off.
Stage 3
Implement your core game classes for your groups Frogger game.