Set angle to "Opposite"

Get help using Construct 2

Post » Mon Sep 17, 2012 10:01 pm

Hey, So I rendered a 360 frame Sprite

And I would like to create a effect like when to walk an object.
So when you walk past the object it will "turn away" from you.

Right now it does the Opposite of that.
But I can't figure out how to make it go into the opposite direction.




My guess is that it could have to do with <Sin> and <Cos>

But I am not sure, and have no idea how to work it out right now, thus, forum topic.
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Mon Sep 17, 2012 10:07 pm

Now I am not entirely sure, but could you not just subtract 180 if the angle is greater than 180 and add it if it is less than it? That would flip it and the "If greater than else" system will stop it from crashing due to having an angle greater than 360/less than zero.

Or have I got the wrong idea about what's going on. I often do that.
B
29
S
4
Posts: 42
Reputation: 2,391

Post » Mon Sep 17, 2012 10:09 pm

Nah that sounds good, I tried that a bit, but I couldn't get the angle right so I felt like asking for a more "mathy" answer before I try it with that again :p

Thx ^^
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Mon Sep 17, 2012 10:41 pm

Oho, I did it wrong the whole time ^^

Now your Post is worth 10x !

Loop 0-10
        Append Text: "Thx!" & newline
B
40
S
11
G
4
Posts: 665
Reputation: 8,403


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests