No turret rotation = Turret won't shoot?

For questions about using Classic.

Post » Fri Aug 16, 2013 4:08 pm

Same problem :)
is there simple way to do it?
HELP:)

THANKS!:)
B
9
S
2
Posts: 82
Reputation: 914

Post » Fri Feb 26, 2016 6:20 pm

[FIXED]I have the same problem and solved it by this. I didn't use turret at all. I just added even "Every X seconds". Then action I added to spawn a new object (the bullet). Then the next action just below is set bullet angle to "atan((player.y - enemy.y)/(player.x-enemy.x))". Then I noticed this only works well when the player is on the right side of the enemy other wise its 180 degrees off. So I did the following. Every X seconds sits alone with two sub events. First sub is System compare two values (player.x > enemy.x). For this sub put the two actions spawn bullet and set bullet angle to "atan((player.y - enemy.y)/(player.x-enemy.x))" The second sub is "Else" and has two actions, spawn bullet and set bullet angle to "atan((player.y - enemy.y)/(player.x-enemy.x)) - 180".

This seemed to work fine for me. Just a little bit of trig and some testing.
B
6
Posts: 8
Reputation: 430

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests