How do I Make A Range Enemy

Get help using Construct 2

Post » Mon Jun 08, 2015 6:35 pm

I am making a survival type of game except the enemies run towards you and you have to defeat them before they defeat you. (I plan on porting it to the mobile platform but that later)

What I want is for the player to run onto the screen, and once he becomes a certain distance from the player he starts throwing projectiles. I can get the enemy to work when the enemy is on the right side of the player, but I'm trying to have enemies spawn all around the player.

How do I make the player the object that the enemies base their position off of on either side of the player, then stop and attack. (I got the attacking part, just running on to the screen and stopping from either side is where I'm stuck)

Thank You
B
6
S
1
Posts: 46
Reputation: 476

Post » Mon Jun 08, 2015 8:24 pm

There's a behavior called LOS, or Line of sight. Check some tutorials about this, it'll help you a LOT to do this game ;)
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Tue Jun 09, 2015 5:15 pm

I thought that behavior was for patrolling but now I think about it (now that you mention it) that might just be crazy enough to work lol thanks
B
6
S
1
Posts: 46
Reputation: 476

Post » Tue Jun 09, 2015 5:40 pm

For each enemy
System compare two values : distance(enemy.x,enemy.y,player.x,player.y) < 150
> enemy spawn projectile
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: SputnikCZ, UberLou and 2 guests