Jump to content



0

Syntax error?


25 replies to this topic

#1 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 3:47 PM

I keep getting syntax errors in this code. I have no idea why. I marked the places with an error with an [error] sign.
rem Generated 7/24/2011 2:17:33 PM by Visual bB Version 1.0.0.554
rem **********************************
rem *<filename> *
rem *<description> *
rem *<author> *
rem *<contact info> *
rem *<license> *
rem **********************************


playfield:
XXXXXXX.XXXXXX.XXXXXXXX.........
X.....X.XXXXXX.X......X.........
X.XXX............X.XX.X.........
X...X.X.X.XXXX.X.X....X.........
X.X...X...X..X.X...XX.X.........
X.XXX.XXX.X....XXX.XX.X.........
X.X...X...X..X.X...XX.X.........
X...X.X.X.XXXX.X.X....X.........
X.XXX............X.XX.X.........
X.....X.XXXXXX.X......X.........
XXXXXXX.XXXXXX.XXXXXXXX.........
end

COLUBK=$00
COLUPF=$58
player0x=50:player0y=50
player1x=20:player1y=20[error]
player0:
%00000010
%01111101
%11110110
%10111010
%11101110
%11101110
%01000100
%00000000
end

player1:
%11111110
%01110111
%11100011
%01101011
%01111111
%11110111
%01100011
%11101010
end

draw_loop
drawscreen
goto draw_loop
[error]

Edit: BAS file added

Attached Files


Edited by Jr. Pac, Sun Jul 24, 2011 4:07 PM.


#2 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Jul 24, 2011 3:59 PM

This might be your problem:

http://www.randomter...nds.html#indent

#3 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 4:03 PM

Nope. Not that.

#4 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Jul 24, 2011 4:05 PM

Attach your .bas file so we're seeing exactly what you're seeing.

Edited by Random Terrain, Sun Jul 24, 2011 4:09 PM.


#5 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 4:07 PM

View PostRandom Terrain, on Sun Jul 24, 2011 4:05 PM, said:

Attach your .bin file so we're seeing exactly what you're seeing.
Is .bas ok?

#6 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Jul 24, 2011 4:08 PM

View PostJr. Pac, on Sun Jul 24, 2011 4:07 PM, said:

View PostRandom Terrain, on Sun Jul 24, 2011 4:05 PM, said:

Attach your .bin file so we're seeing exactly what you're seeing.
Is .bas ok?
That's what I meant. I typed the wrong thing. :dunce:

#7 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 4:09 PM

View PostRandom Terrain, on Sun Jul 24, 2011 4:08 PM, said:

View PostJr. Pac, on Sun Jul 24, 2011 4:07 PM, said:

View PostRandom Terrain, on Sun Jul 24, 2011 4:05 PM, said:

Attach your .bin file so we're seeing exactly what you're seeing.
Is .bas ok?
That's what I meant. I typed the wrong thing. :dunce:
It's ok. ;) I do it all the clock.

#8 jwierer OFFLINE  

jwierer

    Dragonstomper

  • 746 posts
  • Location:Seattle,WA

Posted Sun Jul 24, 2011 4:28 PM

View PostJr. Pac, on Sun Jul 24, 2011 4:03 PM, said:

Nope. Not that.
Yep definitely that. None of these were indented

 COLUBK=$00
 COLUPF=$58
 player0x=50:player0y=50
 player1x=20:player1y=20

-Jeff

#9 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 4:29 PM

View Postjwierer, on Sun Jul 24, 2011 4:28 PM, said:

View PostJr. Pac, on Sun Jul 24, 2011 4:03 PM, said:

Nope. Not that.
Yep definitely that. None of these were indented

 COLUBK=$00
 COLUPF=$58
 player0x=50:player0y=50
 player1x=20:player1y=20

-Jeff
I accidentally erased the indents foor the COLUBK and COLUPF. Is that all that needs to be indented?

#10 jwierer OFFLINE  

jwierer

    Dragonstomper

  • 746 posts
  • Location:Seattle,WA

Posted Sun Jul 24, 2011 4:45 PM

View PostJr. Pac, on Sun Jul 24, 2011 4:29 PM, said:

View Postjwierer, on Sun Jul 24, 2011 4:28 PM, said:

View PostJr. Pac, on Sun Jul 24, 2011 4:03 PM, said:

Nope. Not that.
Yep definitely that. None of these were indented

 COLUBK=$00
 COLUPF=$58
 player0x=50:player0y=50
 player1x=20:player1y=20

-Jeff
I accidentally erased the indents foor the COLUBK and COLUPF. Is that all that needs to be indented?
Your player statements (as above) were not indented. It compiled after that.

-Jeff

#11 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Jul 24, 2011 4:47 PM

I had to reset my computer and now I'm finally back (it takes forever). As mentioned above, all 4 lines were not indented. This works:

Attached File  jr_pac_2011y_07m_24d_1827t.bas   828bytes   16 downloads

#12 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 4:48 PM

Thanks so much. It's a secret game I'm making... Here's a few hints. Wrong way, Arcade, Pink

#13 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 5:07 PM

There's another syntax error now. In the title of the code. Here's the new BAS:

Attached Files



#14 jwierer OFFLINE  

jwierer

    Dragonstomper

  • 746 posts
  • Location:Seattle,WA

Posted Sun Jul 24, 2011 5:37 PM

View PostJr. Pac, on Sun Jul 24, 2011 5:07 PM, said:

There's another syntax error now. In the title of the code. Here's the new BAS:
Looks like the same code with the same error.

#15 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 5:41 PM

Ugh! It didn't save the code!

#16 jrok OFFLINE  

jrok

    Stargunner

  • 1,108 posts

Posted Sun Jul 24, 2011 5:41 PM

View PostJr. Pac, on Sun Jul 24, 2011 5:07 PM, said:

There's another syntax error now. In the title of the code. Here's the new BAS:

You need to indent this stuff:

COLUBK=$00
COLUPF=$58
player0x=50:player0y=50
player1x=20:player1y=20


#17 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 5:48 PM

Now the colors on the sprites will only stay colored (not black) for one frame!

Attached Files



#18 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Jul 24, 2011 6:23 PM

View PostJr. Pac, on Sun Jul 24, 2011 5:48 PM, said:

Now the colors on the sprites will only stay colored (not black) for one frame!
Because you don't have COLUP0 and COLUP1 inside your main loop:

http://www.randomter...nds.html#colup0

http://www.randomter....html#ephvarreg


Attached File  jr_pac_2011y_07m_24d_2018t.bas   1.12K   16 downloads

Edited by Random Terrain, Sun Jul 24, 2011 6:24 PM.


#19 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,545 posts
  • Location:Georgia, USA

Posted Sun Jul 24, 2011 6:24 PM

View PostJr. Pac, on Sun Jul 24, 2011 5:48 PM, said:

Now the colors on the sprites will only stay colored (not black) for one frame!
You need to put COLUP0 and COLUP1 inside the loop, before the drawscreen command, because batari Basic changes COLUP0 and COLUP1 to the scorecolor at the bottom of every frame. If you had set scorecolor to something (instead of leaving it black), you'd have found that the sprites retained their colors for one frame, then changed to the scorecolor for subsequent frames. So putting COLUP0 and COLUP1 inside the loop, just before drawscreen, ensures that the sprite colors get set to the desired values before each frame is drawn.

Michael

#20 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 6:51 PM

Thanks for the info.

#21 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 7:03 PM

Now to the controls... That's not going to be any fun. When you press up, I need the player to go left. etc. This game was designed for your television to be turned on its side.

#22 jrok OFFLINE  

jrok

    Stargunner

  • 1,108 posts

Posted Sun Jul 24, 2011 7:21 PM

View PostJr. Pac, on Sun Jul 24, 2011 7:03 PM, said:

This game was designed for your television to be turned on its side.

Posted Image

:twisted:

#23 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,545 posts
  • Location:Georgia, USA

Posted Sun Jul 24, 2011 7:48 PM

View Postjrok, on Sun Jul 24, 2011 7:21 PM, said:

View PostJr. Pac, on Sun Jul 24, 2011 7:03 PM, said:

This game was designed for your television to be turned on its side.

Posted Image

:twisted:
... or you could lay on your side as you play. :ponder:

Michael

#24 Jr. Pac OFFLINE  

Jr. Pac

    Dragonstomper

  • 775 posts
  • 1/4 of the fun with an Atari cart is cleaning it.
  • Location:In my room with my 2600.

Posted Sun Jul 24, 2011 8:37 PM

I'm getting MORE syntax errors. :(

Attached Files


Edited by Jr. Pac, Sun Jul 24, 2011 8:38 PM.


#25 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Mon Jul 25, 2011 3:26 AM

View PostJr. Pac, on Sun Jul 24, 2011 8:37 PM, said:

I'm getting MORE syntax errors. :(
I just loaded it, compiled it, ran it and got no errors. Did you attach the latest version? It looks exactly like the last version that I attached.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users