BEEP-8 Helper Lib 1.0.0
|
Base class for creating PICO-8 compatible applications in C/C++. More...
#include <pico8.h>
Public Member Functions | |
void | run () |
Runs the application by calling the overridden _init() , _update() , and _draw() . | |
Friends | |
class | ImplPico8 |
Base class for creating PICO-8 compatible applications in C/C++.
In the original PICO-8 environment, init()
, update()
, and draw()
are reserved functions that are used to initialize, update, and render the game, respectively. This class provides a C/C++ compatible API for users to implement similar functionality by creating a derived class.
Users are expected to create a subclass of Pico8
and override the following virtual functions:
_init()
: Called once at the beginning, for any initialization code._update()
: Called every frame to handle game logic and state updates._draw()
: Called every frame after _update()
, used to render the graphics.Example:
The run()
function in this class is responsible for executing the application by calling _init()
, _update()
, and _draw()
in the appropriate order.