Monster spawning is controlled from the scripts

This commit is contained in:
2026-05-01 18:45:40 +10:00
parent 502dab670e
commit a45b2e71af
5 changed files with 256 additions and 19 deletions
+22 -1
View File
@@ -2,4 +2,25 @@ var screenWidth = 1280;
var screenHeight = 720;
var screenCaption = "Hello raylib from Toy!";
//TODO: load monsters on a timer?
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++;
if (frameCounter % 100 == 0) {
spawnMonsterAt("parvati", posCounter*50, posCounter*50);
posCounter++;
}
}
//this runs as the game is closing down
fn onFinished() {
//
}