![]() |
cmdfx 0.1.1
Lightweight game engine for your terminal
|
Mass-related physics declarations. More...
#include "cmdfx/core/sprites.h"
Go to the source code of this file.
Functions | |
int | Sprite_getDefaultMass (CmdFX_Sprite *sprite) |
Gets the default mass of a sprite. | |
int | Sprite_getMass (CmdFX_Sprite *sprite) |
Gets the mass of a sprite. | |
int | Sprite_setMass (CmdFX_Sprite *sprite, int mass) |
Sets the mass of a sprite. | |
int | Sprite_resetMass (CmdFX_Sprite *sprite) |
Resets the mass of a sprite. | |
Mass-related physics declarations.
int Sprite_getDefaultMass | ( | CmdFX_Sprite * | sprite | ) |
Gets the default mass of a sprite.
The default mass of a sprite is calculated by the number of non-whitespace characters in a sprite map. ANSI codes have no effect on the mass of a sprite.
sprite | The sprite to use. |
int Sprite_getMass | ( | CmdFX_Sprite * | sprite | ) |
Gets the mass of a sprite.
This will default to Sprite_getDefaultMass
if a custom mass has not been set.
sprite | The sprite to use. |
int Sprite_resetMass | ( | CmdFX_Sprite * | sprite | ) |
Resets the mass of a sprite.
This method will reset the mass of a sprite to the default value.
sprite | The sprite to use. |
int Sprite_setMass | ( | CmdFX_Sprite * | sprite, |
int | mass ) |
Sets the mass of a sprite.
This method can be used to set custom mass values for a sprite. You can still calculate the original value with Sprite_getDefaultMass
.
sprite | The sprite to use. |
mass | The mass of the sprite. |