Dimenticare icon

4-direction Player Movement

Dimenticare | PRO | 04/06/15 02:32:22 PM UTC | 0 ⭐ | 727 👁️ | Never ⏰ | []
Game Maker |

0 B

|

None

|

0 👍

/

0 👎

// Not the most elegant way of making your character turn around, but if your character
// is just one unanimated sprite it'll do the job.
 
if (free==true){    // locks the player when you talk to someone/something
    switch(keyboard_key){
    case ord('A'):
        image_angle=180;
        x-=Speed;
        break;
    case ord('D'):
        image_angle=0;
        x+=Speed;
        break;
    case ord('S'):
        image_angle=270;
        y+=Speed;
        break;
    case ord('W'):
        image_angle=90;
        y-=Speed;
        break;
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎