Posted Fri May 13, 2011 9:57 AM
Posted Fri May 13, 2011 12:27 PM
esplonky, on Fri May 13, 2011 9:57 AM, said:
rem * this example will have black players COLUBK = $06 : rem * gray COLUP0 = $44 : rem * red COLUP1 = $84 : rem * blue player0: %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 end player1: %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 end player0x = 30 player0y = 32 player1x = 120 player1y = 64 loop drawscreen goto loop
rem * this example will have green players COLUBK = $06 : rem * gray COLUP0 = $44 : rem * red COLUP1 = $84 : rem * blue scorecolor = $C4 : rem * green player0: %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 end player1: %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 end player0x = 30 player0y = 32 player1x = 120 player1y = 64 loop drawscreen goto loop
rem * this example will have a red and a blue player COLUBK = $06 : rem * gray scorecolor = $C4 : rem * green player0: %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 end player1: %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 %11111111 end player0x = 30 player0y = 32 player1x = 120 player1y = 64 loop COLUP0 = $44 : rem * red COLUP1 = $84 : rem * blue drawscreen goto loopMichael
Posted Fri May 13, 2011 12:35 PM
player0color: 66 66 66 66 end
Edited by atari2600land, Fri May 13, 2011 12:35 PM.
Posted Tue May 17, 2011 8:46 AM
draw_event
rem If scrolling variable is set to true and the first bit of the counter is 1 then scroll the screen down
if scrolling && counter{0} then pfscroll down
rem If the march counter is toggled then flip the sprites around to look like they're animated
if march then REFP0 = 8 : REFP1 = 8
rem Since I change Nitebears color depending on his hit points I've got that wrapped up in a separate subroutine
gosub paint_nitebear
rem BatariBASIC forgets the sprite colors every drawsceen so set them to the current enemy size and color variables
COLUP1 = enemycolor
NUSIZ1 = enemysize
rem Now that everything is set draw that screen![/color]
drawscreen
paint_nitebear
rem Depending on how low the hit points are set the player color via constants to make color codes more understandable
if nitebearhp > 50 then COLUP0 = c_tan : return
if nitebearhp > 25 then COLUP0 = c_orange : return
if nitebearhp > 10 then COLUP0 = c_red
return
Edited by theloon, Tue May 17, 2011 9:07 AM.
Posted Thu May 19, 2011 2:12 PM
lives=128 dim lives_centered = 1 dim lives_compact = 1 set romsize 4k titlescreen COLUBK = 28 COLUPF = 36 playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X.....XXXXXXX..............XX..X X..X...XXXXXXXXXXX...XXXXXXXX..X X..XX...XXXXXXXXXX...XXXXXXXX..X X..XXX...XXXXXXXXX...XXXXXXXX..X X..XXXX...XXXXXXXX...XXXXXXXX..X X..XXX...XXXXXXXXX...XXXXXXXX..X X..XX...XXXXX..XX....XXXXXXXXXXX X..X...XXXXXX.......XXXXXXXXX..X X.....XXXXXXXX.....XXXXXXXXXX..X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end PF0 = %10101010 drawscreen if joy0fire then goto start goto titlescreen start playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ end COLUBK = 60 COLUPF = $3E player0x=99:player0y=90 player1x=20:player1y=20 missile0height=8:missile0y=255 NUSIZ0 = 82 scorecolor = sprites player0: %00000000 %01000100 %01000100 %01000100 %01000100 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %11111110 %10111010 %10111010 %10111010 %00111000 %00000000 %00000000 end player1: %00000000 %00100100 %00011000 %00111100 %00011000 %00011000 %00111100 %00000000 end if missile0y>240 then goto skip missile0y = missile0y-2:goto draw_loop skip if joy0fire then missile0y = player0y-2:missile0x =player0x+4 if switchreset then reboot draw_loop drawscreen if player1y < player0y then player1y = player1y+1 if player1y > player0y then player1y = player1y-1 if player1x < player0x then player1x = player1x+1 if player1x > player0x 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=0:missile0y=255 if collision(player0,player1) then lives=lives-32:player1x=rand/2:player1y=0:missile0y=255 if collision(player1,ball) then score=score+0:player1x=rand/2:player1y=0:bally=255 if lives < 32 then reboot jump goto sprites
Posted Thu May 19, 2011 2:13 PM
Posted Thu May 19, 2011 2:50 PM
esplonky, on Thu May 19, 2011 2:13 PM, said:
Posted Mon May 23, 2011 2:25 PM
Posted Mon May 23, 2011 2:27 PM
0 members, 1 guests, 0 anonymous users