Portfolio


  • Home
  • DirectX Raytracing
  • Advanced Graphics
  • Roboflux
  • Boat Simulation

Mario / Crossy Roads



The project



I created this project for the second half of the same module as the Pacman project. The game consists of two levels. The first level is a clone of mario where koopas spawn and slowly make their way down to the bottom of the level. The second level is a crossy roads style clone where the objective is to survive for as long as possible while waves of cars make their way towards you.



Tile map



I decided to use a tile map for the first level as this made creating new levels and worrying about hitboxes very simple. I implemented this by creating a file with different numbers. The different numbers would then represent different things like an object, no object or the edge of the screen. This file was then parsed and the appropriate tile map was created. I then lined a sprite up with the created tile map to give the appearance of platforms. This also helped with the koopa AI as it meant when they hit a tile with a certain number they turned around.



Sound



Once I had finished implementing the first level I started to implement the sounds. I did this by creating a set number of mixers. When a sound needed to be played a mixer would then be allocated to that sound. The appropriate volume settings were stored inside the class making the sound. The music however was allocated a global mixer as it would be playing the whole time the application was open.



The second level



For the second level I decided to create a crossy road clone as I had been travelling a lot and playing it on my phone. To implement the waves I used a timer. Whenever this timer went off another wave set off. This time was decreased as the player survives for longer. On top of this the longer the player survives the more cars there are in each wave increasing the difficulty.



Power ups



Once I'd finished implementing the waves I decided to implement some power ups. There are 2 power ups, slow time and one up. I implemented this by making it so every time a car is supposed to be spawned there is a small chance it will be a power up instead. In order to implement the slow time power up I used a variable to store the speed of all the cars. This allowed me to use a getter to easily change the speeds of the cars.



Documentation



In order to help me create this project I created some UML diagrams. This allowed me to clearly see the links between the classes and to design the program in an object oriented manner effectively.