Bug In My Game
I appear to have made an infinite loop with my spawner. If anyone knows GM:S, I could use a little help. Here is my Object Info:
Information about object: obj_spawner
Sprite:Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask: No Physics Object Create Event:
execute code:
randomize()
wolf = irandom_range(1,10)
people = irandom_range(1,20)
if (!object_exists(obj_player)){
instance_create(x,y,obj_player)
}
Step Event:
execute code:
do
{
wolf -= 1
were = instance_create(x,y,obj_werewolf)
were.x = (irandom(1920))
were.y = (irandom(1080))
}
until (wolf =0);
do
{
people -= 1
ppl = instance_create(x,y,obj_person)
ppl.x = (irandom(1920))
ppl.y = (irandom(1080))
}
until (people = 0);
until (wolf = 0);
Also have you checked the value of wolf once assigned? If there’s any possibility of it being 0 or lower when entering the loop, the loop is only checking for = 0, what’s the harm of changing it into =<?
until (people = 0);
Is changed to:
until (people == 0);