DarkCart Posted June 10, 2016 Share Posted June 10, 2016 I've run into a very strange problem. In my code, the player can move down and right just fine, but cannot move up and left. I have no idea as to what's happening, and here's my code. if joy0up && player0y > 32 then player0y = player0y - 23 else player0y = 55 rem the player 0y > 32 is bounds detection if joy0down && player0y < 78 then player0y = player0y + 23 else player0y = 55 if joy0left && player0x > 55 then player0x = player0x - 23 else player0x = 78 if joy0right && player0x < 101 then player0x = player0x + 23 else player0x = 78 The only sort of pattern I see is that the player's not moving when their x or y is subtracted. Could you shed some light on the situation? Thanks, DarkCart Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted June 10, 2016 Share Posted June 10, 2016 You have a REM on a line after code with no colon before it. That could be messing something up. Also, else may not work properly with &&: randomterrain.com/atari-2600-memories-batari-basic-commands.html#else The else keyword might not work correctly in a statement containing &&. The else keyword may also not work as expected when there is more than one if…then on a single line. 1 Quote Link to comment Share on other sites More sharing options...
DarkCart Posted June 10, 2016 Author Share Posted June 10, 2016 You have a REM on a line after code with no colon before it. That could be messing something up. Also, else may not work properly with &&: randomterrain.com/atari-2600-memories-batari-basic-commands.html#else Thank you, this fixed it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.