130 likes | 289 Views
Obey Gravity Update. Java Code, Layouts, Assets, Source/Version Control. By: Team Artificial Gravity. Obey Gravity Project. https://dl.dropbox.com/u/61057029/AritificialGravity-Artificial_Gravity-ece78fd.zip Above is a Dropbox link to a zipped folder containing all of our project files.
E N D
Obey Gravity Update Java Code, Layouts, Assets, Source/Version Control By: Team Artificial Gravity
Obey Gravity Project https://dl.dropbox.com/u/61057029/AritificialGravity-Artificial_Gravity-ece78fd.zip • Above is a Dropbox link to a zipped folder containing all of our project files
Java Code, Layouts, Assets • Separate Java files were written for each part of the game, such as GamePlanet.java and GamePlayer.java • The code was thoroughly commented to describe our approach • The layouts file contains the main.xml and the level-complete.xml so far, which depict the format for the “Level Complete”screen • The assets files contain the code for the design of the levels, with planet radii, starting and ending goals, etc.
Program Flow GameRenderer - GameRenderer.initScene() is automatically called by the rajawali3d framework to initialize the 3d scene This will call init in either Game or GameMenu, based on the current AppState Starts in GameActivty - Creates GameRenderer which is a RajawaliRenderer The GameRenderer.onDrawFrame() is called by openGL every frame to do all the drawing. This is where I call update() in the currently active application state class (Game, GameMenu...) The current application state (main menu, game screen, options etc) is maintained by GameRenderer. Additionally, each of these application states are contained in their own classes which implement IGameScene Depending on the AppState in GameRenderer, either Game.update or GameMenu.update is called each frame
What’s what in Obey Gravity? • Game - Contains all the logic for the game. Game.init will initialize all the things needed to display 3d objects, load the levels and manage it's own state. Game contains hashmaps to map textures/materials by string id, also level objects by string id • GamePlayer - Contains all the logic for the player. Game will contain an instance of GamePlayer and manage it accordingly, along with various GameObject's such as GamePlanet and GameAsteroidGamePlanet, MenuPlanet, GameAsteroid - All these derive from GameObject and are used by the game in either gameplay or in the menu • ParticleEmitter3d, SpecialLine3D, Cylinder3D - These are my custom 3D object extensions that all derive from rajawali.BaseObject3D • GameSoundManager - is a single class to manage the playback of sound effects (via SoundPool) and background music (via MediaPlayer). Sounds/Music are added and played by string ID. The sounds/music are loaded from /res/raw
What’s what in Obey Gravity? (cont.) • GameUtil - Utility functions and definitions. Java's math class defines many trig constants as doubles, so to work around constantly having to typecast to float(which slows things down) I define my own constants here as float. This class also contains my logging functions for logcat. • Ticker - Contains some functions to keep track of time in the game • IGameObject - interface for all 3d objects that appear onscreen • IGameScene - interface for all game scenes which will contain a 3d object. Currently there is 2: Game and GameMenu • IUpdatable - interface for any component which requires an update every single frame of the game. All GameObject's implement this interface. IGameScene also implements this interface. • All classes have a static final string TAG which is used in calls to GameUtil.LogError or GameUtil.LogDebug
Separation of Concerns • Between the UI Logic and the Program Logic: most of the UI Logic is contained in gameactivity.java
Support for Debugging • A system was created in which each class has a tag • There are then debug logging functions that utilize those tags to output to logcat
GitHubused for Source/Version Control • Used to help people build software together • Ability to share, edit, and store code • Keeps track of various versions of the program and when they were updated (allowing users to download a previous version) • Can comment on what specific files of the program have been edited The following screenshots show how GitHub stores the versions (most recent at the top) and the program can be downloaded and edited
A Link to our Commit History https://github.com/AritificialGravity/Artificial_Gravity/commits/working • Incremental development was followed by committing our changes after each incremental build. This can be followed with the link above to our commit history to see the increments.
SW Co-Design Summer 2012Dr. Shankar Mofidul Jamal Pavitra Jaiswal CerenIsildak