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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Screen2.h Source File

Screen2.h

00001 #ifndef __SCREEN2_H__
00002 #define __SCREEN2_H__
00003 
00004 class Screen2 : public Scene
00005 {
00006 public:
00007     Screen2() :
00008         _player(),
00009         _enemy1(4),
00010         _enemy2(4)              
00011     {
00012         Game::Surface.clearScreen();
00013         
00014         addGameObject(&_enemy1);
00015         addGameObject(&_enemy2);        
00016         addGameObject(&_player);
00017         
00018         restartScreen();
00019     }
00020     
00021     virtual void restartScreen()
00022     {
00023         _player.setStartPosition(8, 8);        
00024         _enemy1.setStartPosition(140, 8);        
00025         _enemy2.setStartPosition(90, 32);        
00026         
00027         setPosition(0, 32);
00028         setMap(Maps::Screen2, 20, 7, blocks, sprites);
00029         
00030         Scene::restartScreen();
00031     }
00032     
00033 private:    
00034     Player        _player;
00035     BouncingEnemy _enemy1;
00036     BouncingEnemy _enemy2;            
00037 };
00038 
00039 #endif //__SCREEN2_H__