• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Instance creation keeps doubling

J

James7285

Guest
I have an object in my game that I want to randomly spawn a new one every 60 frame.

Under the create code I have:

Code:
alarm[0] = 60;
Then under the alarm 0 code I have

Code:
alarm[0] = 60;
instance_create(random(room_width),random(room_height),obj_powerup);
Problem is when you run the game, after 60 frame it creates 1 instance of the object, after a further 60 it creates two object, then four, then eight and keeps doubling every time. I can't work out why that is?

I just want it to create 1 new instance each time.
 
S

Salvakiya

Guest
yea I would guess that you are creating an instance which also has that in its code... is it a powerup which runs this alarm?
 
J

James7285

Guest
Of course! How stupid of me.

Yeah the code was in the power up!

It's been corrected and is working now. Thank you.
 
Top