Hello,
I'm making a short game in the style of top-down rpgs like Earthbound, etc., and I'm trying to set it up so that pressing the 'Z' key will interact with nearby people and objects. The way I'm doing this is by an on_key_press script that runs ProcessClick(player.x, player.y, eModeInteract) when Z is pressed and by having the NPCs be just part of the backround screen with a hotspot covering an area around them.
I think the problem I'm having has to do with the way the player x and y coordinates are calculated: my approach works okay for some characters at the top of the screen, when approaching them from the south, but for others near the bottom it doesn't work at all when the player is right next to/above them and then suddenly works when the character is a fair difference above them and should technically be outside the hotspot zone.
Basically I was wondering if anyone had any thoughts as to what the problem or solution here might be, or even alternate methods of pulling off the control scheme described above. Thanks!
I'm making a short game in the style of top-down rpgs like Earthbound, etc., and I'm trying to set it up so that pressing the 'Z' key will interact with nearby people and objects. The way I'm doing this is by an on_key_press script that runs ProcessClick(player.x, player.y, eModeInteract) when Z is pressed and by having the NPCs be just part of the backround screen with a hotspot covering an area around them.
I think the problem I'm having has to do with the way the player x and y coordinates are calculated: my approach works okay for some characters at the top of the screen, when approaching them from the south, but for others near the bottom it doesn't work at all when the player is right next to/above them and then suddenly works when the character is a fair difference above them and should technically be outside the hotspot zone.
Basically I was wondering if anyone had any thoughts as to what the problem or solution here might be, or even alternate methods of pulling off the control scheme described above. Thanks!