"Is between angle" behaves strange

Discussion and feedback on Construct 2

Post » Wed Jun 06, 2012 7:03 pm

.CAPX
Try to move with mouse clockwise around "P" Sprite. The problem is: Why first stick stops rotating, even the angle limit is bigger than grey's?!!
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Wed Jun 06, 2012 7:28 pm

I works ... but as sprite2 and 3 are tied to sprite.angle/2 (so same value for each) ... sprite begins to move sooner but sprite3 take the same angle/2 a little time after ... when sprite2 stop taking sprite.angle/2 sprite3 continue a little time to move so it works but you must really move slowly to seen any difference as angle range is short between Sprites are allowed moving and not.

THINK i have understand what you want to do (but i'm not sure)!

Try this : replace sprite2.angle formula by sprite2.rotate dt*100 clockwise and the same for sprite3 ! and then change in formulas *100 by other values depending on turn speed wanted. At last, use a variable to see if sprite.angle change when moving mouse and how ... and adjust conditions to only rotate spr2 and spr3 when spr.angle change and in "range" of angles.naelian2012-06-06 20:58:07
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Wed Jun 06, 2012 9:05 pm

I've renewed my CAPX, look again - I think the problem is that is between angles doesn't work correctly when angle is wider than 180 isn't it?
B
19
S
6
G
4
Posts: 171
Reputation: 2,507

Post » Wed Jun 06, 2012 9:58 pm

Yeah it doesn't work if the angle range > 180. Looks like a bug.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Mon Dec 24, 2012 5:51 pm

The angles above 180 are negative values. So north would be -90 northeast -45 and so forth up to -180. I saw before a math example to flip that around into how it should be but I can't seem to find it. Anyone know how to flip the negative value into a positive?
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Mon Dec 24, 2012 6:08 pm

360 + negative angle = positive angle
360 - 90 = 270

And if you accumulate angle, e.g. 480, use modulo, e.g. 480%360 Mipey2012-12-24 18:08:42
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155


Return to Construct 2 General

Who is online

Users browsing this forum: shinichild and 17 guests