Jump to content
IGNORED

Game won't compile, can't figure out issue II: the electric boogaling


8-bit_d-boy

Recommended Posts

Same issue as before, syntax error, can't figure out what's wrong, losing hair.

 

So this issue started when I added my win state code which goes as follows:

	rem red win state
	;goto _skip_win_state
	if scoring < 62 then goto _skip_win_state
		AUDV0 = 0
		AUDV1 = 0
		if scoring < 123 && scoring + 1 <= 122 then scoring = scoring + 1 : goto _skip_win_state
			scoring = 62
			if pfc + 2 > 78 then pfc = 64 : goto _skip_win_state
				pfcolors:
				pfc
 				end
				pfc = pfc + 2
	
		if scoring > 122 && scoring + 1 <= 182 then scoring = scoring + 1 : goto _skip_win_state
			scoring = 123
			if pfc + 2 > 158 then pfc = 144 : goto _skip_win_state
				pfcolors:
				pfc
 				end
				pfc = pfc + 2

Please ask any questions you'd need.

default.bas

Link to comment
Share on other sites

Edit: As noted by RT below, the intermediate calculations were not part of the problem - it was only the indentation of the end statements.

 

You need to do intermediate calculations separately and not as part of your if statements. Also, the "end" statement always needs to not be indented. Here's the relevant section of code. I commented out your if statements, and put my broken-up version of the same in the lines below. It at least compiles for me with these changes.

	if scoring < 62 then goto _skip_win_state
		AUDV0 = 0
		AUDV1 = 0
;		if scoring < 123 && scoring + 1 <= 122 then scoring = scoring + 1 : goto _skip_win_state
                temp1 = scoring + 1
		if scoring < 123 && temp1 <= 122 then scoring = scoring + 1 : goto _skip_win_state
			scoring = 62
;			if pfc + 2 > 78 then pfc = 64 : goto _skip_win_state
                        temp2 = pfc + 2
			if temp2 > 78 then pfc = 64 : goto _skip_win_state
				pfcolors:
				pfc
end
				pfc = pfc + 2
	
;		if scoring > 122 && scoring + 1 <= 182 then scoring = scoring + 1 : goto _skip_win_state
        temp1 = scoring + 1
		if scoring > 122 && temp1 <= 182 then scoring = scoring + 1 : goto _skip_win_state
			scoring = 123
			if pfc + 2 > 158 then pfc = 144 : goto _skip_win_state
				pfcolors:
				pfc
end
				pfc = pfc + 2
Edited by kdgarris
Link to comment
Share on other sites

Your program will compile if you just get rid of the indentations before end.

 

Make sure that you have the latest version of batari Basic and bblint and you will get error messages like these:


warning(299):    The "end" command appears to be indented.
warning(297):    missing matching end to "   pfcolors:"
warning():    Found 8 commands that use end,  and 7 "end" commands.
Link to comment
Share on other sites

Hey thanks for the help, guys! It works now thanks to de-indenting the end statements, and it seems to work fine with intermediate calculations in the if-statements, but I'm wondering if that wouldn't work on real atari hardware.

 

But now how do I get the Playfield to chage color? Does pfcolors not work with variables? The ball is black for me

 

Also the Install batch file says I need setX.

Edited by 8-bit_d-boy
Link to comment
Share on other sites

Hey thanks for the help, guys! It works now thanks to de-indenting the end statements, and it seems to work fine with intermediate calculations in the if-statements, but I'm wondering if that wouldn't work on real atari hardware.

At one time, batari Basic wouldn't let us do any kind of math in if…then statements. That was changed over the years, but you still have to keep an eye on it.

 

 

 

But now how do I get the Playfield to change color? Does pfcolors not work with variables? The ball is black for me

I don't see any variables used here:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#kernop_pfcolors

 

Be sure to check out the warning at the bottom of that section.

 

 

 

Also the Install batch file says I need setX.

RevEng said "install_win.bat requires SETX, which comes with Windows XP SP2 and later versions of Windows. If you don't have SETX on the system, the batch file will let you know and explain the situation."

Link to comment
Share on other sites

Thanks for the help

 

I don't see any variables used here:

randomterrain.com/atari-2600-memories-batari-basic-commands.html#kernop_pfcolors

 

Be sure to check out the warning at the bottom of that section.

Tried it without pfheights, same issue, oh well. I wanted it to change the playfield to the winner's color and cycle through the lumas, but guess not.

 

 

 

RevEng said "install_win.bat requires SETX, which comes with Windows XP SP2 and later versions of Windows. If you don't have SETX on the system, the batch file will let you know and explain the situation."

 

I'm aware of this, but I'm not sure where to get it.

 

Thanks again.

Link to comment
Share on other sites

So I decided to change the background color to match the winner and have it cycle thru that color's luminances by one color every second similar to combat, but it seems to just stick to the one luminance value and I can't figure out why.

Any pointers would be helpful.

	rem -------------------------

	rem        WIN STATE

	rem -------------------------

	;goto _skip_win_state
	if scoring < 62 then goto _skip_win_state
		AUDV0 = 0
		AUDV1 = 0
		COLUBK = pfc
		scoring = scoring + 1
		pfc = pfc + 2
		if missile0x > 110 then gosub red_win		
		if missile1x > 110 then gosub blu_win

_skip_win_state
red_win
	if scoring > 122 then scoring = 62
	if pfc > 78 then pfc = 64
	return

blu_win
	if scoring > 182 then scoring = 123
	if pfc > 158 then pfc = 144
	return

airhockey.bas

Link to comment
Share on other sites

  • 2 weeks later...

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...