How do I push + set a sprite angle to an opposite direction?

Get help using Construct 2

Post » Sun Sep 27, 2015 10:26 pm

https://www.dropbox.com/s/qojcrl4jg05rv1r/push.png?dl=0

I need help making the enemy sprite face the opposite direction whenever its near the player Line of Sight.

I making a battle arena game, and whenever the player double taps the screen, the player sprite creates a wave blast that pushes the enemy sprites that are near it's LOS. I want it to push and rotate the enemies current angle away from the player sprite.

Thanks in advance!
B
12
S
4
G
1
Posts: 100
Reputation: 2,362

Post » Mon Sep 28, 2015 1:04 am

You can do a On Create Blast Wave check.

Followed by Pick All Enemies by Evaluate.

Then evaluate for a distance check.

distance(Player.X, Player.Y, Enemies.X, Enemies.Y) < 400 (or whatever pixels distance you need).

Set Enemy Angle to whatever angle you desire. If its away from the player, you can set it to Player.Angle - 180. You can add random elements into it as well.

The above is run whenever a blast wave is created.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, Yahoo [Bot] and 57 guests