Built-In Functions

The update(dt) function

The update(dt) function is called every frame
dt stands for delta time.

"delta time is the amount of seconds it took for the
engine to process the previous frame.
It's calculation is rather simple: it uses the
system's internal clock to compare the system time
when the engine started processing the previous
frame to the system time when the engine started
processing the current frame. Every motherboard
has a "system clock" which is responsible to keep
track of time. Operating systems have access to that
system clock and provide API's to read that clock."



An example of the update(dt) function:

@mandaw.update
def update(dt):
print(dt)



If you run this code, the program
will print out a very small number.
This number is the elapsed second
since the last update

The draw() function

The draw() function is a built in function
for drawing Entities, Sprites and Text Objects


An example of the draw() function:

@mandaw.draw
def draw():
entity.draw()

.