Robsome Posted June 3, 2017 Share Posted June 3, 2017 I am trying to make a game for the 2600 and I am also learning BASIC. Every time I try to compile this, it says I have a syntax error on the first line. If you want an idea of how much programming I know, I've taken 2 programming programs and I've worked with C++ and a little C#. But I only used C# for making a Unity game. COLUPF = 128 COLUBK=02 scorecolor = 14 player0: %00000000 %00110110 %00100100 %10111100 %01111111 %00000110 %00000110 %00000000 end player0x =50 player0y =50 player1: %01111100 %00111100 %00001100 %00001100 %00001100 %00001100 %00001100 %00001100 %01111100 %11101100 %00010010 %00100011 %00111011 %00101111 %00011110 %00001100 end player1x=100 player1y=35 dim cute = 0 mainloop playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end if collision(player0, player1) then cute = 1 if joy0right then player0x=player0x+1 if joy0right && cute == 0 then player0: %00000000 %00110110 %00100100 %10111100 %01111111 %00000110 %00000110 %00000000 end if joy0right && cute == 1 then player0: %00000000 %01101100 %00100100 %00111101 %11111110 %01100000 %01100000 %00000000 end if joy0left then player0x=player0x-1 if joy0left then player0: %00000000 %01101100 %00100100 %00111101 %11111110 %01100000 %01100000 %00000000 end if joy0up then player0y=player0y-1 if joy0down then player0y=player0y+1 drawscreen goto mainloop Quote Link to comment Share on other sites More sharing options...
Robsome Posted June 3, 2017 Author Share Posted June 3, 2017 (edited) I'm sorry I meant line 2 Edited June 3, 2017 by Robsome Quote Link to comment Share on other sites More sharing options...
Robsome Posted June 3, 2017 Author Share Posted June 3, 2017 I edited the loop. It now says a syntax error on line 91. mainloop playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end if collision(player0, player1) then cute = 1 if joy0right then player0x=player0x+1 if joy0right && cute == 0 then player0: %00000000 %00110110 %00100100 %10111100 %01111111 %00000110 %00000110 %00000000 end if joy0right && cute == 1 then player0: %00000000 %01101100 %00100100 %00111101 %11111110 %01100000 %01100000 %00000000 end if joy0left then player0x=player0x-1 if joy0left then player0: %00000000 %01101100 %00100100 %00111101 %11111110 %01100000 %01100000 %00000000 end if joy0up then player0y=player0y-1 if joy0down then player0y=player0y+1 drawscreen goto mainloop Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted June 3, 2017 Share Posted June 3, 2017 If you attach your file, it will be easier for us to deal with it. Quote Link to comment Share on other sites More sharing options...
Robsome Posted June 3, 2017 Author Share Posted June 3, 2017 Here's the most current version. default.bas Quote Link to comment Share on other sites More sharing options...
+Karl G Posted June 3, 2017 Share Posted June 3, 2017 Everything except for labels and the end statement needs to be indented by at least one space: http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#labels This includes the player0 and player1 definitions - only the end statement should not be indented. COLUBK=02 If you are intending this to be a hex value, it needs to be preceeded by a $ character. if joy0right && cute==1 then player0: The comparison operator is the same as the assignment operator in bB as well as most BASIC dialects - a single equal sign. I'm not near a computer to try to compile your code with these changes, but this is what I was able to find at first glance. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted June 3, 2017 Share Posted June 3, 2017 Yeah, what he said. You didn't indent and you had a few other problems: robsome_2017y_06m_03d_0947t.bas robsome_2017y_06m_03d_0947t.bin Here are some sections on the bB page that you'll want to look at: Indent! dim Boolean Operators Quote Link to comment Share on other sites More sharing options...
Robsome Posted June 5, 2017 Author Share Posted June 5, 2017 Thank you! your advise worked wonderfully. But this file compiles but I get errors running it through emulators. default.bas.bin default.bas Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted June 5, 2017 Share Posted June 5, 2017 You have "sco4e=score+1" Quote Link to comment Share on other sites More sharing options...
Robsome Posted June 6, 2017 Author Share Posted June 6, 2017 Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.