cmdfx 0.2.1
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
CmdFX::Engine Namespace Reference

A C++ wrapper around the CmdFX Physics Engine. More...

Functions

int start ()
 
std::vector< std::unique_ptr< Sprite > > tick ()
 Ticks the physics engine and returns modified sprites.
 
void cleanup ()
 
bool isMotionDebugEnabled ()
 Checks if motion debugging is enabled.
 
bool isSpriteStatic (Sprite &sprite)
 
void setSpriteStatic (Sprite &sprite, bool isStatic)
 
double getForceOfGravity ()
 
void setForceOfGravity (double force)
 
double getTerminalVelocity ()
 
void setTerminalVelocity (double velocity)
 
int getGroundY ()
 
void setGroundY (int y)
 
double getDefaultFrictionCoefficient ()
 
void setDefaultFrictionCoefficient (double coefficient)
 
double getCharacterMass (char c)
 
void setCharacterMass (char c, double mass)
 
void enableMotionDebug ()
 Enables motion debugging.
 
void disableMotionDebug ()
 Disables motion debugging.
 

Detailed Description

A C++ wrapper around the CmdFX Physics Engine.

Function Documentation

◆ enableMotionDebug()

void CmdFX::Engine::enableMotionDebug ( )

Enables motion debugging.

This method enables motion debugging, which will print all sprite motion updates to the console at (3, <sprite id + 1>).

◆ isMotionDebugEnabled()

bool CmdFX::Engine::isMotionDebugEnabled ( )

Checks if motion debugging is enabled.

If motion debugging is enabled, the physics engine will print all sprite motion updates to the console at (3, <sprite id + 1>).

Returns
true if motion debugging is enabled, false otherwise.

◆ tick()

std::vector< std::unique_ptr< Sprite > > CmdFX::Engine::tick ( )

Ticks the physics engine and returns modified sprites.

This method ticks the physics engine, which processes all sprites and applies physics calculations to them. It returns a vector of unique_ptr<Sprite> objects that were modified during the tick.

Returns
A vector of unique_ptr<Sprite> containing all modified sprites.