How do I [enemy spawn problem]

Get help using Construct 2

Post » Sun May 01, 2016 2:40 pm

Hey guys. I am making a top down shooter and I am trying to implement a enemy spawn system where once you have killed all the enemies on screen, double the amount spawn in their place at random points of the layout. could someone please help me.
Thank you for your time.
B
8
S
1
Posts: 8
Reputation: 428

Post » Sun May 01, 2016 3:31 pm

Here are 2 ways to do it

1. Event objEnemy > is NOT "on-screen" | system > create objEnemy
Here you check if the object is on-screen and invert it. Then you run a loop for how many new enemies you want to spawn (the loop number could come from a variable)

2. with a variable
For every enemy you destroy you subtract 1 from your variable. If 0 then create new enemies and add 1 to your varEnemy

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Sun May 01, 2016 8:53 pm

Working perfectly thanks for the help :)
B
8
S
1
Posts: 8
Reputation: 428


Return to How do I....?

Who is online

Users browsing this forum: Euduardo, Kin, mikehive, ratboy3, tinhofiel and 37 guests