Hi guys,
I am trying to make a rock pullable if player can move backward direction
as you see at first condition i am determining the direction of backwards and at second i am trying to make a switch on if it is passable after this i will move the player and boulder backwards if the switch is on.
in first if clause it's working like a charm but in second if clause i am having a "Syntax Error {" error.
What is the difference between these two? and why i am having this error, as i think these two clause are identical
Thanks for your help in advance.
I am trying to make a rock pullable if player can move backward direction
Code:
if ($gamePlayer.direction() == 2 ) {
$gameVariables.setValue(6, 8)
} else if ($gamePlayer.direction() == 4 ) {
$gameVariables.setValue(6, 6)
} else if ($gamePlayer.direction() == 6 ) {
$gameVariables.setValue(6, 4)
} else {
$gameVariables.setValue(6, 2)
}
dx = ($gamePlayer.x)
dy = ($gamePlayer.y)
db = ($gameVariables.value(6))
if ($game_player.passable?(dx, dy, db) ) {
$gameSwitches.setValue(11, true)
} else {
$gameSwitches.setValue(11, false)
}
as you see at first condition i am determining the direction of backwards and at second i am trying to make a switch on if it is passable after this i will move the player and boulder backwards if the switch is on.
in first if clause it's working like a charm but in second if clause i am having a "Syntax Error {" error.
What is the difference between these two? and why i am having this error, as i think these two clause are identical
Thanks for your help in advance.