Jump to content
IGNORED

Background scrolling and sound


Rabbit 2600

Recommended Posts

When I try to compile it, I get a compile error on this line:

 

if collision(player0,player1) then score = score + 10 : player1x = 255 : player1y = 255 : h + 10

 

The error is because you say "h + 10" without setting anything equal to it-- I'm guessing you meant to say "h = h + 10"?

Link to comment
Share on other sites

Even after I fixed that error the compiler kept crashing until I split the following line into two separate lines:

 

Before (crashes the compiler):

  if h > 0 then AUDV0 = 8 : AUDC0 = 6 : AUDF0 = 1 : h = h - 1 : if h = 0 then AUDV0 = 0

 

After (compiles okay):

  if h > 0 then AUDV0 = 8 : AUDC0 = 6 : AUDF0 = 1 : h = h - 1
  if h = 0 then AUDV0 = 0

Link to comment
Share on other sites

This compiles for me using the version of batari Basic in the bBWin7_64bit.zip file:

Thanks for mentioning that! I keep running into compile issues where the only way I can make a program compile is to either split some logic into nested ifs (such as "if a = 1 then if b = 2 then ..." instead of "if a = 1 && b = 2 then ..."), or split a nested if into separate lines, or some other type of revision in the logic. For the record, the version of 2600basic.exe that I've been using is dated 07/28/2011 at 12:32AM. I'll try the files you've linked to. I probably never applied them because the OS on my desktop computer is 32-bit, not 64-bit.

Link to comment
Share on other sites

Aha! So the error was that I should have split

if h > 0 then AUDV0 = 8 : AUDC0 = 6 : AUDF0 = 1 : h = h - 1 : if h = 0 then AUDV0 = 0

up?

 

No. You had h + 10 instead of h = 10.

 

Do not split the line. if you use more than one noise on the same channel, splitting the line will cause the channel to be muted.

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...
  • Recently Browsing   0 members

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