how to spawn object every time variable is increased by 5?

Get help using Construct 2

Post » Wed Apr 23, 2014 5:43 pm

how can i make it so that every time my variable for the score is increased by 5, the game spawns another enemy?

don't know how to do it without having to compare it with every number that is divisible by 5
B
5
Posts: 26
Reputation: 283

Post » Wed Apr 23, 2014 6:10 pm

Spawn_count = Spawn_count + 1
if Spawn_count = 5
-- spawn object,
-- set Spawn_count = 0

or

If object.count not= int(number / 5) then spawn object
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,422
Reputation: 57,681

Post » Wed Apr 23, 2014 6:38 pm

Colludium wrote:Spawn_count = Spawn_count + 1
if Spawn_count = 5
-- spawn object,
-- set Spawn_count = 0

or

If object.count not= int(number / 5) then spawn object


didn't really understand that but it gave me an idea which works.

my character on collision with an item, adds 1 to the variable
if the variable = 5, enemy spawn and set the variable back to 0

edit: ... i just realized that that's what you meant :S silly me

thanks for the help!
B
5
Posts: 26
Reputation: 283

Post » Wed Apr 23, 2014 7:50 pm

Glad it works!
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,422
Reputation: 57,681


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Laura_D and 6 guests