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 Screen3.h Source File

Screen3.h

00001 #ifndef __SCREEN3_H__
00002 #define __SCREEN3_H__
00003 
00004 class Screen3 : public Scene
00005 {
00006 public:
00007     Screen3() :
00008         _player(),
00009         _enemy1(2, PatrollingEnemy::UpDown),
00010         _enemy2(2, PatrollingEnemy::UpDown)              
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(136, 96);        
00024         _enemy1.setStartPosition(24, 16);        
00025         _enemy2.setStartPosition(88, 32);        
00026                 
00027         setPosition(0, 8);
00028         setMap(Maps::Screen3, 20, 15, blocks, sprites);
00029         
00030         Scene::restartScreen();
00031     }
00032     
00033 private:    
00034     Player          _player;
00035     PatrollingEnemy _enemy1;
00036     PatrollingEnemy _enemy2;                    
00037 };
00038 
00039 #endif //__SCREEN3_H__