Hey all,
I'm attempting to code a hookshot into my game. I'm currently getting a variable for the player's location X and the player's location y, as hookshot location x and hookshot location y. I will be using terrain ID and get location info for most of the coding, but that does not take into account of events that may be in the way. Because of this I am trying to implement a comparison of the event's location x and y and compare them.
I first tried comparing the event and hookshot's x and y variables, but it will not work properly unless the two are merged. For example, if the event's x and the hookshot's x = each other the code would not run properly, meaning there is an entire row and an entire column where the code won't run, even though I only want it for the one location.
Because of this, I would like to try to merge the two variables--simply adding them together won't solve anything because say for example you have x=1 and y=4, it would be the same as x=4 and y=1. Can anyone assist me with merging the variables? (Or maybe you've got another idea that would work?)
Here are the lines of code I am having issues with:
$gameVariables.value(11) == $gameVariables.value(9) + $gameVariables.value(10)
$gameVariables.value(12) == $gameMap.event(9).x + $gameMap.event(9).y
$gameVariables.value(11) != $gameVariables.value(12)
Thanks in advance for the help! 🙂
I'm attempting to code a hookshot into my game. I'm currently getting a variable for the player's location X and the player's location y, as hookshot location x and hookshot location y. I will be using terrain ID and get location info for most of the coding, but that does not take into account of events that may be in the way. Because of this I am trying to implement a comparison of the event's location x and y and compare them.
I first tried comparing the event and hookshot's x and y variables, but it will not work properly unless the two are merged. For example, if the event's x and the hookshot's x = each other the code would not run properly, meaning there is an entire row and an entire column where the code won't run, even though I only want it for the one location.
Because of this, I would like to try to merge the two variables--simply adding them together won't solve anything because say for example you have x=1 and y=4, it would be the same as x=4 and y=1. Can anyone assist me with merging the variables? (Or maybe you've got another idea that would work?)
Here are the lines of code I am having issues with:
$gameVariables.value(11) == $gameVariables.value(9) + $gameVariables.value(10)
$gameVariables.value(12) == $gameMap.event(9).x + $gameMap.event(9).y
$gameVariables.value(11) != $gameVariables.value(12)
Thanks in advance for the help! 🙂