Jump to content



0

Batari coding - Syntax error?


1 reply to this topic

#1 Zambaku OFFLINE  

Zambaku

    Space Invader

  • 18 posts

Posted Mon Nov 1, 2010 1:41 PM

I'm attempting to write my first extremely basic game for the Atari 2600 using Batari. I'm getting a compiling error that says that my line containing: player0x = 50 : player0y = 50
Has a syntax error. Yet I do not see it. I'm following a basic tutorial on youtube and I've done just like the person shows and he dosn't get any error.


My code so far:
 rem Generated 2010-11-01 20:16:27 by Visual bB Version 1.0.0.554
 rem **********************************
 rem *<filename>                      *
 rem *<description>                   *
 rem *<author>                        *
 rem *<contact info>                  *
 rem *<license>                       *
 rem **********************************
 playfield:
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end

 COLUBK = $20
 COLUPF = 212
player0x=50:player0y=50
player1x=20:player1y=20
 player0:
 100100
 100100
 %01011010
 %01011010
 111100
 000000
 011000
 011000
end

 player1:
 100100
 100100
 011000
 011000
 %01111110
 000000
 011000
 011000
end



draw_loop
 drawscreen
 goto draw_loop


#2 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,544 posts
  • Location:Georgia, USA

Posted Mon Nov 1, 2010 5:55 PM

You need to indent the two lines that set the player0x, player0y, player1x, and player1y coordinates. If you don't indent them, the batari Basic compiler tries to treat the first words on those lines as if they were line labels, which results in the syntax error.

Michael







1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users