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.
Diff: RetroGameEngine/ImageFrame.h
- Revision:
- 9:34008d8b1cdf
- Child:
- 10:782e4e9c6b47
diff -r ad5164d57f0d -r 34008d8b1cdf RetroGameEngine/ImageFrame.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RetroGameEngine/ImageFrame.h Sun Jan 11 02:53:03 2015 +0000 @@ -0,0 +1,34 @@ +#ifndef __IMAGEFRAME_H__ +#define __IMAGEFRAME_H__ + +class ImageFrame +{ + public: + ImageFrame(const uint8_t *pSheet, + uint8_t x, uint8_t y, uint8_t width, uint8_t height) : + _pSheet(pSheet + 4), + _stride((*((uint16_t*)pSheet)) >> 3), + _x(x), + _y(y), + _width(width), + _height(height) + { + } + + inline uint8_t *getBits(int row) const + { + int offset = ((_y + row) * _stride) + (_x >> 3); + return (uint8_t*)(_pSheet + offset); + } + + private: + const uint8_t *_pSheet; + uint8_t _stride; + uint8_t _x; + uint8_t _y; + uint8_t _width; + uint8_t _height; +}; + +#endif //__IMAGEFRAME_H__ +