| void GamePawn_Initialize( |
| ) |
Initialize a game pawn.
| pawn Game_Pawn* | Address of game pawn structure to initialize. This is he structure to be used for all other functions. |
| sprtList const Game_Sprite* | Array of all sprite layers used to display the pawn. See <Game_Sprite> for details. |
| sprtNum u8 | Size of the 'sprtList' table (in entries number). |
| sprtID u8 | First srite index to use for the pawn. The pawn will use all sprite indexes from 'sprtID' to 'sprtID + sprtNum - 1'. If <GAMEPAWN_ID_PER_LAYER> compile option is activated, this parmeter is not used as each sprit layer define it's own sprite index. |
| actList const Game_Action* | Array of pawn action. Needed to use GamePawn_SetAction function. |
| void GamePawn_SetPosition( |
| ) |
Set game pawn position. Force movement even if collision is activated.
| pawn Game_Pawn* | Address of game pawn structure to move. |
| x u8 | New X coordinate (in pixels). |
| y u8 | New Y coordinate (in pixels). |
| void GamePawn_SetAction( |
| ) |
Set game pawn current action index.
| pawn Game_Pawn* | Address of game pawn structure to setup. |
| id u8 | New action index. |
| inline void GamePawn_SetTileMap( |
| ) |
Set the tile map to be used for collision. Available only when GAMEPAWN_TILEMAP_SRC is set to GAMEPAWN_TILEMAP_SRC_RAM.
| map const u8* | Pointer to RAM buffer with the tile map. Size must be GAMEPAWN_TILEMAP_WIDTH * GAMEPAWN_TILEMAP_HEIGHT. |
| void GamePawn_Update( |
| ) |
Update animation of the game pawn. Must be called once a frame.
| pawn Game_Pawn* | Address of game pawn structure to update (move, collision, etc.). |
| void GamePawn_Draw( |
| ) |
Update rendering of the game pawn. Must be called once a frame.
| pawn Game_Pawn* | Address of game pawn structure to draw. |
| void GamePawn_SetMovement( |
| ) |
Set pawn relative movement. Collision can prevent part of the movement. Only available if GAMEPAWN_USE_PHYSICS compile option is set to TRUE.
| pawn Game_Pawn* | Address of game pawn structure to move. |
| x | New X movement (in pixels). |
| y | New Y movement (in pixels). |
| inline void GamePawn_SetTargetPosition( |
| ) |
Set pawn absolute movement. Collision can prevent part of the movement. Only available if GAMEPAWN_USE_PHYSICS compile option is set to TRUE.
| pawn Game_Pawn* | Address of game pawn structure to move. |
| x u8 | New X coordinate (in pixels). |
| y u8 | New Y coordinate (in pixels). |
Set pawn physics callback Only available if GAMEPAWN_USE_PHYSICS compile option is set to TRUE.
| pawn | Address of game pawn structure to initialize. |
| pcb | Callback function to be called when physics events occurs. |
| ccb | Callback function to be called when collision events occurs. |
| boundX | Bounding box X extend (in pixels, from the pawn's origin). |
| boundY | Bounding box Y extend (in pixels, from the pawn's origin). |
| inline u8 GamePawn_GetPhysicsState( |
| ) |
Get pawn physics state. Only available if GAMEPAWN_USE_PHYSICS compile option is set to TRUE.
| pawn Game_Pawn* | Pointer to pawn structure. |
Pawn's physics state.
Get the X coordinate of the cell that triggered a callback. The value is only valid within a callback. Only available if GAMEPAWN_USE_PHYSICS compile option is set to TRUE.
X coordinate of the current cell.
Get the Y coordinate of the cell that triggered a callback. The value is only valid within a callback. Only available if GAMEPAWN_USE_PHYSICS compile option is set to TRUE.
Y coordinate of the current cell.