W
wonkasnout2
Guest
I am making a top down, turn-based strategy game and I need some help.
obj_player has four "free" variables (left ,right, up, and down). These variables are the x or y position of the furthest empty space in a given direction (sight lines I guess), and are updated whenever the player is facing a certain direction
//step
if global.move = true
{
if place_empty(leftfree,y)
{
do {leftfree = leftfree - 50}
until !place_empty(leftfree, y)
}
}
I need a way to have another variable, left_prev, be equal to what leftfree was before it last changed.
Basically I something to happen when leftfree changes.
obj_player has four "free" variables (left ,right, up, and down). These variables are the x or y position of the furthest empty space in a given direction (sight lines I guess), and are updated whenever the player is facing a certain direction
//step
if global.move = true
{
if place_empty(leftfree,y)
{
do {leftfree = leftfree - 50}
until !place_empty(leftfree, y)
}
}
I need a way to have another variable, left_prev, be equal to what leftfree was before it last changed.
Basically I something to happen when leftfree changes.