|
| 1 | + |
| 2 | + rem *** This is the "adventurer" sample, converted to banksets |
| 3 | + rem *** There were only 3 changes required to use banksets. |
| 4 | + rem *** |
| 5 | + rem *** 1 - add "set banksets on" near the top of the source |
| 6 | + rem *** 2 - add "bset_" to the name of the alphadata that displays the word "demo" |
| 7 | + rem *** 3 - add "bset_" to the name of the alphadata that defines the screen tiles. |
| 8 | + rem *** |
| 9 | + |
| 10 | + set doublewide on |
| 11 | + set tv ntsc |
| 12 | + set banksets on |
| 13 | + |
| 14 | + dim xpos=a |
| 15 | + dim ypos=b |
| 16 | + dim frame=c |
| 17 | + dim herodir=d |
| 18 | + dim moving=e |
| 19 | + dim heroframe=f |
| 20 | + |
| 21 | + displaymode 160A |
| 22 | + |
| 23 | + xpos=40 |
| 24 | + |
| 25 | + rem ** setup Palette 1 |
| 26 | + P1C1=$12 |
| 27 | + P1C2=$F6 |
| 28 | + P1C3=$Fc |
| 29 | + |
| 30 | + rem ** setup Palette 2 |
| 31 | + P2C1=$62 |
| 32 | + P2C2=$86 |
| 33 | + P2C3=$ac |
| 34 | + |
| 35 | + incgraphic gfx/tileset_blanks.png 160A 3 0 1 2 |
| 36 | + incgraphic gfx/tileset_rocks.png |
| 37 | + incgraphic gfx/scoredigits_8_wide.png |
| 38 | + incgraphic gfx/alphabet_8_wide.png 160A 0 2 1 3 |
| 39 | + |
| 40 | + incgraphic gfx/herodown1.png |
| 41 | + incgraphic gfx/herodown2.png |
| 42 | + incgraphic gfx/heroleft1.png |
| 43 | + incgraphic gfx/heroleft2.png |
| 44 | + incgraphic gfx/heroup1.png |
| 45 | + incgraphic gfx/heroup2.png |
| 46 | + incgraphic gfx/heroright1.png |
| 47 | + incgraphic gfx/heroright2.png |
| 48 | + |
| 49 | + P0C1=heroright2_color1 |
| 50 | + P0C2=heroright2_color2 |
| 51 | + P0C3=heroright2_color3 |
| 52 | + |
| 53 | + rem ** activate the graphics area with our tiles... |
| 54 | + characterset tileset_blanks |
| 55 | + |
| 56 | + clearscreen |
| 57 | + |
| 58 | + rem ** put the background down and save the screen before the main loop. |
| 59 | + rem ** this way we don't setup the background over and over again. |
| 60 | + |
| 61 | + plotmap bset_screen1map 1 0 0 20 12 |
| 62 | + plotchars bset_demotext 2 64 3 4 |
| 63 | + savescreen |
| 64 | + |
| 65 | + drawscreen |
| 66 | + |
| 67 | +mainloop |
| 68 | + |
| 69 | + z=$11 |
| 70 | + frame=(frame+1)&31 |
| 71 | + if frame=0 then score0=score0+1:score1=score1+z |
| 72 | + |
| 73 | + BACKGRND=$00 |
| 74 | + if joy0fire1 then BACKGRND=$38 |
| 75 | + if joy0fire0 then BACKGRND=$a8 |
| 76 | + |
| 77 | + rem ** move our hero in only the cardinal directions... |
| 78 | + moving=moving+1 |
| 79 | + if joy0down then ypos=ypos+1:herodir=0:goto doneherowalk |
| 80 | + if joy0up then ypos=ypos-1:herodir=2:goto doneherowalk |
| 81 | + if joy0left then xpos=xpos-1:herodir=1:goto doneherowalk |
| 82 | + if joy0right then xpos=xpos+1:herodir=3:goto doneherowalk |
| 83 | + moving=moving-1 : rem we didn't move |
| 84 | +doneherowalk |
| 85 | + |
| 86 | + restorescreen |
| 87 | + |
| 88 | + rem ** calculate which animation frame to display, based on direction and |
| 89 | + rem ** the walking counter... |
| 90 | + |
| 91 | + heroframe=(herodir*2)+((moving/16)&1) |
| 92 | + plotsprite herodown1 0 xpos ypos heroframe |
| 93 | + |
| 94 | + plotvalue scoredigits_8_wide 2 score0 6 56 11 |
| 95 | + plotvalue scoredigits_8_wide 2 score1 6 56 10 |
| 96 | + |
| 97 | + drawscreen |
| 98 | + |
| 99 | + goto mainloop |
| 100 | + |
| 101 | + alphadata bset_demotext alphabet_8_wide |
| 102 | + 'demo' |
| 103 | +end |
| 104 | + |
| 105 | + alphachars ' abcdefghijklmnopqrstuvwxyz' |
| 106 | + |
| 107 | + alphadata bset_screen1map tileset_blanks |
| 108 | + 'hifgfg fgfghi' |
| 109 | + 'hi hi' |
| 110 | + 'hi hi' |
| 111 | + 'fg fg' |
| 112 | + ' ' |
| 113 | + ' ' |
| 114 | + ' ' |
| 115 | + ' ' |
| 116 | + 'hi hi' |
| 117 | + 'hi hi' |
| 118 | + 'hi dehi' |
| 119 | + 'fgfgfg fgfgfg' |
| 120 | +end |
0 commit comments