set kernel_options player1colors rem player0 is the bad guy (shark in level 1) dim p0_count = a p0_count = 0 dim p0_selector = b p0_selector = 0 dim p0_clock = c p0_clock = 220 dim p0x = d dim p0y = e dim p0x2= f dim p0y2=g rem player1 is the good guy dim p1x = h p1x = 75 dim p1y = i p1y = 75 dim p1_count = j p1_count = 0 playfield: ................................ ..X..........X................X. ..................X.......X..... .......X........................ ................X..............X ...X.........X.......X.......... X..........................X.... ................................ .........X.......X.......X...... ...X.........................X.. ................................ end COLUBK = $82 COLUPF = $80 mainloop player1color: $FE $FE $40 $40 $40 $40 $FE $FE $FE $FE $FE $FE $FE $1E $1E $1E $1E $1E $1E end rem Swimmer Animation Frames if p1_count = 0 then player1: %1110000 %0010111 %0110110 %0111110 %0111110 %0011100 %0011101 %0011101 %0011101 %0111111 %1111110 %1001000 %1011100 %0111110 %1111111 %1111111 %1111111 %1111111 %0111110 end if p1_count = 30 then player1: %0000111 %1110100 %0110110 %0111110 %0111110 %0011100 %1011100 %1011100 %1011100 %1111110 %0111111 %0001001 %0011101 %0111110 %1111111 %1111111 %1111111 %1111111 %0111110 end if p1_count=60 then p1_count=0 else p1_count=p1_count+1 rem Shark Animation Frames if p0_clock=220 || p0_clock<=50 then player0: %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000011 end if p0_clock=210 || p0_clock=60 then player0: %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000111 %00000011 end if p0_clock=200 || p0_clock=70 then player0: %00000000 %00000000 %00000000 %00000000 %00000000 %00001111 %00000111 %00000011 end if p0_clock=190 || p0_clock=80 then player0: %00000000 %00000000 %00000000 %00000000 %00011111 %00001111 %00000111 %00000011 end if p0_clock=180 || p0_clock=90 then player0: %00000000 %00000000 %00000000 %00111111 %00011111 %00001111 %00000111 %00000011 end if p0_clock=170 || p0_clock=100 then player0: %00000000 %00000000 %01111111 %00111111 %00011111 %00001111 %00000111 %00000011 end if p0_clock=160 || p0_clock=110 then player0: %00000000 %11111111 %01111111 %00111111 %00011111 %00001111 %00000111 %00000011 end if p0_clock=150 then player0: %11111111 %11111111 %01111111 %00111111 %00011111 %00001111 %00000111 %00000011 end draw_loop pfscroll down rem Assign player1 (good guy) coordinates player1x=p1x : player1y=p1y rem Adjust player1 coordinates for next placement if joy0right then REFP1 = 0 if joy0right then p1x=p1x+1 if joy0left then REFP1 = 8 if joy0left then p1x=p1x-1 if joy0up then p1y=p1y-1 if joy0down then p1y=p1y+1 rem if player1 is going off-screen, bring him back if p1x<15 then p1x= 15 if p1x>137 then p1x=137 if p1y<20 then p1y=20 if p1y>85 then p1y=85 rem Generate random placments for two new sharks if p0_clock=220 then p0x=(rand&137) if p0_clock=220 then p0y=(rand&65) if p0_clock=220 then p0x2=(rand/2) if p0_clock=220 then p0y2=(rand/4) rem Adjust player0 (shark) coordinates for next placements if p0_selector=0 && p0_count=1 then p0x=p0x-1 if p0_selector=0 && p0_count=3 then p0y=p0y+1 if p0_selector=1 && p0_count=0 then p0x2=p0x2-1 if p0_selector=1 && p0_count=2 then p0y2=p0y2+1 rem Overall shark clock sets how much of the fin is out of the water. Countdown to 0. p0_clock=p0_clock-1 rem If shark clock has reached 0, then create random coordinates for new placments. if p0_clock=0 then p0x=(rand&137) if p0_clock=0 then p0y=(rand&65) if p0_clock=0 then p0x2=(rand/2) if p0_clock=0 then p0y2=(rand/4) rem If shark clock has reached 0, go ahead and reset shark clock. if p0_clock=0 then p0_clock=220 rem Place the two copies of the shark if p0_selector=0 then player0x=p0x : player0y=p0y if p0_selector=1 then player0x=p0x2 : player0y=p0y2 rem Toggle shark selector from 0 to 1 or 1 to 0 if p0_selector=0 then p0_selector=1 else p0_selector=0 rem if shark count is 4, reset it to 0. Otherwise, increment it. if p0_count=4 then p0_count=0 else p0_count=p0_count+1 drawscreen goto mainloop