#ifndef _H_Sprite #define _H_Sprite #include enum { SPRITE_WIDTH = 16, // in pixels BYTES_PER_BITMAP_ROW = 6, MAX_BITMAP_HEIGHT = 42, // 43*BYTES_PER_BITMAP_ROW would be > 255 and would require MUL168 }; typedef struct Sprite { BOOL active; byte x; // horiz. pos. in pixels byte y; // vert. pos. in pixels byte h; // height in pixels (1..MAX_BITMAP_HEIGHT) sbyte dx; // horiz. speed in pixels per frame sbyte dy; // vert. speed in pixels per frame const struct PreShiftedBitmap *bm; // pointer to _bm bitmap def byte bitmapIndex; // useful for animation and to update 'bm' byte timeToLive; // number of frames before this sprite dies } Sprite; // Initializes the sprite at 's' at position (0, 0), // with speed (0, 0) and makes it use the specified bitmap. // Sets the active field to true. // bitmap: Must NOT be null. // void Sprite_init(Sprite *s, const struct PreShiftedBitmap *bitmap); #endif /* _H_Sprite */