Posted Tue Dec 20, 2011 10:58 PM
Posted Tue Dec 20, 2011 11:00 PM
Tony The 2600, on Tue Dec 20, 2011 10:58 PM, said:
Posted Tue Dec 20, 2011 11:16 PM
default.bas 363bytes
21 downloads
Posted Tue Dec 20, 2011 11:19 PM
Posted Tue Dec 20, 2011 11:37 PM
rem * a simple bB program * COLUBK = $44 : rem * set the background color to red scorecolor = $1A : rem * set the score color to yellow loop drawscreen goto loop"loop" is a line label and is not indented, but the other lines are code lines and must be indented. A single space is enough indentation, but I like to indent at least 3 spaces so the indented lines stand out better from the line labels. (With an indentation of only 1 space, it's a little harder to tell the difference.)
Posted Tue Dec 20, 2011 11:46 PM
Random Terrain, on Tue Dec 20, 2011 11:19 PM, said:
loop drawscreen goto loopHowever, if you compile that program it will run, but the screen will be totally blank (black), because the program never sets any colors or defines any graphical shapes. So if you want to *see* that your program is running successfully, you should at least set the background color with a "COLUBK =" statement, like this:
COLUBK = $94 loop drawscreen goto loopThat will display a blue screen ($94 is blue) with a black score.
Posted Tue Dec 20, 2011 11:51 PM
Tony The 2600, on Tue Dec 20, 2011 11:40 PM, said:
playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end COLUBK = $50 COLUPF = 212 player0x=50:player0y=50 player1x=20:player1y=20 missile0height=4:missile0y=255 NUSIZ0 = 16 sprites player0: %00111100 %00011000 %00111100 %00011000 %00111100 %00011000 %00011000 %00000000 end player1: %00000000 %00000000 %00000000 %01011010 %01011010 %10000001 %01000010 %00111100 end if missile0y>then goto skip missile0y = missile0y-2:goto draw_loop skip if joy0fire then missile0y = player0y-2:missile0x=player0x+4 draw_loop drawscreen if player1y < player0y then player1y = player1y+1 if player1y > player0y then player1y = player1y+1 if player1x < player0y then player1x = player1x+1 if player1x > player0y then player1x = player1x+1 player1x = player1x:player1y = player1y if joy0up then player0y = player0y-1:goto jump if joy0down then player0y = player0y+1:goto jump if joy0left then player0x = player0x-1:goto jump if joy0right then player0x = player0x+1:goto jump if collision(missile0.player1)then score=score+1:player1x=rand/2:player1y=missile0y=255 if collision(player0.player1)then score=score-1:player1x=rand/2:player1y=missile0y=255 jump goto sprites
Posted Wed Dec 21, 2011 12:03 AM
Posted Wed Dec 21, 2011 12:09 AM
Posted Wed Dec 21, 2011 12:14 AM
Tony The 2600, on Wed Dec 21, 2011 12:03 AM, said:
Posted Wed Dec 21, 2011 12:44 AM
Edited by Tony The 2600, Wed Dec 21, 2011 1:29 AM.
0 members, 1 guests, 0 anonymous users