Working on a sample of 'bt' and 'st' together with 'ac'.

This commit is contained in:
Rob Greene 2018-07-13 18:59:23 -05:00
parent f0c27bcacf
commit 442cb1cdeb
5 changed files with 100 additions and 0 deletions

3
samples/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
setup.sh
*.po
!template.po

16
samples/mkships.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
if [ ! -f ./setup.sh ]
then
echo "This script depends on a 'setup.sh' script in the local directory."
echo "'setup.sh' should define an alias for 'bt' and 'ac'."
echo "Alternatively, you may craft a shell script with those names and place them on"
echo "the PATH."
exit 1
fi
shopt -s expand_aliases
source ./setup.sh
cp template.po ships.po
bt --stdout --applesingle --optimize ships.bas | ac -as ships.po startup

36
samples/ships.bas Normal file
View File

@ -0,0 +1,36 @@
10 gosub 50000
20 hgr
30 hcolor=6:hplot 0,13 to 279,13
100 hcolor=3:x=140:sd=0:s=sh
110 dx=0:dy=0
200 xdraw s at x,10:ox=x:os=s
210 ky=peek(-16384):if ky > 127 then 300
220 x=x+sd
225 gosub 400
230 if x < 10 then x=10
240 if x > 270 then x=270
250 xdraw os at ox,10
260 goto 200
300 poke -16368,0
310 if ky=136 then s=sh:sd=sd-1:goto 399
320 if ky=149 then s=sh+1:sd=sd+1:goto 390
330 if ky=160 and not dx and not dy then dx=x:dy=15:ds=dc:xdraw ds at dx,dy:goto 390
390 if abs(sd) > 3 then sd = sgn(sd)*3
399 xdraw os at ox,10:goto 200
400 if not dx and not dy then return
410 ax=dx:ay=dy:as=ds
420 dy=dy+2:if dy > 160 then dx=0:dy=0
430 ds=ds+1:if ds > dc+3 then ds=dc
430 xdraw as at ax,ay
440 if not dx and not dy then return
450 xdraw ds at dx,dy
460 return
49999 end
50000 $shape src="ships.st", poke=yes, init=yes, assign=(sb="sub-left", sh="ship-left", dc="depthcharge-1")

45
samples/ships.st Normal file
View File

@ -0,0 +1,45 @@
.bitmap sub-left
....xxxx.......
.xxxxxxxxxxx.xx
xxxxxxx*xxxxxxx
.xxxxxxxxxxx.xx
.bitmap sub-right
.......xxxx....
xx.xxxxxxxxxxx.
xxxxxxx*xxxxxxx
xx.xxxxxxxxxxx.
.bitmap ship-left
.....xxxx......
.....xxxx......
xxxxxxx*x..xxxx
.xxxxxxxxxxxxxx
..xxxxxxxxxxxxx
.bitmap ship-right
......xxxx.....
......xxxx.....
xxxx..x*xxxxxxx
xxxxxxxxxxxxxx.
xxxxxxxxxxxxx..
.bitmap depthcharge-1
xxx
x*x
...
.bitmap depthcharge-2
xx.
x*x
.xx
.bitmap depthcharge-3
xx.
x*.
xx.
.bitmap depthcharge-4
.xx
x*x
xx.

BIN
samples/template.po Normal file

Binary file not shown.