-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgameloop.go
More file actions
25 lines (21 loc) · 819 Bytes
/
gameloop.go
File metadata and controls
25 lines (21 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2025 Jacek Olszak
// This code is licensed under MIT license (see LICENSE for details)
package pi
// Game-loop function callbacks.
var (
// Init is a user-defined function called once when the game starts.
//
// Use this function to initialize the game state, load assets,
// or prepare data needed before the main loop begins.
Init = func() {}
// Update is a user-provided function called every frame.
//
// This function handles user input, performs calculations, and updates
// the game state. Typically, it does not draw anything on the screen.
Update = func() {}
// Draw is a user-provided function called up to once per frame.
// Pi may skip calling this function if the previous frame took too long.
//
// The purpose of this function is to draw to the screen.
Draw = func() {}
)