set doublewide on dim frame=a dim counter=b dim pattern=c dim audiocounter=d dim framecounter=e dim bit=f dim newgame=g dim animatecounter=h dim x0=var0 dim y0=var1 dim x1=var2 dim y1=var3 dim x2=var4 dim y2=var5 dim x3=var6 dim y3=var7 dim x4=var8 dim y4=var9 dim x5=var10 dim y5=var11 dim x6=var12 dim y6=var13 dim x7=var14 dim y7=var15 dim x8=var16 dim y8=var17 dim x9=var18 dim y9=var19 dim anim9=var20 dim anim1=var21 dim anim2=var22 dim anim3=var23 dim anim4=var24 dim anim5=var25 dim anim6=var26 dim anim7=var27 dim anim8=var28 incgraphic \data\78b\samples\football\gfx\tileset_blanks.png 160A 3 0 1 2 incgraphic \data\78b\samples\football\gfx\playfield.png incgraphic \data\78b\samples\football\gfx\player_down_1.png incgraphic \data\78b\samples\football\gfx\player_up_1.png incgraphic \data\78b\samples\football\gfx\goalpost.png incgraphic \data\78b\samples\football\gfx\flippedgoalpost.png incgraphic \data\78b\samples\football\gfx\304050.png incgraphic \data\78b\samples\football\gfx\alphabet_8_wide.png 160A 0 2 1 3 incgraphic \data\78b\samples\football\gfx\scoredigits_8_wide.png incgraphic \data\78b\samples\football\gfx\player_down_2.png incgraphic \data\78b\samples\football\gfx\player_up_2.png characterset alphabet_8_wide BACKGRND=$00 P0C1=$d2 P0C2=$0F P0C3=$d4 P1C1=$a2 P1C2=$a8 P1C3=$3d P2C1=$1E P2C2=$1B P2C3=$1A P3C1=$42 P3C2=$48 P3C3=$3d P4C1=$92 P4C2=$98 P4C3=$3d P5C1=$92 P5C2=$98 P5C3=$3d P6C1=$c8 P6C2=$c8 P6C3=$c8 P7C1=$0F P7C2=$0F P7C3=$0F clearscreen plotmap screen1map 0 0 0 20 12 drawscreen savescreen score0=0000 pattern=0 newgame=1 init x0=80 y0=160 x1=10 y1=10 x2=30 y2=10 x3=140 y3=20 x4=60 y4=20 x5=100 y5=30 x6=130 y6=30 x7=145 y7=20 x8=150 y8=40 x9=80 y9=0 AUDV0=0 AUDV1=0 main if newgame=1 then goto startup rem walking sound rem if !joy0right && !joy0left && !joy0up && !joy0down then AUDV1=0: goto skipaudio1 AUDF1=audiocounter:AUDC1=2:AUDV1=3 if y0>160 then y0=160 if y1>160 then y1=0 if y2>160 then y2=0 if y3>160 then y3=0 if y4>160 then y4=0 if y5>160 then y5=0 if y6>160 then y6=0 if y7>160 then y7=0 if y8>160 then y8=0 if y9>160 then y9=0 if x0<2 then x0=1 if x1<2 then x1=1 if x2<2 then x2=1 if x3<2 then x3=1 if x4<2 then x4=1 if x5<2 then x5=1 if x6<2 then x6=1 if x7<2 then x7=1 if x8<2 then x8=1 if x9<2 then x9=1 if x0>145 then x0=145 if x1>145 then x1=145 if x2>145 then x2=145 if x3>145 then x3=145 if x4>145 then x4=145 if x5>145 then x5=145 if x6>145 then x6=145 if x7>145 then x7=145 if x8>145 then x8=145 if x9>145 then x9=145 skipaudio1 on pattern gosub p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 if pattern>14 then pattern=0 audiocounter=audiocounter+1 if audiocounter>5 then audiocounter=0 counter=counter+1 if counter>4 then counter=0 animatecounter=animatecounter+1 if animatecounter>15 then animatecounter=0 if switchreset then reboot rem erases any sprites on the screen since the last savescreen rem restorescreen if joy0left then x0=x0-1 if joy0right then x0=x0+1 if joy0up then y0=y0-1 if joy0down then y0=y0+1 rem plotsprite [PNGfile] [Palette#] [X] [Y] [optFrame] rem if !joy0up && !joy0down && !joy0left && !joy0right then plotsprite player_up_1 5 x0 y0:goto skipplayeranimate if animatecounter<9 then plotsprite player_up_1 5 x0 y0 if animatecounter>8 then plotsprite player_up_2 5 x0 y0 skipplayeranimate if animatecounter>8 then goto nextframe plotsprite player_down_1 1 x1 y1 plotsprite player_down_1 3 x2 y2 plotsprite player_down_1 1 x3 y3 plotsprite player_down_1 4 x4 y4 plotsprite player_down_1 3 x5 y5 plotsprite player_down_1 4 x6 y6 plotsprite player_down_1 3 x7 y7 plotsprite player_down_1 1 x8 y8 plotsprite player_down_1 1 x9 y9 goto nextframe2 nextframe if anim1=0 then plotsprite player_down_1 1 x1 y1:goto next1 plotsprite player_down_2 1 x1 y1 next1 if anim2=0 then plotsprite player_down_1 3 x2 y2:goto next2 plotsprite player_down_2 3 x2 y2 next2 if anim3=0 then plotsprite player_down_1 1 x3 y3:goto next3 plotsprite player_down_2 1 x3 y3 next3 if anim4=0 then plotsprite player_down_1 4 x4 y4:goto next4 plotsprite player_down_2 4 x4 y4 next4 if anim5=0 then plotsprite player_down_1 3 x5 y5:goto next5 plotsprite player_down_2 3 x5 y5 next5 if anim6=0 then plotsprite player_down_1 4 x6 y6:goto next6 plotsprite player_down_2 4 x6 y6 next6 if anim7=0 then plotsprite player_down_1 4 x6 y6:goto next7 plotsprite player_down_2 3 x7 y7 next7 if anim8=0 then plotsprite player_down_1 1 x8 y8:goto next8 plotsprite player_down_2 1 x8 y8 next8 if anim9=0 then plotsprite player_down_1 1 x9 y9:goto nextframe2 plotsprite player_down_2 1 x9 y9 nextframe2 rem plotvalue [png file] [Palette] [BCDvariable] [#digits] [X] [Y] [optExtrawide] rem plotvalue scoredigits_8_wide 6 score0 6 0 11 rem plotvalue scoredigits_8_wide 2 score1 6 56 10 if boxcollision(x0,y0, 13,13, x1,y1, 13,13) then BACKGRND=$42:goto resetgame if boxcollision(x0,y0, 13,13, x2,y2, 13,13) then BACKGRND=$42:goto resetgame if boxcollision(x0,y0, 13,13, x3,y3, 13,13) then BACKGRND=$42:goto resetgame if boxcollision(x0,y0, 13,13, x4,y4, 13,13) then BACKGRND=$42:goto resetgame if boxcollision(x0,y0, 13,13, x5,y5, 13,13) then BACKGRND=$42:goto resetgame if boxcollision(x0,y0, 13,13, x6,y6, 13,13) then BACKGRND=$42:goto resetgame if boxcollision(x0,y0, 13,13, x7,y7, 13,13) then BACKGRND=$42:goto resetgame if boxcollision(x0,y0, 13,13, x8,y8, 13,13) then BACKGRND=$42:goto resetgame if boxcollision(x0,y0, 13,13, x9,y9, 13,13) then BACKGRND=$42:goto resetgame if y0<10 then y0=160:x0=80: AUDF0=1:AUDC0=6:AUDV0=7:score0=score0+7:pattern=pattern+1:audiocounter=0:goto pausegame drawscreen if switchreset then reboot goto main startup rem plotchars textdata palette_# x y [number_of_chars | extrawide] rem Where... rem textdata is the RAM, ROM, or literal text string you're trying to plot on the screen. rem palette_# is the palette color set you wish the charters to be drawn with. rem x is the x screen coordinate of the new characters. rem y is the y line coordinate of the new characters. rem number_of_chars is the number of characters you wish to draw. This isn't used if you've used a literal string for the textdata parameter. newgame=0 plotchars 'touchdown' 2 44 2 plotchars 'challenge' 2 45 3 plotchars 'press fire' 2 43 8 plotchars ' to start' 2 44 9 drawscreen restorescreen if joy0fire then goto main goto startup pausegame audiocounter=audiocounter+1 if audiocounter>15 then AUDV0=0: goto init drawscreen restorescreen goto pausegame resetgame audiocounter=audiocounter+1 if audiocounter>15 then audiocounter=15 if audiocounter=15 then AUDV0=0 if audiocounter<15 then AUDF0=audiocounter:AUDC0=1:AUDV0=5 AUDV1=0 drawscreen if joy0fire then score0=0:BACKGRND=$00:goto init score0=000000 x0=80 y0=160 x1=10 y1=10 x2=30 y2=10 x3=50 y3=10 x4=70 y4=10 x5=90 y5=10 x6=120 y6=10 x7=30 y7=20 x8=80 y8=20 goto resetgame rem Tile Definitions rem rem a=dark green field, white line rem b=white box rem c=white box rem d=2 rem e=blank light green tile rem f=light green field, white line rem g=light green field, white line rem h=dark green field, white line rem i=dark green field rem j=player sprite rem k=player sprite rem l=player sprite rem m=player sprite rem n=1 rem o=0 rem p=bottom facing goalpost rem q=bottom facing goalpost rem r=bottom facing goalpost rem s=bottom facing goalpost rem t=5 rem u=light green double white line rem v=top facing goalpost rem w=top facing goalpost rem x=top facing goalpost rem y=top facing goalpost rem z=3 rem .=A Zero with a white line under it rem !=4 rem ?=A One with a white line under it alphachars ' abcdefghijklmnopqrstuvwxyz.!?,”$():'' alphadata screen1map tileset_blanks 'iiiiiiiipqrsiiiiiiii' 'noffffffffffffffffno' 'doffffffffffffffffdo' 'zoffffffffffffffffzo' '!offffffffffffffff!o' 'toffffffffffffffffto' '!offffffffffffffff!o' 'zoffffffffffffffffzo' 'doffffffffffffffffdo' '?.uuuuuuuuuuuuuuuu?.' 'iiiiiiiivwxyiiiiiiii' 'cccccccccccccccccccc' end p0 if counter<1 then goto skipmove1 if counter<2 then goto skipmove1 if counter<3 then goto skipmove1 rem if bit{0} then x3=x3+1 rem if !bit{0} then x3=x3-1 rem if x3<20 then bit{0}=1 rem if x3>145 then bit{0}=0 y5=y5+1 rem y4=y4+1 y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 rem y6=y6+1 rem y8=y8+1 y2=y2+1 if counter<4 then goto skipmove1 y7=y7+1 y3=y3+1 skipmove1 anim1=1 anim2=1 anim3=0 anim4=0 anim5=1 anim6=0 anim7=1 anim8=0 anim9=1 return thisbank p1 if counter<1 then goto skipmove0 y6=y6+1 if counter<2 then goto skipmove0 y8=y8+1 rem y2=y2+1 rem if bit{0} then x3=x3+1 rem if !bit{0} then x3=x3-1 rem if x3<20 then bit{0}=1 rem if x3>145 then bit{0}=0 if counter<3 then goto skipmove0 rem y5=y5+1 y4=y4+1 y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove0 y7=y7+1 rem y3=y3+1 skipmove0 anim1=1 anim2=0 anim3=0 anim4=1 anim5=0 anim6=1 anim7=1 anim8=1 anim9=1 return thisbank p2 if counter<1 then goto skipmove3 rem y6=y6+1 if counter<2 then goto skipmove3 y8=y8+1 y2=y2+1 if bit{0} then x3=x3+1 if !bit{0} then x3=x3-1 if x3<20 then bit{0}=1 if x3>145 then bit{0}=0 if counter<3 then goto skipmove3 y5=y5+1 y4=y4+1 rem y1=y1+1 rem if y9y0 then y9=y9-1 rem if x9x0 then x9=x9-1 if counter<4 then goto skipmove3 y7=y7+1 y3=y3+1 skipmove3 anim1=1 anim2=1 anim3=1 anim4=1 anim5=1 anim6=0 anim7=1 anim8=1 anim9=0 return thisbank p3 if counter<1 then goto skipmove4 y6=y6+1 if counter<2 then goto skipmove4 y8=y8+1 y2=y2+1 if bit{0} then x3=x3+1 if !bit{0} then x3=x3-1 if x3<20 then bit{0}=1 if x3>145 then bit{0}=0 if counter<3 then goto skipmove4 rem y5=y5+1 rem y4=y4+1 y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove4 rem y7=y7+1 y3=y3+1 skipmove4 anim1=1 anim2=1 anim3=1 anim4=0 anim5=0 anim6=1 anim7=0 anim8=1 anim9=1 return thisbank p4 if counter<1 then goto skipmove5 y6=y6+1 if counter<2 then goto skipmove5 rem y8=y8+1 rem y2=y2+1 rem if bit{0} then x3=x3+1 rem if !bit{0} then x3=x3-1 rem if x3<20 then bit{0}=1 rem if x3>145 then bit{0}=0 if counter<3 then goto skipmove5 y5=y5+1 rem y4=y4+1 rem y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove5 y7=y7+1 rem y3=y3+1 skipmove5 anim1=0 anim2=0 anim3=0 anim4=0 anim5=1 anim6=1 anim7=1 anim8=0 anim9=1 return thisbank p5 if counter<1 then goto skipmove6 y6=y6+1 if counter<2 then goto skipmove6 y8=y8+1 y2=y2+1 if bit{0} then x3=x3+1 if !bit{0} then x3=x3-1 if x3<20 then bit{0}=1 if x3>145 then bit{0}=0 if counter<3 then goto skipmove6 y5=y5+1 y4=y4+1 y1=y1+1 rem if y9y0 then y9=y9-1 rem if x9x0 then x9=x9-1 if counter<4 then goto skipmove6 rem y7=y7+1 rem y3=y3+1 skipmove6 anim1=1 anim2=1 anim3=0 anim4=1 anim5=1 anim6=1 anim7=0 anim8=1 anim9=0 return thisbank p6 if counter<1 then goto skipmove7 rem y6=y6+1 if counter<2 then goto skipmove7 y8=y8+1 rem y2=y2+1 if bit{0} then x3=x3+1 if !bit{0} then x3=x3-1 if x3<20 then bit{0}=1 if x3>145 then bit{0}=0 if counter<3 then goto skipmove7 y5=y5+1 y4=y4+1 y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove7 rem y7=y7+1 y3=y3+1 skipmove7 anim1=1 anim2=0 anim3=1 anim4=1 anim5=1 anim6=0 anim7=0 anim8=1 anim9=1 return thisbank p7 if counter<1 then goto skipmove8 y6=y6+1 if counter<2 then goto skipmove8 y8=y8+1 y2=y2+1 rem if bit{0} then x3=x3+1 rem if !bit{0} then x3=x3-1 rem if x3<20 then bit{0}=1 rem if x3>145 then bit{0}=0 if counter<3 then goto skipmove8 y5=y5+1 y4=y4+1 y1=y1+1 rem if y9y0 then y9=y9-1 rem if x9x0 then x9=x9-1 if counter<4 then goto skipmove8 y7=y7+1 rem y3=y3+1 skipmove8 anim1=1 anim2=1 anim3=0 anim4=1 anim5=1 anim6=1 anim7=1 anim8=1 anim9=0 return thisbank p8 if counter<1 then goto skipmove9 rem y6=y6+1 if counter<2 then goto skipmove9 y8=y8+1 rem y2=y2+1 if bit{0} then x3=x3+1 if !bit{0} then x3=x3-1 if x3<20 then bit{0}=1 if x3>145 then bit{0}=0 if counter<3 then goto skipmove9 y5=y5+1 rem y4=y4+1 y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove9 y7=y7+1 y3=y3+1 skipmove9 anim1=1 anim2=2 anim3=1 anim4=0 anim5=1 anim6=0 anim7=1 anim8=1 anim9=1 return thisbank p9 if counter<1 then goto skipmove10 y6=y6+1 if counter<2 then goto skipmove10 y8=y8+1 y2=y2+1 rem if bit{0} then x3=x3+1 rem if !bit{0} then x3=x3-1 rem if x3<20 then bit{0}=1 rem if x3>145 then bit{0}=0 if counter<3 then goto skipmove10 y5=y5+1 y4=y4+1 rem y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove10 y7=y7+1 rem y3=y3+1 skipmove10 anim1=0 anim2=1 anim3=0 anim4=1 anim5=1 anim6=1 anim7=1 anim8=1 anim9=1 return thisbank p10 if counter<1 then goto skipmove11 rem y6=y6+1 if counter<2 then goto skipmove11 rem y8=y8+1 rem y2=y2+1 if bit{0} then x3=x3+1 if !bit{0} then x3=x3-1 if x3<20 then bit{0}=1 if x3>145 then bit{0}=0 if counter<3 then goto skipmove11 y5=y5+1 y4=y4+1 y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove11 y7=y7+1 y3=y3+1 skipmove11 anim1=1 anim2=0 anim3=1 anim4=1 anim5=1 anim6=0 anim7=1 anim8=0 anim9=1 return thisbank p11 if counter<1 then goto skipmove12 y6=y6+1 if counter<2 then goto skipmove12 y8=y8+1 y2=y2+1 rem if bit{0} then x3=x3+1 rem if !bit{0} then x3=x3-1 rem if x3<20 then bit{0}=1 rem if x3>145 then bit{0}=0 if counter<3 then goto skipmove12 y5=y5+1 y4=y4+1 y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove12 rem y7=y7+1 y3=y3+1 skipmove12 anim1=1 anim2=1 anim3=0 anim4=1 anim5=1 anim6=1 anim7=0 anim8=1 anim9=1 return thisbank p12 if counter<1 then goto skipmove13 rem y6=y6+1 if counter<2 then goto skipmove13 y8=y8+1 rem y2=y2+1 if bit{0} then x3=x3+1 if !bit{0} then x3=x3-1 if x3<20 then bit{0}=1 if x3>145 then bit{0}=0 if counter<3 then goto skipmove13 y5=y5+1 y4=y4+1 y1=y1+1 rem if y9y0 then y9=y9-1 rem if x9x0 then x9=x9-1 if counter<4 then goto skipmove13 y7=y7+1 y3=y3+1 skipmove13 anim1=1 anim2=0 anim3=1 anim4=1 anim5=1 anim6=0 anim7=1 anim8=1 anim9=0 return thisbank p13 if counter<1 then goto skipmove14 y6=y6+1 if counter<2 then goto skipmove14 rem y8=y8+1 y2=y2+1 if bit{0} then x3=x3+1 if !bit{0} then x3=x3-1 if x3<20 then bit{0}=1 if x3>145 then bit{0}=0 if counter<3 then goto skipmove14 y5=y5+1 y4=y4+1 y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove14 y7=y7+1 rem y3=y3+1 skipmove14 anim1=1 anim2=1 anim3=0 anim4=1 anim5=1 anim6=1 anim7=1 anim8=0 anim9=1 return thisbank p14 if counter<1 then goto skipmove15 y6=y6+1 if counter<2 then goto skipmove15 y8=y8+1 y2=y2+1 if bit{0} then x3=x3+1 if !bit{0} then x3=x3-1 if x3<20 then bit{0}=1 if x3>145 then bit{0}=0 if counter<3 then goto skipmove15 y5=y5+1 y4=y4+1 y1=y1+1 if y9y0 then y9=y9-1 if x9x0 then x9=x9-1 if counter<4 then goto skipmove15 y7=y7+1 y3=y3+1 skipmove15 anim1=1 anim2=1 anim3=1 anim4=1 anim5=1 anim6=1 anim7=1 anim8=1 anim9=1 return thisbank