NIKON #1 Posted February 2, 2015 I am soo noob to this ... how do you confine the Player object to the grid? Quote Share this post Link to post Share on other sites
+RevEng #2 Posted February 4, 2015 There are 2 steps... 1. start the player off on the grid 2. only allow joystick moves that keep him on the grid How you tackle step 2 is a bit dependent on the game. In Salvo, I do step 2 something like this... temp1=playerx&15 temp2=playery&31 if temp1 then goto skipvertical if joy0down && playery<160 then playerdir=0:goto joydone if joy0up && playery>32 then playerdir=1:goto joydone skipvertical if temp2 then goto skiphorizontal if joy0left && playerx>16 then playerdir=2:goto joydone if joy0right && playerx<96 then playerdir=3:goto joydone skiphorizontal joydone In your case the grid isn't always a grid, so this probably isn't enough on it's own. You also need to peek at the character underneath the player and make sure it's not a blank space character. There's an example of this in the "ramcharmap" sample - the character check there is done to make sure there's ground under the player's feet, but it's conceptually the same thing. Quote Share this post Link to post Share on other sites
NIKON #3 Posted February 4, 2015 There are 2 steps... 1. start the player off on the grid 2. only allow joystick moves that keep him on the grid How you tackle step 2 is a bit dependent on the game. In Salvo, I do step 2 something like this... temp1=playerx&15 temp2=playery&31 if temp1 then goto skipvertical if joy0down && playery<160 then playerdir=0:goto joydone if joy0up && playery>32 then playerdir=1:goto joydone skipvertical if temp2 then goto skiphorizontal if joy0left && playerx>16 then playerdir=2:goto joydone if joy0right && playerx<96 then playerdir=3:goto joydone skiphorizontal joydone In your case the grid isn't always a grid, so this probably isn't enough on it's own. You also need to peek at the character underneath the player and make sure it's not a blank space character. There's an example of this in the "ramcharmap" sample - the character check there is done to make sure there's ground under the player's feet, but it's conceptually the same thing. Thank you .. this gives me some insight as to go about it. Quote Share this post Link to post Share on other sites