Jump to content
IGNORED

Syntax Error


ydcl

Recommended Posts

Hi all,

I'm currently learning BatariB and have been trying to do a very very simple game. I run into this error when putting player and enemy position: I managed to get the background correct and it runs.

 

2600 Basic compilation completed.
Compilation completed at 3/31/2014 7:24:45 PM
view output file:///C:/Users/YLS/Desktop/YANLUZSOFTWARE/Yan's Revenge/bin
[3/31/2014 7:24:54 PM] saving C:\Users\YLS\Desktop\YANLUZSOFTWARE\Yan's Revenge\default.bas succeeded.
Compile started at 3/31/2014 7:24:55 PM
Compiling C:\Users\YLS\Desktop\YANLUZSOFTWARE\Yan's Revenge\default.bas
2600 Basic compilation failed!
LINE --> missile0y = missile0y - 2 : goto draw_loop

 

I've attached the default.bas file if anyone wants to look at it.

 

Also would love to know how to do a title screen as I have not seen a youtube video on it yet.

 

Thanks,

Yan

default.bas

Link to comment
Share on other sites

Hi all,

I'm currently learning BatariB and have been trying to do a very very simple game. I run into this error when putting player and enemy position: I managed to get the background correct and it runs.

 

2600 Basic compilation completed.

Compilation completed at 3/31/2014 7:24:45 PM

view output file:///C:/Users/YLS/Desktop/YANLUZSOFTWARE/Yan's Revenge/bin

[3/31/2014 7:24:54 PM] saving C:\Users\YLS\Desktop\YANLUZSOFTWARE\Yan's Revenge\default.bas succeeded.

Compile started at 3/31/2014 7:24:55 PM

Compiling C:\Users\YLS\Desktop\YANLUZSOFTWARE\Yan's Revenge\default.bas

2600 Basic compilation failed!

LINE --> missile0y = missile0y - 2 : goto draw_loop

 

I've attached the default.bas file if anyone wants to look at it.

 

Also would love to know how to do a title screen as I have not seen a youtube video on it yet.

 

Thanks,

Yan

 

 

That line is not indented

lines 24..26 are not indented either

 

everything (I think) except labels and "end" needs indenting.

  • Like 1
Link to comment
Share on other sites

Indenting means pressing the space bar once?

Yes, once or more.

 

Also labels and "end" need to not be indented

that is they need to be un-indented

 

Actually, I suppose technically I should say the

first column should be a space while labels and "end"

need to start in the first column.

 

(it could be argued that if everything has a space

and starts in the second column, then technically none

of it is indented or if labels all start in the second column

and everything else in the third column the labels aren't

indented. But it wouldn't compile)

Edited by bogax
Link to comment
Share on other sites

I've been trying to figure out what's wrong with the indentation. I'll read the link tomorrow when I start again. It was working fine until this line gave me problems.

missile0y=missile0y-2: goto draw_loop

that is were the system is telling me the error is.

Link to comment
Share on other sites

This compiles

lines 24..26 have spaces in the names that don't belong.
(fixed here)

rem Generated 3/31/2014 4:07:41 PM by Visual bB Version 1.0.0.558
rem **********************************
rem *<filename> *
rem *<description> *
rem *<author> *
rem *<contact info> *
rem *<license> *
rem **********************************


playfield:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
................................
................................
................................
................................
................................
................................
................................
................................
................................
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end
player0x=50:player0y=50
player1x=20:player1y=20
missile0height=4:missile0y=255
NUSIZ0=16

sprites

player0:
%01000100
%00101000
%00010000
%00010000
%01111100
%00010000
%00111000
%00111000
end
player1:
%00100100
%00100100
%00100100
%00100100
%11111111
%00011000
%00111100
%00011000
end

if missile0y>240 then goto skip
missile0y=missile0y-2:goto draw_loop
skip
if joy0fire then missile0y=player0y-2:missile0x=player0x+4

COLUBK = $40
COLUPF = $1E
draw_loop
drawscreen
goto sprites

edit forgot the forum likes to eat spaces

 

 

yan.bas






Edited by bogax
  • Like 2
Link to comment
Share on other sites

Can someone point me to the exact location for the collision section between missile/enemy and missile player of randomterrain.com? I can move and shoot but I seem to be messing up the collision.

This is the code I have for the collision. the program compiles fine as long as I don't type this in.

 

if collision (missile0,player1)then score = score+1 : player1x = rand / 2 : player1y = 0 : missile0y = 255

if collision (player0,player1)then score = score-1 : player1x = rand / 2 : player1y = 0 : missile0y = 255

Link to comment
Share on other sites

It's a good idea to copy and paste any code that you want to modify so it will be harder to introduce errors:

 

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

 

You're not supposed to have a space after collision. Instead of "collision (" you should have "collision(".

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

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