#define scr_create //this script here initializes and prepares the game. //refer to it in the character's create event //no arguments required here //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: // 1 = facing up | 2 = left | 3 = down | 4 = right //please read the scr_step script aswell //these scripts were created by IsmAvatar, cmagicj@nni.com /*change these values at will*/ /* \/ \/ \/ \/ \/ \/ \/ \/ */ image_speed=.1 /*the speed to cycle through subimages make a fraction for slower cycling*/ sp = 4 /*the speed the character moves at*/ dir=2 /*the direction the character first faces*/ /* /\ /\ /\ /\ /\ /\ /\ /\ */ /*change these values at will*/ image_single=0 go=0 sn = string_copy( sprite_get_name(sprite_index), 1, string_length( sprite_get_name(sprite_index) )-1 ) for (i = 0; i < 260; i += 1) press[i] = 0 #define scr_step /*comment scr_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_up argument1 = vk_left argument2 = vk_down argument3 = vk_right } for (i = 1; i < 5; i += 1) { key = argument[i-1] if keyboard_check(key) { if press[key] = 0 { { if go=0 { image_single=-1 dir=i execute_string("sprite_index = " +sn +string(dir)) direction=i*90 speed=sp go=1 } nd=i } press[key] = 1 } } else { if press[key] = 1 { { if nd=i { nd=0 } if dir=i { image_single=0 go=0 dir=0 if (nd<>0) { speed=sp direction=nd*90 go=1 dir=nd execute_string("sprite_index = " +sn +string(dir)) image_single=-1 } else { speed=0 } } } press[key] = 0 } } }