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

Revision:
2:97d01ba6cd91
Child:
4:45ff7fc8a431
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BouncingEnemy.h	Thu Dec 04 03:13:14 2014 +0000
@@ -0,0 +1,40 @@
+class BouncingEnemy : public GameObject
+{
+    public:
+        BouncingEnemy(Game &game, uint8_t spriteId) :
+            GameObject(game),        
+            _dx(1),
+            _dy(1)
+        {
+            setSpriteId(spriteId);
+            setSpeed(1);            
+        }
+        
+        virtual void update()
+        {
+            if (_dx > 0) 
+            {
+                if (!moveRight()) _dx = -1;
+            }
+            else if (_dx < 0)
+            {
+                if (!moveLeft()) _dx = 1;
+            }
+            
+            if (_dy > 0) 
+            {
+                if (!moveDown()) _dy = -1;
+            }
+            else if (_dy < 0)
+            {
+                if (!moveUp()) _dy = 1;
+            }
+            
+            animate();
+        }
+        
+    private:        
+        int8_t _dx;
+        int8_t _dy;
+};
+