P
Parker
Guest
When I try to run this script of placing tiles around the player in the step event it doesn't do it only once. Here is my code, I have no idea what is happening. Thanks for any of your help.
Create Event:
Step Event:
Script:
Create Event:
Code:
do_once = true;
Code:
if (global.turn == "player") {
if (do_once == true) {
scr_avaliable_movements();
do_once = false;
}
}
Code:
up = place_empty(x, y-GRID_SIZE);
right = place_empty(x+GRID_SIZE, y);
down = place_empty(x, y+GRID_SIZE);
left = place_empty(x-GRID_SIZE, y);
if (right) instance_create(x+GRID_SIZE, y, obj_pawn_dir);
if (down) instance_create(x, y+GRID_SIZE, obj_pawn_dir);
if (left) instance_create(x-GRID_SIZE, y, obj_pawn_dir);
if (up) instance_create(x, y-GRID_SIZE, obj_pawn_dir);