Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[GM 7] 8 Dirctional movement


ZFG

Recommended Posts

Okay, this is what I did for my game. In the draw event, instead of drawing Sonic's angle by the variable "animations_angle", change it to "tanimaions_angle".

Now, in the End Step, put this code:

if(animations_angle>=330.5 && animations_angle<=360){ tanimations_angle=0 }
if(animations_angle>=0 && animations_angle<29){ tanimations_angle=0 }

if(animations_angle>=29 && animations_angle<67.5){ tanimations_angle=45 }
if(animations_angle>=67.5 && animations_angle<112.5){ tanimations_angle=90 }
if(animations_angle>=112.5 && animations_angle<157.5){ tanimations_angle=135 }
if(animations_angle>=157.5 && animations_angle<202.5){ tanimations_angle=180 }
if(animations_angle>=202.5 && animations_angle<247.5){ tanimations_angle=225 }
if(animations_angle>=247.5 && animations_angle<292.5){ tanimations_angle=270 }
if(animations_angle>=292.5 && animations_angle<330.5){ tanimations_angle=315 }

That's just my cheap way of doing oldschool 8-direction movement. Don't forget to make "tanimations_angle" a variable in the Create event, by the way.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...