• 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!

small problem, big disperation

H

heanfry

Guest
hey people,

so i want an enemy to move, and if it reaches a certain (collision) point it will create another enemy. The problem i have is, that i check the collision in the step event, so while the enemy is colliding its permanently spawing enemys, but i want only one enemy to spawn if it collides. how can i do that..



Pls help me thank you :ß
 

PNelly

Member
You just need a variable representing whether that enemy has already created another enemy.

// Create Event
Code:
has_created_enemy = false;
// Step Event
Code:
if( <collision check stuff> && has_created_enemy == false ){
     has_created_enemy = true;
     <create enemy stuff>
}
 
C

charley_43613

Guest
How do I create my own thread instead of replying to posts...
 
Top