Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Game Functions

This page provides an overview of the essential game functions available in akesi lili for managing game logic and rendering. These functions allow you to initialize game data, update game state, and draw game elements on the screen.

init

||

The init function is called once when the game starts. It can be used to initialize the game data.

Example

s={speed:0}
init = ||
 s.speed=1

update

||

The update function is called once per game loop iteration, just before the draw function is called. Use this function to update game data, such as moving the player and NPCs.

Example

update=||
  if btn(1)
    g.pla.x+=g.speed

draw

||

The draw function is used to draw the game and is called directly after the update function.

Example

draw=||
  clear(0)
  txt('toki', 1, 1, 3)

These functions form the backbone of your game loop in akesi lili, allowing you to manage the game's initialization, update logic, and rendering efficiently.