cmdfx 0.2.0
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
engine.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "cmdfx/core/sprites.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
28
39int Sprite_setStatic(CmdFX_Sprite* sprite, int isStatic);
40
41// Engine Declarations
42
52
62int Engine_setForceOfGravity(double force);
63
73
83int Engine_setTerminalVelocity(double velocity);
84
95
106
107// Engine Defaults
108
121
135
150
166int Engine_setCharacterMass(char c, double mass);
167
168// Engine
169
179
191
203
210
211#ifdef __cplusplus
212}
213#endif
double Engine_getTerminalVelocity()
Gets the terminal velocity, in characters per second.
double Engine_getDefaultFrictionCoefficient()
Gets the default friction coefficient for a sprite.
int Engine_setGroundY(int y)
Sets the Y level of the ground for the physics engine.
double Engine_getCharacterMass(char c)
Gets the default mass of a character.
int Engine_setCharacterMass(char c, double mass)
Sets the default mass of a character.
int Engine_getGroundY()
Gets the Y level of the ground for the physics engine.
int Sprite_isStatic(CmdFX_Sprite *sprite)
Gets whether this sprite is static.
int Engine_cleanup()
Cleans up the physics engine.
int Engine_setTerminalVelocity(double velocity)
Sets the terminal velocity, in characters per second.
int Sprite_setStatic(CmdFX_Sprite *sprite, int isStatic)
Sets whether this sprite is static.
int Engine_setForceOfGravity(double force)
Sets the force of gravity, in characters per second squared.
CmdFX_Sprite ** Engine_tick()
Ticks the physics engine.
double Engine_getForceOfGravity()
Gets the force of gravity, in characters per second squared.
int Engine_start()
Starts up the physics engine.
int Engine_end()
Stops the physics engine.
int Engine_setDefaultFrictionCoefficient(double coefficient)
Sets the default friction coefficient for a sprite.
Sprites API for CmdFX.
Represents a sprite that can be drawn to the terminal.
Definition sprites.h:30