This tutorial was focused on the game2d library. It provides the environment for game development using Moscrif. The game2d library is similar to Cocos2d library, but it is also available for Android and Bada.
Our game cosists of two scenes - menu and game scene. These scenes contains all other objects used in the game. Our scenes are extended from Scene class and pushed to the game by push function.
In the menu we use GameButton class to create three buttons, which allow the user to start new game, continue previous game or quit the game. The game buttons are added to the scene by add function.
In the game we create all game elements by using Sprite class. Sprite is the base class for game elements. Instance of this class can be added to the scene as well, by using add function. Sprite object can also contain more frames. These can be displaying gradually by nextFrame or prevFrame functions, thus creating nice animation.
|