#define scr_mg_create // Change these to your liking sp = 2 //speed when moving gr = 16 //grid size dir = 1 //initial direction (0=right,1=up,2=left,3=down) sid = 4 //subimages per direction asp = 0.25 //animation speed pkmn = false //enables pokemon-like movement, where you can "tap" a key //to face that direction without moving, or hold to move //keys for the directions (0=right,1=up,2=left,3=down) key[0] = vk_right key[1] = vk_up key[2] = vk_left key[3] = vk_down //No changes beyond this point, unless you know what you're doing image_speed = 0 sub = 0 move_snap(gr,gr) direction = dir image_index = dir * sid #define scr_mg_alarm0 if !keyboard_check(key[dir]) sub = 0 speed = 0 move_snap(gr,gr) #define scr_mg_step if place_snapped(gr,gr) { if keyboard_check(key[dir]) { direction = dir*90 speed = sp alarm[0] = gr / sp } else { for (m = 0; m < 4; m += 1) if (keyboard_key = key[m]) dir = m if !pkmn && keyboard_check(key[dir]) { direction = dir*90 speed = sp alarm[0] = gr / sp } //non-pkmn movement } //changing direction } //snapped to grid if (speed != 0) { sub += asp if (sub = 4) sub = 0 } image_index = dir * sid + sub