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
13
S
4
G
1
Posts: 101
Reputation: 2,389

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
72
S
25
G
20
Posts: 1,762
Reputation: 18,314


Return to How do I....?

Who is online

Users browsing this forum: draiza, Eren, fbarraza28, Jayextee, R0J0hound, RogerBarber and 4 guests