Zombies follow the player

This commit is contained in:
2026-05-30 20:36:06 +10:00
parent 7e1c589eab
commit 8502841e89
4 changed files with 24 additions and 3 deletions
+5 -1
View File
@@ -81,7 +81,7 @@ static void api_loadSprite(Toy_VM* vm, Toy_FunctionNative* self) {
}
static void api_spawnActorAt(Toy_VM* vm, Toy_FunctionNative* self) {
//sprite, onStep, x, y -> void
//sprite, onStep, x, y -> Opaque(Actor)
(void)self;
//check for initialization
@@ -172,6 +172,10 @@ static void api_spawnActorAt(Toy_VM* vm, Toy_FunctionNative* self) {
.enabled = true,
};
//leave the actor on the stack
Toy_Value value = TOY_OPAQUE_FROM_POINTER(newActorPtr);
Toy_pushStack(&vm->stack, value);
Toy_freeValue(spriteValue);
Toy_freeValue(key);
Toy_freeValue(step);