[SOLVED] Weird angle() behavior(that wasn't weird)

For questions about using Classic.

Post » Sat Aug 20, 2011 5:29 pm

So here's one for the experienced among us:

DOWNLOAD

It runs with fixed 1 fps on purpose. Run it and press 'space', until the text in the lower right changes to "Press 'space' to stop". (Be patient because of the low framerate)

You will now see that the angle of the circle of instances swaps 180 per frame. But there is no code telling it to.

It seems, that angle() reports two different angles on every other frame. Can you confirm this?

*Fixed URL to be a nice link^^ <3 Soltulamide2011-08-20 19:13:02
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Sat Aug 20, 2011 6:55 pm

It's working as expected, switch the order of the parameters of angle() and it won't flip every frame.
ex:
angle(400, 300, .X, .Y)
B
85
S
27
G
85
Posts: 5,070
Reputation: 57,874

Post » Sat Aug 20, 2011 7:02 pm

Thank you very much ROJO! Works now.

Now there's one thing, I don't understand. Shouldn't the angle keep the same (reversed or right), if it is calling angle() with the same order on every frame?
I mean, the angle from center to x/y might be 10, then angle from x/y to center would be 190. And that should be true for every frame, no?

EDIT: So it should just swap the angles once the first time it is called wrong.tulamide2011-08-20 19:03:54
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Sat Aug 20, 2011 7:11 pm

Yes, but with the reversed angle the sprites are moved to the opposite side each frame.
B
85
S
27
G
85
Posts: 5,070
Reputation: 57,874

Post » Sat Aug 20, 2011 7:16 pm

Thank you ROJO.

That was one of the issues, we call 'den wald vor lauter bumen nicht sehen' in germany. I believe it is translated to 'seeing the wood for the trees'...

/me feels dumb right now^^
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests