rem batari Basic Program rem Created 4/4/2009 11:45:42 AM by Visual bB Version 1.0.0.544 rem This program is by Steven Reynolds 2009 rem this code is public domain rem Dirty 30 FPS flicker hardware collision dim sprite1x = a dim sprite1y = b dim sprite2x = c dim sprite2y = d dim sprite3x = e dim sprite3y = f dim sprite4x = g dim sprite4y = h dim frame = i rem frame rem cycle p1 sprites c d c d dim altframe = j rem altframe rem cycle p0 sprites aa bb aa bb dim pstatus = k rem pstatus rem use bit 0 for sprite1 status rem use bit 1 for sprite2 status rem rem "if player alive, allow movement" rem "if player dead, disallow movement" dim drec = l rem Drec catches joystick directional input resetme frame = 0 altframe = 0 sprite1x = 30 sprite1y = 20 sprite2x = 60 sprite2y = 20 sprite3x = 46 sprite3y = 48 sprite4x = 80 sprite4y = 48 pstatus = 0 z = 0 main rem use aa bb aa bb pattern for player0 sprite rem rotate a b a b standard flicker for p1 sprite if collision(player0,player1) && altframe = 0 then pstatus{0} = 1 if collision(player0,player1) && altframe = 1 then pstatus{1} = 1 COLUP0 = 128 COLUP1 = 64 rem reset game variables drec = 0 rem Each time the frame counter for p1 gets to 2, then swap the p0 sprites if frame = 2 then altframe = altframe + 1 if altframe = 2 then altframe = 0 if altframe = 0 then gosub p0sprite1 if altframe = 1 then gosub p0sprite2 if frame = 2 then frame = 0 if frame = 0 then gosub p1sprite3 if frame = 1 then gosub p1sprite4 frame = frame + 1 drawscreen rem move both sprites until touched and then kill sprites if switchreset then goto resetme if joy0up then drec{0} = 1 if joy0right then drec{1} = 1 if joy0down then drec{2} = 1 if joy0left then drec{3} = 1 rem player sprite movement if pstatus{0} then goto sprite2 if drec{0} then sprite1y = sprite1y - 1 if drec{1} then sprite1x = sprite1x + 1 if drec{2} then sprite1y = sprite1y + 1 if drec{3} then sprite1x = sprite1x - 1 sprite2 if pstatus{1} then goto sk2 if drec{0} then sprite2y = sprite2y - 1 if drec{1} then sprite2x = sprite2x + 1 if drec{2} then sprite2y = sprite2y + 1 if drec{3} then sprite2x = sprite2x - 1 sk2 sprite3y = sprite3y + 1 sprite4y = sprite4y - 1 rem i like tuna fish goto main p0sprite1 player0x = sprite1x player0y = sprite1y if pstatus{0} then goto deadsprite1 A player0: %10001000 %10001000 %10001000 %11111000 %10001000 %10001000 %10001000 %11111000 end goto es1 deadsprite1 player0: %00011000 %00100100 %00100100 %00101100 %01000010 %01010110 %01000010 %00111100 end es1 return p0sprite2 player0x = sprite2x player0y = sprite2y if pstatus{1} then goto deadsprite2 B player0: %01110000 %10001000 %10001000 %11110000 %10001000 %10001000 %10001000 %11110000 end goto es2 deadsprite2 player0: %00011000 %00100100 %00100100 %00101100 %01000010 %01010110 %01000010 %00111100 end es2 return p1sprite3 player1x = sprite3x player1y = sprite3y C player1: %11111000 %10000000 %10000000 %10000000 %10000000 %10000000 %10000000 %11111000 end return p1sprite4 player1x = sprite4x player1y = sprite4y D player1: %11110000 %10011000 %10001000 %10001000 %10001000 %10001000 %10001000 %11110000 end return