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_2\samples\football\gfx\tileset_blanks.png 160A 3 0 1 2 incgraphic \data\78b_2\samples\football\gfx\playfield.png incgraphic \data\78b_2\samples\football\gfx\player_down_1.png incgraphic \data\78b_2\samples\football\gfx\player_up_1.png incgraphic \data\78b_2\samples\football\gfx\goalpost.png incgraphic \data\78b_2\samples\football\gfx\flippedgoalpost.png incgraphic \data\78b_2\samples\football\gfx\newnumbers.png incgraphic \data\78b_2\samples\football\gfx\304050.png incgraphic \data\78b_2\samples\football\gfx\alphabet_8_wide.png 160A 0 2 1 3 incgraphic \data\78b_2\samples\football\gfx\scoredigits_8_wide.png incgraphic \data\78b_2\samples\football\gfx\player_down_2.png incgraphic \data\78b_2\samples\football\gfx\player_up_2.png incgraphic \data\78b_2\samples\football\gfx\topright_alt.png incgraphic \data\78b_2\samples\football\gfx\topleft_alt.png incgraphic \data\78b_2\samples\football\gfx\bottomright_alt.png incgraphic \data\78b_2\samples\football\gfx\bottomleft_alt.png characterset alphabet_8_wide BACKGRND=$D2 P0C1=$d2 P0C2=$0F P0C3=$d4 P1C1=$f2 P1C2=$f8 P1C3=$fd P2C1=$1E P2C2=$1B P2C3=$1A P3C1=$22 P3C2=$28 P3C3=$2d P4C1=$92 P4C2=$98 P4C3=$3d P5C1=$82 P5C2=$88 P5C3=$8d P6C1=$c8 P6C2=$c8 P6C3=$c8 P7C1=$0F P7C2=$92 P7C3=$00 clearscreen plotmap screen1map 0 0 0 20 12 plotsprite topleft_alt 7 65 87 plotsprite topright_alt 7 81 87 plotsprite bottomleft_alt 7 65 103 plotsprite bottomright_alt 7 81 103 drawscreen savescreen score0=0000 pattern=0 newgame=1 init x0=80 y0=172 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=114 y7=20 x8=45 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>172 then y0=172 if y1>170 then y1=0 if y2>170 then y2=0 if y3>170 then y3=0 if y4>170 then y4=0 if y5>170 then y5=0 if y6>170 then y6=0 if y7>170 then y7=0 if y8>170 then y8=0 if y9>170 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 4 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 4 x9 y9:goto nextframe2 plotsprite player_down_2 4 x9 y9 nextframe2 rem plotvalue [png file] [Palette] [BCDvariable] [#digits] [X] [Y] [optExtrawide] rem plotvalue scoredigits_8_wide 6 score0 6 5 0 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:score0=score0+7:AUDV0=0:AUDV1=0: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' 7 44 3 plotchars 'challenge' 7 45 4 plotchars 'press fire' 2 43 9 plotchars ' to start' 2 44 10 drawscreen restorescreen if joy0fire then goto main goto startup pausegame plotvalue scoredigits_8_wide 6 score0 6 5 0 audiocounter=audiocounter+1 if audiocounter>40 then goto init playsfx sfx_cavalry drawscreen restorescreen data sfx_cavalry $10,$07,$05 ; version, priority, frames per chunk $1D,$04,$08 ; first chunk of freq,channel,volume data $1A,$04,$08 $17,$04,$08 $13,$04,$08 $17,$04,$08 $13,$04,$08 $13,$04,$08 $00,$00,$00 end goto pausegame resetgame audiocounter=audiocounter+1 if audiocounter>35 then audiocounter=35 if audiocounter<35 then playsfx sfx_advbite data sfx_advbite $10,$10,$02 ; version, priority, frames per chunk $1F,$03,$0F ; first chunk of freq,channel,volume data $1F,$08,$0E $1F,$03,$0D $1F,$08,$0C $1F,$03,$0B $1F,$08,$0A $1F,$03,$09 $1F,$08,$08 $1F,$03,$07 $1F,$08,$06 $1F,$03,$05 $1F,$08,$04 $1F,$03,$03 $1F,$08,$02 $1F,$03,$01 $00,$00,$00 end drawscreen if joy0fire then score0=0:BACKGRND=$D2: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 box rem b=white box rem c=black box rem d=2 line rem e=hash line, bottom dark top light rem f=white line, bottom dark top light rem g= 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=2 line 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 line rem .=0 line rem !=4 line rem ?=1 line rem @=5 line rem #= white line alphachars ' abcdefghijklmnopqrstuvwxyz.!?@#$%^&*' alphadata screen1map tileset_blanks 'iiiiiiiipqrsiiiiiiii' 'gggggghgggggghgggggg' '#?.###u######u###?.#' '#t.###u######u###t.#' '#z.###u######u###z.#' '#!.###u######u###!.#' '#@.###u######u###@.#' '#!.###u######u###!.#' '#z.###u######u###z.#' '#t.###u######u###t.#' '#?.###u######u###?.#' 'ffffffeffffffeffffff' end rem 'iiiiiiiivwxyiiiiiiii' 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 y8=y8+1 if counter<2 then goto skipmove4 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 y7=y7+1 y3=y3+1 skipmove4 anim1=1 anim2=1 anim3=1 anim4=0 anim5=0 anim6=1 anim7=1 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