 rem Generated 1/4/2010 1:48:01 PM by Visual bB Version 1.0.0.548
 rem **********************************
 rem *<Luciano Game>               *
 rem *<Atire no inimigo que vem caindo>*
  rem *<www.lucianovictor.com>             *
 rem **********************************


 rem Create the title screen
opening

 playfield:
 X....X..X.XXX.X.XXX.X..X.XXXX...
 X....X..X.X...X.X.X.X..X.X..X...
 X....X..X.X...X.XXX.XX.X.X..X...
 X....X..X.X...X.X.X.X.XX.X..X...
 XXXX.XXXX.XXX.X.X.X.X..X.XXXX...
 ................................
 ...XXXXX.XXXX.X...X.XXXX........
 ...X.....X..X.XX.XX.X...........
 ...X.XXX.XXXX.X.X.X.XXXX........
 ...X...X.X..X.X...X.X...........
 ...XXXXX.X..X.X...X.XXXX........
end


 rem Loop the screen until the spacebar is pressed
title
 COLUBK = $0E
 COLUPF = 212
 drawscreen
 if joy0fire || joy1fire then goto skiptitle
 goto title

 rem This function displays after the title is skipped
skiptitle

 rem Colors
 COLUPF = 212
 COLUBK = $0E

 rem Player location
 player0x = 85 : player0y = 85
 player1x =  05: player1y = 05

 rem Score setting and color
 score = 0: scorecolor = $44

 rem Missle size and location
 missile0height=4:missile0y=255
 NUSIZ0 = 16

 rem Create a variable to keep up with lives
 a = 5

 rem Create the playfield
 playfield:
 X....X..X.XXX.X.XXX.X..X.XXX....
 X....X..X.X...X.X.X.XX.X.X.X....
 X....X..X.X...X.XXX.X.XX.X.X....
 XXXX.XXXX.XXX.X.X.X.X..X.XXX....
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end



 rem This main function is what loops constantly
main

 rem This is the animation function
animate
 rem This frame variable slows down the animation
 v = v + 1 
 
 rem This code animates the sprites
 if v = 7 && w = 0 then ax

 goto nextstep
 

ax
 v = 0
 w = 1
 player1:
 %01111111
 %01011101
 %01000001
 %01001001
 %01000001
 %01010101
 %01000001
 %01111111

 
end
 goto nextstep


end
 rem Create acorn sprite
nextstep
 player0:


 %01100011
 %01100011
 %01100011
 %01100011
 %01100011
 %01111111
 %01110111
 %01111111
end

 rem check to see if a missile has already been fired
checkfire
 if missile0y>240 then goto skip
 missile0y = missile0y - 2 : goto draw

 rem if a missile hasn't been fired, then fire missile
skip
 if joy0fire then missile0y=player0y-2:missile0x=player0x+4

 rem Draw output to screen
draw
 drawscreen

 rem Fix player wraparound bug
 if player0x < 8 then player0x = 8
 if player0x > 150 then player0x = 150
 if player0y < 8 then player0y = 8
 if player0y > 84 then player0y = 84

 rem Have player 1 chase player 2
 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


 rem Detect missile collision with squirrel
 if collision(missile0,player1) then score=score+1:player1x=rand/2:player1y=0:missile0y=255:goto pointsound
 rem Detect squirrel collision with the acorn
 if collision(player0,player1) then score=score-1:player1x=rand/2:player1y=0:missile0y=255:a=a-1:goto deadsound






 rem joystick movements
 if joy0up then player0y = player0y-1 : goto skipmove
 if joy0down then player0y = player0y+1 : goto skipmove
 if joy0left then player0x = player0x-1 : goto skipmove
 if joy0right then player0x = player0x +1 : goto skipmove

 rem refresh the screen
skipmove
 goto main




 rem Play point sound
pointsound
 AUDV0 = 5 : AUDC0 = 4 : AUDF0 = 10
 p = p + 1
 drawscreen
 if p < 2 then pointsound
 p = 0
 AUDV0 = 0 : AUDC0 = 0 : AUDF0 = 0
 goto main

 rem Play dead sound
deadsound
 AUDV1 = 8,1,31
 AUDC1 = 0,0,0
 AUDF1 = 11
 p = p + 1
 drawscreen
 if p < 10 then deadsound
 p = 0
 AUDV1 = 8.1.31 : AUDC1 = 0.0.0 : AUDF1 = 11
 if a = 0 then goto opening

     
 playfield:
   .XXXXXX.XXXXXX.XXXXXXXXXX.XXXXX.
   .XX.....XX..XX.XX..XX..XX.XX....
   .XX.XXX.XXXXXX.XX..XX..XX.XXXX..
   .XX..XX.XX..XX.XX..XX..XX.XX....
   .XXXXXX.XX..XX.XX..XX..XX.XXXXX.
   ................................
   ...XXXXXX.XX..XX.XXXXX.XXXXXX...
   ...XX..XX.XX..XX.XX....XX..XX...
   ...XX..XX.XX..XX.XXXX..XXXXX....
   ...XX..XX.XX..XX.XX....XX..XX...
   ...XXXXXX...XX...XXXXX.XX..XX...
   end






 goto main













