36 #ifndef SNES_OBJECTS_INCLUDE
37 #define SNES_OBJECTS_INCLUDE
43 #define OB_TYPE_MAX 64
84 }
t_objs __attribute__((__packed__));
92 #define T_EMPTY 0x0000
93 #define T_SOLID 0xFF00
94 #define T_LADDER 0x0001
95 #define T_FIRES 0x0002
96 #define T_SPIKE 0x0004
97 #define T_PLATE 0x0008
98 #define T_SLOPEU1 0x0020
99 #define T_SLOPED1 0x0021
100 #define T_SLOPELU2 0x0022
101 #define T_SLOPELD2 0x0023
102 #define T_SLOPEUU2 0x0024
103 #define T_SLOPEUD2 0x0025
105 #define ACT_STAND 0x0000
106 #define ACT_WALK 0x0001
107 #define ACT_JUMP 0x0002
108 #define ACT_FALL 0x0004
109 #define ACT_CLIMB 0x0008
110 #define ACT_DIE 0x0010
111 #define ACT_BURN 0x0020
123 void objInitGravity(u16 objgravity, u16 objfriction);
void objUpdateXY(u16 objhandle)
Update X & Y coordinates of object regarding its own velocitys.
void objRefreshAll(void)
call refresh function for all objects currently on screen.
void objCollidMapWithSlopes(u16 objhandle)
check if an object collides the map with map slopes management
t_objs objbuffers[OB_MAX]
current object buffer with all objects
u16 objNew(u8 objtype, u16 x, u16 y)
Initialize a new object in game, objgetid will has the id of the object.
void objCollidMap(u16 objhandle)
check if an object collides the map
void objInitFunctions(u8 objtype, void *initfct, void *updfct, void *reffct)
Initialize the object type functions (initialize, update)
u16 objptr
pointer to current object
void objUpdateAll(void)
call update function for all objects currently active (if they are in "virtual screen" coordinates).
#define OB_MAX
Definition: object.h:41
void objGetPointer(u16 objhandle)
get the pointer to an object from its handle (need to do -1 to have offset after),...
void objKill(u16 objhandle)
kill an object from the game
void objInitEngine(void)
Initialize object engine, need to be called once.
void objCollidMap1D(u16 objhandle)
check if an object collides the map
u16 objgetid
id of current object (useful when creating it)
u8 objtokill
put 1 in variable to kill current object
u16 objCollidObj(u16 objhandle1, u16 objhandle2)
check if two objects are colliding
void objLoadObjects(u8 *sourceO)
Load all objects for a specific table in memory.
void objKillAll(void)
kill all objects currently active
Custom types used by libsnes.
object definition (64 bytes)
Definition: object.h:49
u8 type
Definition: object.h:52
u16 parentID
Definition: object.h:79
u16 sprframe
Definition: object.h:59
u8 sprflip
Definition: object.h:57
u8 onscreen
Definition: object.h:82
u8 tempo
Definition: object.h:76
u8 sprrefresh
Definition: object.h:81
s16 xvel
Definition: object.h:68
u16 height
Definition: object.h:65
s16 yvel
Definition: object.h:69
u16 width
Definition: object.h:64
u16 sprblk3216
Definition: object.h:56
u16 tilebprop
Definition: object.h:73
u16 yofs
Definition: object.h:63
u8 hitpoints
Definition: object.h:80
u16 tilesprop
Definition: object.h:72
u8 nID
Definition: object.h:53
u8 count
Definition: object.h:77
u16 prev
Definition: object.h:50
u8 status
Definition: object.h:75
u8 sprpal
Definition: object.h:58
u16 sprid3216
Definition: object.h:55
u16 xmax
Definition: object.h:67
u16 xofs
Definition: object.h:62
u8 dir
Definition: object.h:78
u16 tileabove
Definition: object.h:71
u16 sprnum
Definition: object.h:54
u16 tilestand
Definition: object.h:70
u16 action
Definition: object.h:74
u16 next
Definition: object.h:51
u16 xmin
Definition: object.h:66