81 lines
1.7 KiB
Plaintext
Executable file
81 lines
1.7 KiB
Plaintext
Executable file
( F O O T E R )
|
|
var footer-y
|
|
0 footer-y !
|
|
|
|
: draw-footer footer-y @ split-screen ;
|
|
|
|
0 const BLACK
|
|
1 const BLUE
|
|
2 const GREEN
|
|
3 const CYAN
|
|
4 const RED
|
|
5 const MAGENTA
|
|
6 const BROWN
|
|
7 const LGRAY
|
|
8 const DGRAY
|
|
9 const LBLUE
|
|
10 const LGREEN
|
|
11 const LCYAN
|
|
12 const PINK
|
|
13 const LMAGENTA
|
|
14 const YELLOW
|
|
15 const WHITE
|
|
|
|
var text-color
|
|
WHITE text-color !
|
|
: textxy ( s x y ) <rot text-color @ text ;
|
|
: portraity 1 swap textxy ;
|
|
: statusy 7 swap textxy ;
|
|
|
|
var textx
|
|
var texty
|
|
2 const textspeed
|
|
|
|
: nltext 6 textx ! 10 texty +! ;
|
|
: inctextx
|
|
textx @ 1 + dup 38 <= if textx !
|
|
else drop nltext inctextx then ;
|
|
|
|
key \ const '\'
|
|
: statusc
|
|
dup dup '\' = swap '\n' = or if drop nltext
|
|
else dup '\r' = if drop
|
|
else inctextx textx @ texty @ <rot text-color @ textc then then ;
|
|
|
|
var texttimer
|
|
: textnextc ( s -- s )
|
|
dup b@ dup if statusc 1 + else drop then ;
|
|
|
|
: slowtext ( s -- )
|
|
texttimer now!
|
|
begin dup b@ while
|
|
texttimer advance! textspeed * 0 for textnextc next
|
|
suspend repeat drop ;
|
|
|
|
: clear
|
|
text-color @
|
|
WHITE text-color !
|
|
s" " dup dup 10 statusy 20 statusy 30 statusy
|
|
text-color !
|
|
6 textx !
|
|
10 texty ! ;
|
|
|
|
: show-footer 48 10 footer-y move-to ;
|
|
: hide-footer 0 10 footer-y move-to ;
|
|
|
|
: footer-wait show-footer ^ENTER wait-key ;
|
|
|
|
: say ( s -- ) clear show-footer slowtext footer-wait ;
|
|
: say" [ ' s" , ] ' say expile ; immediate
|
|
|
|
: character ( iportrait color ) create , ,
|
|
does> dup @ text-color ! cell + @ draw-portrait ;
|
|
|
|
0 GREEN character pete
|
|
1 MAGENTA character mary
|
|
2 BROWN character chuck
|
|
3 YELLOW character jeanne
|
|
|
|
: noone WHITE text-color ! s" " dup dup dup
|
|
8 portraity 16 portraity 24 portraity 32 portraity ;
|