|
SDLGameEngine
|
Sprite groups. More...
Data Structures | |
| struct | SGESPRITEGROUP |
| holds a SGEARRAY with all sprites of the group More... | |
Functions | |
| SGESPRITEGROUP * | sgeSpriteGroupNew (void) |
| creates a new empty spritegroup | |
| void | sgeSpriteGroupDestroy (SGESPRITEGROUP *g) |
| destroy a spritegroup and free resources | |
| void | sgeSpriteGroupAddSprite (SGESPRITEGROUP *g, SGESPRITE *s) |
| adds a sprite to the group | |
| int | sgeSpriteGroupCollide (SGESPRITEGROUP *g, SGESPRITEGROUP *cg) |
| checks if two sprite groups collide anywhere | |
| int | sgeSpriteGroupCollideSprite (SGESPRITEGROUP *g, SGESPRITE *s) |
| checks if a sprite collides a sprite group | |
| SGESPRITE * | sgeSpriteGroupGetCollider (SGESPRITEGROUP *g, SGESPRITEGROUP *cg) |
| get the first sprite of group g which collides with group cg | |
| SGESPRITE * | sgeSpriteGroupGetColliderSprite (SGESPRITEGROUP *g, SGESPRITE *s) |
| get the first sprite of group g which collides with sprite s | |
| void | sgeSpriteGroupDraw (SGESPRITEGROUP *g) |
| draw a complete sprite group to the screen | |
| void | sgeSpriteGroupDrawRelative (SGESPRITEGROUP *g, int camx, int camy) |
| draw a complete sprite group to the screen, relative to a 'camera' position | |
Sprite groups.
Functions to handle sprites in groups, for example for group drawing or group colliding.
| void sgeSpriteGroupAddSprite | ( | SGESPRITEGROUP * | g, |
| SGESPRITE * | s | ||
| ) |
adds a sprite to the group
| g | pointer to SGESPRITEGROUP |
| g | pointer to SGESPRITE |
Definition at line 29 of file sgespritegroup.c.
| int sgeSpriteGroupCollide | ( | SGESPRITEGROUP * | g, |
| SGESPRITEGROUP * | cg | ||
| ) |
checks if two sprite groups collide anywhere
| g | pointer to the first SGESPRITEGROUP |
| cg | pointer to the second SGESPRITEGROUP |
Definition at line 33 of file sgespritegroup.c.
| int sgeSpriteGroupCollideSprite | ( | SGESPRITEGROUP * | g, |
| SGESPRITE * | s | ||
| ) |
checks if a sprite collides a sprite group
| g | pointer to the SGESPRITEGROUP |
| s | pointer to the SGESPRITE |
This is a simple way for example to check of the player collides with any opponent.
Definition at line 38 of file sgespritegroup.c.
| void sgeSpriteGroupDestroy | ( | SGESPRITEGROUP * | g | ) |
destroy a spritegroup and free resources
| g | pointer to SGESPRITEGROUP |
Definition at line 23 of file sgespritegroup.c.
| void sgeSpriteGroupDraw | ( | SGESPRITEGROUP * | g | ) |
draw a complete sprite group to the screen
| g | pointer to the first SGESPRITEGROUP |
Definition at line 63 of file sgespritegroup.c.
| void sgeSpriteGroupDrawRelative | ( | SGESPRITEGROUP * | g, |
| int | camx, | ||
| int | camy | ||
| ) |
draw a complete sprite group to the screen, relative to a 'camera' position
| g | pointer to the first SGESPRITEGROUP |
| camx | the x coordinate of the camera |
| camy | the y coordinate of the camera |
Definition at line 72 of file sgespritegroup.c.
| SGESPRITE* sgeSpriteGroupGetCollider | ( | SGESPRITEGROUP * | g, |
| SGESPRITEGROUP * | cg | ||
| ) |
get the first sprite of group g which collides with group cg
| g | pointer to the first SGESPRITEGROUP |
| cg | pointer to the second SGESPRITEGROUP |
Definition at line 43 of file sgespritegroup.c.
| SGESPRITE* sgeSpriteGroupGetColliderSprite | ( | SGESPRITEGROUP * | g, |
| SGESPRITE * | s | ||
| ) |
get the first sprite of group g which collides with sprite s
| g | pointer to the first SGESPRITEGROUP |
| s | pointer to the SGESPRITE |
Definition at line 53 of file sgespritegroup.c.
| SGESPRITEGROUP* sgeSpriteGroupNew | ( | void | ) |
creates a new empty spritegroup
Definition at line 11 of file sgespritegroup.c.