Bullet's angle of motion ?

Get help using Construct 2

Post » Wed May 07, 2014 7:34 pm

I have an object (sprite) that moves in different directions using the Bullet behavior. I want to change object's animation based on the angle of motion. As far I can see, the Bullet behavior does not use 360 degrees...

So how do I calculate Bullet's angle of motion ?
B
49
S
15
G
6
Posts: 536
Reputation: 7,199

Post » Wed May 07, 2014 10:20 pm

The value you get from the bullet's angle of motion expression is in the range of -180 to 180, which still is a range of 360 degrees and still works with most all angle ACEs. If you want to convert it to the range of 0-360 do this:
Code: Select all
(ang + 360)%360
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Wed May 07, 2014 10:40 pm

@R0J0hound
Thanks, after playing a little in debug mode, I noticed that after 180 degrees it goes to negative values. Also thank you very much for the formula. This should be specified in the manual because is very useful :D
B
49
S
15
G
6
Posts: 536
Reputation: 7,199

Post » Sat Jun 07, 2014 1:59 am

Thanks for the reply - Really needed that...
B
4
Posts: 2
Reputation: 204

Post » Mon Sep 01, 2014 2:17 pm

Thanks for the formula. !
B
9
S
3
G
1
Posts: 23
Reputation: 828


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests