Import coco-planes 0.1.0 upstream source snapshot
Original author: Pierre Sarrazin. Preserve upstream GPLv3-or-later and file-specific notices. Source: http://sarrazip.com/dev/coco-planes-0.1.0.tar.gz Archive SHA-256: 29191e6ba225965caa637ee726e1189639dc7fcdf2b68310fb93fbffd56c9c52
This commit is contained in:
commit
7939132267
78 files changed
+6990
No files matched your search
@@ -0,0 +1,37 @@
|
||||
#ifndef _H_Sprite
|
||||
#define _H_Sprite
|
||||
|
||||
#include <coco.h>
|
||||
|
||||
|
||||
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 */
|
||||
Reference in new issue
Block a user