2019-03-09 23:49:45 +00:00
|
|
|
( 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 !
|
2019-03-17 16:16:36 +00:00
|
|
|
: textxy ( s x y ) <rot text-color @ text ;
|
|
|
|
: portraity 1 swap textxy ;
|
|
|
|
: statusy 7 swap textxy ;
|
2019-03-09 23:49:45 +00:00
|
|
|
|
|
|
|
var textx
|
|
|
|
var texty
|
|
|
|
2 const textspeed
|
|
|
|
|
2019-03-12 01:57:22 +00:00
|
|
|
: nltext 6 textx ! 10 texty +! ;
|
2019-03-09 23:49:45 +00:00
|
|
|
: inctextx
|
|
|
|
textx @ 1 + dup 38 <= if textx !
|
2019-03-12 01:57:22 +00:00
|
|
|
else drop nltext inctextx then ;
|
2019-03-09 23:49:45 +00:00
|
|
|
|
|
|
|
key \ const '\'
|
|
|
|
: statusc
|
|
|
|
dup dup '\' = swap '\n' = or if drop nltext
|
|
|
|
else dup '\r' = if drop
|
2019-03-12 01:57:22 +00:00
|
|
|
else inctextx textx @ texty @ <rot text-color @ textc then then ;
|
2019-03-09 23:49:45 +00:00
|
|
|
|
|
|
|
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 !
|
2019-03-17 16:16:36 +00:00
|
|
|
s" " dup dup 10 statusy 20 statusy 30 statusy
|
2019-03-09 23:49:45 +00:00
|
|
|
text-color !
|
2019-03-12 01:57:22 +00:00
|
|
|
6 textx !
|
2019-03-09 23:49:45 +00:00
|
|
|
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
|
2019-03-17 16:16:36 +00:00
|
|
|
3 YELLOW character jeanne
|
2019-03-09 23:49:45 +00:00
|
|
|
|
2019-03-17 16:16:36 +00:00
|
|
|
: noone WHITE text-color ! s" " dup dup dup
|
|
|
|
8 portraity 16 portraity 24 portraity 32 portraity ;
|