Set angle to "Opposite"

0 favourites
  • 4 posts
From the Asset Store
A whole set you need to create a gorgeous winter 2d game
  • Hey, So I rendered a 360 frame Sprite <img src="smileys/smiley36.gif" border="0" align="middle" />

    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.

    <img src="http://dl.dropbox.com/u/53738503/Change%20Angle.bmp" border="0" />

    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.

  • 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. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 ^^

  • Oho, I did it wrong the whole time ^^

    Now your Post is worth 10x !

    Loop 0-10

            Append Text: "Thx!" & newline

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)