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

Fix16/Fix16.h

Committer:
taylorza
Date:
2015-02-16
Revision:
16:f9227904afc4
Parent:
4:45ff7fc8a431

File content as of revision 16:f9227904afc4:

#ifndef __FIX16_H__
#define __FIX16_H__

#define FIX_SHIFT   16

typedef int32_t fix16_t;

static const fix16_t fix16_one = 1 << FIX_SHIFT;
static const fix16_t fix16_100  = 100 << FIX_SHIFT;
static const fix16_t fix16_half = 0x00008000;


static inline fix16_t fix16_add(fix16_t x, fix16_t y) { return x + y; }
static inline fix16_t fix16_sub(fix16_t x, fix16_t y) { return x - y; }
static inline fix16_t fix16_mul(fix16_t x, fix16_t y) { return (fix16_t)(((int64_t)x * y) >> FIX_SHIFT); }
static inline fix16_t fix16_div(fix16_t x, fix16_t y) { return (fix16_t)(((int64_t)x << FIX_SHIFT) / y); }

static inline fix16_t fix16_from(int x) { return x << FIX_SHIFT; }
static inline fix16_t fix16_from(float x) { return (fix16_t)(fix16_one * x); }

static inline int fix16_to_int(fix16_t x) { return x >> FIX_SHIFT; }
static inline float fix16_to_float(fix16_t x) { return (float)x / fix16_one; }

#endif //__FIX16_H__