Platform game written for the GHI/OutrageousCircuits RETRO game device. Navigate the caves collecting all the pickups and avoiding the creatures and haunted mine carts that patrol the caves. Oh and remember to watch out for the poisonous plants... This game demonstrates the ability to have multiple animated sprites where the sprites can overlap the background environment. See how the player moves past the fence and climbs the wall in the 3rd screen.

Dependencies:   mbed

Committer:
taylorza
Date:
Mon Feb 16 03:46:57 2015 +0000
Revision:
16:f9227904afc4
Parent:
14:b4884a31069e
Added a 4th game screen

Who changed what in which revision?

UserRevisionLine numberNew contents of line
taylorza 4:45ff7fc8a431 1 #ifndef __SCREEN2_H__
taylorza 4:45ff7fc8a431 2 #define __SCREEN2_H__
taylorza 4:45ff7fc8a431 3
taylorza 4:45ff7fc8a431 4 class Screen2 : public Scene
taylorza 4:45ff7fc8a431 5 {
taylorza 4:45ff7fc8a431 6 public:
taylorza 4:45ff7fc8a431 7 Screen2() :
taylorza 4:45ff7fc8a431 8 _player(),
taylorza 4:45ff7fc8a431 9 _enemy1(4),
taylorza 4:45ff7fc8a431 10 _enemy2(4)
taylorza 4:45ff7fc8a431 11 {
taylorza 4:45ff7fc8a431 12 Game::Surface.clearScreen();
taylorza 4:45ff7fc8a431 13
taylorza 4:45ff7fc8a431 14 addGameObject(&_enemy1);
taylorza 4:45ff7fc8a431 15 addGameObject(&_enemy2);
taylorza 4:45ff7fc8a431 16 addGameObject(&_player);
taylorza 4:45ff7fc8a431 17
taylorza 4:45ff7fc8a431 18 restartScreen();
taylorza 4:45ff7fc8a431 19 }
taylorza 4:45ff7fc8a431 20
taylorza 4:45ff7fc8a431 21 virtual void restartScreen()
taylorza 4:45ff7fc8a431 22 {
taylorza 14:b4884a31069e 23 _player.setStartPosition(8, 8);
taylorza 14:b4884a31069e 24 _enemy1.setStartPosition(140, 8);
taylorza 14:b4884a31069e 25 _enemy2.setStartPosition(90, 32);
taylorza 4:45ff7fc8a431 26
taylorza 4:45ff7fc8a431 27 setPosition(0, 32);
taylorza 4:45ff7fc8a431 28 setMap(Maps::Screen2, 20, 7, blocks, sprites);
taylorza 4:45ff7fc8a431 29
taylorza 4:45ff7fc8a431 30 Scene::restartScreen();
taylorza 4:45ff7fc8a431 31 }
taylorza 4:45ff7fc8a431 32
taylorza 4:45ff7fc8a431 33 private:
taylorza 4:45ff7fc8a431 34 Player _player;
taylorza 4:45ff7fc8a431 35 BouncingEnemy _enemy1;
taylorza 4:45ff7fc8a431 36 BouncingEnemy _enemy2;
taylorza 4:45ff7fc8a431 37 };
taylorza 4:45ff7fc8a431 38
taylorza 4:45ff7fc8a431 39 #endif //__SCREEN2_H__