Special bullet movement?

Get help using Construct 2

Post » Tue Mar 25, 2014 4:38 pm

To make enemies follow the player, I'm using "set bullet to angle(BoxWalker.x,BoxWalker.y,BoxPsi.x,BoxPsi.y)" How would I make it so an enemy would move to a certain position away from the character to use range attacks? Say I wanted the enemy to move to a position 600 pixels from the player? Any ideas? Thank you. :)
Image
B
20
S
4
Posts: 382
Reputation: 2,984

Post » Tue Mar 25, 2014 4:51 pm

Could you do something like:
distance( enemy.x, enemy.y, player.x, player.y) < 600 set speed to 0
Or something of that nature...
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Tue Mar 25, 2014 5:48 pm

My enemies will only fire in straight lines to I will need to get them to line up with the players Y. That is easy enough to do, I think, but I want them to also move a certain distance from the player--within range.
Image
B
20
S
4
Posts: 382
Reputation: 2,984

Post » Tue Mar 25, 2014 6:26 pm

So is it possible that the enemies are too close to the player? And so would need to move away from the player to get into proper range? Or are they always going to be farther away and you just want them to move in to proper range?

Do you want diagonal movement for the enemies? Can they move to the player's Y, and then move up into range?
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Tue Mar 25, 2014 6:44 pm

Maybe use line of site, have them move toward the player, until the line of site is within range?

https://www.scirra.com/manual/163/line-of-sight

https://www.scirra.com/tutorials/474/pathfinding-with-line-of-sight
B
240
S
62
G
33
Posts: 903
Reputation: 40,589


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests