Jump to content
IGNORED

Player moves down and right, but not up and down


DarkCart
 Share

Recommended Posts

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

Link to comment
Share on other sites

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 ifthen on a single line.
  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...