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:
9:34008d8b1cdf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RetroGameEngine/Rect.h	Sun Jan 11 02:53:03 2015 +0000
@@ -0,0 +1,43 @@
+#ifndef __RECT_H__
+#define __RECT_H__
+
+#include <algorithm>
+
+struct Rect
+{
+    uint8_t left;
+    uint8_t top;
+    uint8_t right;
+    uint8_t bottom;
+    
+    Rect() :
+        left(0),
+        top(0),
+        right(0),
+        bottom(0)
+    {
+    }
+    
+    Rect(uint8_t l, uint8_t t, uint8_t w, uint8_t h) :
+        left(l),
+        top(t),
+        right(l + (w - 1)),        
+        bottom(t + (h - 1))
+    {
+    }
+    
+    Rect Intersection(Rect &rect)
+    {
+        uint8_t x1 = max(left, rect.left);
+        uint8_t y1 = max(top, rect.top);
+        uint8_t x2 = min(right, rect.right);
+        uint8_t y2 = min(bottom, rect.bottom);
+        
+        return Rect(x1, y1, x2, y2); 
+    }
+    
+    inline uint8_t getWidth() const { return right - left; }
+    inline uint8_t getHeight() const { return bottom - top; }
+};
+
+#endif //__RECT_H__
\ No newline at end of file