Post by Carl on Mar 13, 2013 18:33:36 GMT
You use the Up down left and right keys to move your block (man) around the screen, every move adds 1 to your score, but if you hit a solid brick its game over!
I have not made a udg or added sound to this one so it will work for any fig and the program is a short one, I will add some hex files soon but for now here are the .fth files and the listing.
typing 'go' will start the game.
You have to press a key to display your 'man' at the outset.
I hope you all like it, please post any errors or any other feedback as ever.
Carl.
I have not made a udg or added sound to this one so it will work for any fig and the program is a short one, I will add some hex files soon but for now here are the .fth files and the listing.
( FIGsurround Carl Attrill 2012)
0 var man
0 var noman
0 var seed
0 var sc
0 var ca
: char 27 vram man @ + ic!
32 vram noman @ + ic! ;
: seedon seed @ 75 u* 75 0 d+ over over u< - - 1 - dup seed ! ;
: blob 160 vram ca @ + ic! ;
: set cls
22 1 do 1 i at 160 emit 23 i at 160 emit loop
24 1 do i 1 at 160 emit i 22 at 160 emit loop ;
: fin cls 5 10 at ." Score:" sc @ . quit ;
: dman vram man @ + ic@ 160 = if fin then ;
: dokey begin inkey dup 0 + if drop 0 else 1
then until
dup 8 = if man @ 1- man ! then
dup 11 = if man @ 25 - man ! then
dup 10 = if man @ 25 + man ! then
9 = if man @ 1 + man ! then
dman char man @ noman ! ;
: score sc @ 1 + sc ! 0 0 at sc @ . ;
: obs 4 rnd dup dup dup
0 = if vram man @ 1 + ca ! blob then
1 = if vram man @ 25 - ca ! blob then
2 = if vram man @ 24 + ca ! blob then
3 = if vram man @ 1 - ca ! blob then ;
: go 285 man ! 0 sc ! set begin dokey obs score
99 = until ;
typing 'go' will start the game.
You have to press a key to display your 'man' at the outset.
I hope you all like it, please post any errors or any other feedback as ever.
Carl.