Spawn Enemies in the near of the Player

Get help using Construct 2

Post » Wed Oct 16, 2013 2:05 pm

Hello,

Ive created a game like Doodle Jump, now i want to create enemies.
I want that the Enemies will spawn in the near from the Player. But not to
close, so that the player can jump 4-5 Platforms and there is the Enemie.
B
11
S
2
Posts: 93
Reputation: 917

Post » Wed Oct 16, 2013 2:50 pm

Why not randomly create the enemy together with each platform (that is allowed to hold enemies)?
Or check the position of your player (player.y) and run a enemy creation function that creates an enemy on a random platform 600 till 1000 pixels above the player (or other values).
To do so just use system -> pick (platform) by comparison and compare the y-values.
Or if enemies are to be in the air, just let the system create an enemy and set their locations in relation to your players position.
like x: player.x+floor(random(400)) y: player.x+600+floor(random(400))mindfaQ2013-10-16 14:50:43
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Wed Oct 16, 2013 2:59 pm

How can i spawn randomly Enemies?PlasmaGames20132013-10-16 17:05:08
B
11
S
2
Posts: 93
Reputation: 917

Post » Fri Oct 18, 2013 10:33 pm

I dont understand how i can spawn the enemys in the Air and on the Platform randomly.

I can let them spawn just in the air and much as platforms they are, but i want that i can say, that i want, that the enemies spawn just for 5%
B
11
S
2
Posts: 93
Reputation: 917

Post » Fri Oct 18, 2013 11:48 pm

Event:

every random(1.5,4) seconds

Action:

system--> create object
Player.x + random(-100,101)
Player.Yyonda2013-10-18 23:49:31
B
19
S
6
G
3
Posts: 197
Reputation: 4,154

Post » Sat Oct 19, 2013 6:11 pm

Thanks first, one poblem is there, the Enemies dont spawn a little bit away, they spawn there, where the Player is, is it possible to change ?
That the Monster is much higher than the player?
B
11
S
2
Posts: 93
Reputation: 917

Post » Sat Oct 19, 2013 6:39 pm

Oh, had a typo ^^
Increase the numbers.

x: player.x+floor(random(400)) y: player.y-600-floor(random(400))
or

system--> create object
Player.x + random(-100,101)
Player.Y -1000
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Sat Oct 19, 2013 10:52 pm

exactly, just increase the numbers.
B
19
S
6
G
3
Posts: 197
Reputation: 4,154

Post » Sun Oct 20, 2013 3:16 pm

Okey, how can i make it, that the Enemies will directly spawn on a Platform and not in the Air ?
B
11
S
2
Posts: 93
Reputation: 917

Post » Mon Oct 21, 2013 3:29 pm

push
B
11
S
2
Posts: 93
Reputation: 917

Next

Return to How do I....?

Who is online

Users browsing this forum: kurtbal, Seruza and 11 guests