hi im making a game and im trying to figure out how to make it so the player rotates at the angle of the wall (so that both feet are touching the wall)any help would be very appreciated
wall rotation
(3 posts) (2 voices)-
Posted 5 years ago #
-
Presuming that your character is meant to be perpendicular to the wall, you could calculate the angle of the average slope of the segment with which the player is in contact then add or subtract 90 degrees as appropriate.
Let's say your character is on a segment that is inclined 30 degrees—moving up and to the right. In Flash, that would be 60 degrees because Flash uses clock-like rotation orientation for _rotation values with zero upward, positive angles to the right, and negative angles to the left. Thus, subtract 90 degrees from 60 degrees and you have -30 degrees for your character.
Brian Sexton makes games too.Posted 5 years ago # -
Posted 5 years ago #
Reply
You must log in to post.
