


To support mouse input, this is the place to keep track of the pointer’s position. The _update function handles user input and updates to your game’s state.

For a game that requires mouse input, you’ll need to make a special call to enable it: function _init( ) This function isn’t strictly part of the game loop since it only runs once, on start. Start by setting up any required actions in _init(). This first revision will display a cursor on the screen that moves as you move your mouse. You can see how these work by creating the skeleton of a game. These functions are special because PICO-8 calls them automatically, when necessary. PICO-8 has excellent built-in support for a game loop via its functions _init(), _update(), and _draw(). Whichever language you’re using, game development typically centers around a “game loop”.
