Post by Carl on Jan 9, 2014 15:00:35 GMT
here is a listing for Crasher you use left and right to move your 'V' to eat the symbols going up the screen, you have a limited time to do it in, you can try to beat your high score too.
I have made use of create for a blank bar to go up the other side of the screen, this keeps the score, time and highscore tidy.
Type 'go' to play/ replay.
( crasher)
0 var seed
: seedon
seed @ 75 u* 75 0
d+ over over u< - -
1 - dup seed ! ;
: rnd
seedon u*
swap drop ;
create bar
11 c, 32 c, 32 c,
32 c, 32 c, 32 c,
32 c, 32 c, 32 c,
32 c, 32 c, 32 c,
32 c, 32 c, 0 c,
0 var hs
0 var ct
0 var loc
0 var chr
0 var time
: ?high
sc @ hs @ > if sc @ hs !
then ;
: pokechr
255 rnd chr ! ;
: pokeloc
10 rnd loc ! ;
: scroll
vram 25 + vram 676 cmove
vram 575 + 25 32 fill ;
: disschr
chr @ vram loc @
500 + + ic! ;
: cdown
time @ 1 - time ! ;
: add
2dup 25 * + vram + ic@
32 - ct ! ;
: move
swap dup inkey dup
8 = swap 9 = 1 and + +
0 max 9 min dup 12 add
at 86 emit swap 11 at 32
emit swap ;
: table
ct @ sc @ + sc !
11 0 at ." **CRASHER!**"
10 1 at bar ".
11 2 at ." Score:" sc@ .
10 3 at bar ".
12 4 at ." High:" hs @ .
10 5 at bar ".
12 6 at ." Time:" time @ .
10 7 at bar ". ;
: go ?high
0 sc ! 0 ct ! 300 time !
cls 23 side
300 0 do
10 23 at bar ".
move pokeloc
pokechr disschr
scroll cdown
table 5 pause
loop ;
( the end)
you can speed up the game by lowering the pause in 'go'
You can change the time by changing #300# 0 do and ## Time !
I have made use of create for a blank bar to go up the other side of the screen, this keeps the score, time and highscore tidy.
Type 'go' to play/ replay.
( crasher)
0 var seed
: seedon
seed @ 75 u* 75 0
d+ over over u< - -
1 - dup seed ! ;
: rnd
seedon u*
swap drop ;
create bar
11 c, 32 c, 32 c,
32 c, 32 c, 32 c,
32 c, 32 c, 32 c,
32 c, 32 c, 32 c,
32 c, 32 c, 0 c,
0 var hs
0 var ct
0 var loc
0 var chr
0 var time
: ?high
sc @ hs @ > if sc @ hs !
then ;
: pokechr
255 rnd chr ! ;
: pokeloc
10 rnd loc ! ;
: scroll
vram 25 + vram 676 cmove
vram 575 + 25 32 fill ;
: disschr
chr @ vram loc @
500 + + ic! ;
: cdown
time @ 1 - time ! ;
: add
2dup 25 * + vram + ic@
32 - ct ! ;
: move
swap dup inkey dup
8 = swap 9 = 1 and + +
0 max 9 min dup 12 add
at 86 emit swap 11 at 32
emit swap ;
: table
ct @ sc @ + sc !
11 0 at ." **CRASHER!**"
10 1 at bar ".
11 2 at ." Score:" sc@ .
10 3 at bar ".
12 4 at ." High:" hs @ .
10 5 at bar ".
12 6 at ." Time:" time @ .
10 7 at bar ". ;
: go ?high
0 sc ! 0 ct ! 300 time !
cls 23 side
300 0 do
10 23 at bar ".
move pokeloc
pokechr disschr
scroll cdown
table 5 pause
loop ;
( the end)
you can speed up the game by lowering the pause in 'go'
You can change the time by changing #300# 0 do and ## Time !