lundi 31 août 2015

[Programming] Arena 2D Game project on Playstation Mobile

Introduction

Before Sony end the support of the Playstation Mobile , I made a game with my engine but I can't run the game anymore..



Gameplay

The player is a knight , fight some monsters on a 2D arena. For that he can jump, attack with his sword or throw knifes. The quantity of knifes is  limited





Monster spawns randomly on the scene and pursuit the player. When the player clean all monster.the player can buy some new lifes point (maximum of 5 hearts) or buy munition for his knife. Each time, the player buy item, the price of the item will double. Then a new round begin, there will more monsters and they will be faster.




At the end of the game, there is a high score which is after save on a .dat file format.



Programming

The game uses my engine, the PSM Engine. I implemented a 2D class where i can easily import animated sprite on a png format, all the mathematics are also on my engine.

There is game controller which controls the flow of the game. The controller contains all the elements of the game : Hero, monster, UI and stage elements (background)

Each element of the game have a controller where mainly it's to control the actor, for instance :

- The controller of the hero is to read the input of the player to move accordingly with the input. The game is control with the D-Pad and button, to buy power, the player have to uses the tactile function
- The controller of the monster , controls the wave of the monster : spawn, the number of monster on the arenas, if the wave is finish or not.
- The controller of the stage, read an XML file to create the element of scene (like platform or bonus)

There is event system use for the objects of the game to communicate between them. For instance when a knife touch a zombie, the knife class raise en event where only the zombie class can read. In that case, that mean , that the zombie is dead and the code have to wipeout the zombie sprite.