24 lines
431 B
Plaintext
24 lines
431 B
Plaintext
//"global" variables
|
|
var frameCounter: Int = 0;
|
|
var posCounter: Int = 0;
|
|
|
|
fn onReady() {
|
|
loadMonsterSprite("parvati", "assets/parvati.png", 32, 32);
|
|
}
|
|
|
|
fn onStep() {
|
|
frameCounter++;
|
|
|
|
if (frameCounter % 100 == 0) {
|
|
spawnMonsterAt("parvati", posCounter*50, posCounter*50);
|
|
posCounter++;
|
|
}
|
|
}
|
|
|
|
fn onClose() {
|
|
//
|
|
}
|
|
|
|
//example API for the game
|
|
initScreen(1280, 720, "Hello raylib from Toy!");
|
|
initLoop(onReady, onStep, onClose); |