Can anyone help me

Code: Select all
if (place_free(x+4,y)) // check if the position 4 pixels to the right of the player is collision-free
{
direction = 315+random(90) // set the direction to somewhere between 315 (down-right) and 405 (up-right)
exit // abort execution of this piece of code
}
if (place_free(x,y+4)) // check if the position 4 pixels below the player is collision-free
{
direction = 225+random(90) // set the direction to somewhere between 225 (down-left) and 315 (down-right)
exit // abort execution of this piece of code
}
if (place_free(x-4,y)) // check if the position 4 pixels to the left of the player is collision-free
{
direction = 135+random(90) // set the direction to somewhere between 135 (up-left) and 225 (down-left)
exit // abort execution of this piece of code
}
if (place_free(x,y-4)) // check if the position 4 pixels above the player is collision-free
{
direction = 45+random(90) // set the direction to somewhere between 45 (up-right) and 135 (up-left)
exit // abort execution of this piece of code
}