#define scr_moving_around //This script makes an instance move around in a grid based environment //returns wether the direction has change (true) or not (false) //argument0=speed //argument1=grid size if (round(x/argument1)*argument1=x and round(y/argument1)*argument1=y) //if align to grid { speed=argument0; if (place_free(x+lengthdir_x(argument1,direction+90),y+lengthdir_y(argument1,direction+90)) and floor(random(3))=0) //left and random direction=direction+90; else if (place_free(x+lengthdir_x(argument1,direction-90),y+lengthdir_y(argument1,direction-90)) and floor(random(2))=0) //right and random direction=direction-90; else if (place_free(x+lengthdir_x(argument1,direction),y+lengthdir_y(argument1,direction))) //in front of { //no change to direction return 0; } else if (place_free(x+lengthdir_x(argument1,direction+90),y+lengthdir_y(argument1,direction+90))) //left direction=direction+90; else if (place_free(x+lengthdir_x(argument1,direction-90),y+lengthdir_y(argument1,direction-90))) //right direction=direction-90; else if (place_free(x+lengthdir_x(argument1,direction+180),y+lengthdir_y(argument1,direction+180))) //behind direction=direction+180; else speed=0; //no way to move return 1; } return 0; //made by: Martin Larsson, Martin@mydownloadworld.com