Jump to content



0

Black screen glitch


6 replies to this topic

#1 gHan2000 OFFLINE  

gHan2000

    Space Invader

  • 41 posts

Posted Sun Feb 6, 2011 4:12 PM

I finally got my batari Basic working, so now I started coding.

For some reason, when I compiled and tested my game, it just got a pure black screen.

I coded this out:

playfield:
…............................
…............................
…............................
…............................
…............................
…............................
…............................
…............................
…............................
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

COLUBK = 20$
COLUPF = 212
player0x=50player0y=50
player1x=20player1y=20
player0:
%01111110
%01000010
%01000010
%01111110
001000
011100
001000
010100
end

player1:
%11111111
%10000001
%10000001
%10000001
%10000001
%10000001
%10000001
%11111111
end

draw_loop
drawscreen
goto draw_loop

Do you see any errors in it?

#2 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Sun Feb 6, 2011 10:20 PM

It's hard to check to see if you have any indenting errors, because the forum tends to eat indents. Its easier next time to attach the file.

The first thing that jumps out at me is the lines in the form "player0x=50player0y=50". You need a colon between two commands if you want them on the same line. "player0x=50:player0y=50" would work.

#3 diogoandrei OFFLINE  

diogoandrei

    Chopper Commander

  • 210 posts
  • Location:Brazil

Posted Tue Feb 8, 2011 3:48 PM

Ok, let me help you. Lots of things...

1. playfield needs and "end" command;
2. COLUBK = 20$ should be COLUBK = $20;
2. As RevEng noticed, you need a colon ":" inbetween player0x and player0y;
3. player0 needs % and two more binaries on the last 4 lines;
4. plus, the indent.

Something like this:

 playfield:
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end

 COLUBK = $20
 COLUPF = 212

 player0x=50 : player0y=50
 player1x=20 : player1y=20

 player0:
 %01111110
 %01000010
 %01000010
 %01111110
 100000
 %01110000
 100000
 %01010000
end

 player1:
 %11111111
 %10000001
 %10000001
 %10000001
 %10000001
 %10000001
 %10000001
 %11111111
end

draw_loop
 drawscreen
 goto draw_loop

Attached you will find .bas and .bin as examples. As always, go to Random Terrain.

Something weird I noticed while doing this post is that when using "Insert code snippet", when you dial "percent symbol zero zero" with no blank spaces in there the three digits are just ignored. I am using Google Chrome... is that normal? :? ...that's why you will find player0 to look weird in the above code.

Attached Files



#4 RevEng OFFLINE  

RevEng

    River Patroller

  • 2,010 posts
  • bit shoveler
  • Location:Canada

Posted Tue Feb 8, 2011 4:02 PM

The forum likes to eat the characters "%00". I think it's a misguided security thing.

I noticed that you can add them back in if you edit the post in the non-full post editor, or you can also type in two percent characters and four zeros, and that works too. (though they get stripped if you preview the post)

#5 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

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

Posted Tue Feb 8, 2011 4:39 PM

That's why it's easier for everybody to just attach a file. You don't have to worry about the forum raping your code.

#6 gHan2000 OFFLINE  

gHan2000

    Space Invader

  • 41 posts

Posted Thu Feb 10, 2011 4:49 PM

View Postdiogoandrei, on Tue Feb 8, 2011 3:48 PM, said:

1. playfield needs and "end" command;


I originally had an end function in the code, but when I tried compiling it it said ''Error line 12; [Insert vocabulary here] end function''.

Anyway, I'll try your modified version of my code. :)

Edited by gHan2000, Thu Feb 10, 2011 4:50 PM.


#7 jwierer OFFLINE  

jwierer

    Dragonstomper

  • 746 posts
  • Location:Seattle,WA

Posted Thu Feb 10, 2011 6:16 PM

For those new to bB, bblint comes in really handy for checking syntax errors like this.

-Jeff




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users