#define scr_mg_create //scr_mg_create //your sprites may have any name, just as long as // each sprite for the character is named the same, with a number // on the end as follows: // 0 = facing right | 1 = facing up | 2 = left | 3 = down //these scripts were created by IsmAvatar, cmagicj@nni.com /*change these values at will*/ /* \/ \/ \/ \/ \/ \/ \/ \/ */ sp = 4 /*the speed the character moves at*/ gr = 32 /*the grid size*/ dir = 2 /*the direction you start out facing*/ /* /\ /\ /\ /\ /\ /\ /\ /\ */ /*change these values at will*/ image_single = 0 sn = ( string_copy( sprite_get_name(sprite_index), 1, string_length( sprite_get_name(sprite_index) )-1 ) ) move_snap(gr,gr) olddir = dir direction = dir #define scr_mg_step /*comment scr_mg_step execute in step event argument0 is the key for up argument1 is the key for left argument2 is the key for down argument3 is the key for right leave as all 0's for default (directional keys) comment*/ if argument0 = 0 && argument1 = 0 && argument2 = 0 && argument3 = 0 { argument0 = vk_right argument1 = vk_up argument2 = vk_left argument3 = vk_down } for (m = 0; m < 4; m += 1) { if keyboard_key = argument[m] { dir = m if direction != dir*90 { olddir = direction/90 } } } if place_snapped(gr,gr) { if keyboard_check(argument[dir]) { execute_string("sprite_index = " +sn +string(dir)) image_single=-1 direction = dir*90 speed = sp alarm[0] = (gr/sp) } else if keyboard_check(argument[olddir]) { dir = olddir execute_string("sprite_index = " +sn +string(dir)) image_single=-1 direction = dir*90 speed = sp alarm[0] = (gr/sp) } } #define scr_mg_alarm0 speed = 0 image_single = 0 move_snap(gr,gr)