Adjusted API to a more explicit layout

This commit is contained in:
2026-05-03 12:33:59 +10:00
parent f4e41fdd24
commit 033ebfd561
4 changed files with 151 additions and 57 deletions
+7 -9
View File
@@ -1,16 +1,11 @@
var screenWidth = 1280;
var screenHeight = 720;
var screenCaption = "Hello raylib from Toy!";
//"global" variables
var frameCounter: Int = 0;
var posCounter: Int = 0;
//this runs before the game starts
fn onReady() {
loadMonsterSprite("parvati", "assets/parvati.png", 32, 32);
}
//this runs each frame
fn onStep() {
frameCounter++;
@@ -20,7 +15,10 @@ fn onStep() {
}
}
//this runs as the game is closing down
fn onFinished() {
fn onClose() {
//
}
}
//example API for the game
initScreen(1280, 720, "Hello raylib from Toy!");
initLoop(onReady, onStep, onClose);