How do I turn the enemy angle in multiples of 90/180 degrees

Get help using Construct 2

Post » Sun Feb 07, 2016 4:29 pm

How can I do to turn the enemy angle to face the player (and to shoot him) in multiples of 90 or 180 degrees (front/back) and then returns to the original angle?

Another doubt: Is possible to use tiles do define the enemy movement? (e.g. enemy> is overlapping tilemap & tilemap.tileAt =10 : set enemy>bullet>angle of motion to 90).

https://www.dropbox.com/s/ux9igk13ezh3z ... .capx?dl=0

Edited: I forgot to say that I'm using "Line of sight" to detect the enemy proximity.
B
70
S
13
G
2
Posts: 989
Reputation: 6,914

Post » Sun Feb 07, 2016 10:25 pm

Ok! I have been playing with your demo.

First issue is image point 0 should be middle.

also the else statement should be has inline of sight (inverted)

I also had to add set bullet angle of motion to sprite x,y on bullet enable to keep it from wandering off the screen.

as for the rotate 90/180 that works once image point 0 is middle,
But I changed that to set angle to player x,y for better response.

Image
B
29
S
13
G
10
Posts: 355
Reputation: 8,312

Post » Sun Feb 07, 2016 10:29 pm

if you remove trigger once in line 2 the enemy follows player angle until out of line of sight.

working demo with mods made.

https://www.scirra.com/arcade/other-gam ... -demo-5401
B
29
S
13
G
10
Posts: 355
Reputation: 8,312


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests