From a9dfc151301b6d3d31404cff72ed193146567181 Mon Sep 17 00:00:00 2001 From: Jeremy Penner Date: Thu, 16 May 2019 22:25:13 -0400 Subject: [PATCH] add user choice of dialogue selection --- entity.jor | 2 ++ footer.jor | 46 +++++++++++++++++++++++++++++++++++++++++----- game.prj | Bin 5633 -> 5815 bytes petehous.jor | 7 ++++++- portrait.tif | Bin 7955 -> 7955 bytes sprite.tif | Bin 4078 -> 4078 bytes 6 files changed, 49 insertions(+), 6 deletions(-) diff --git a/entity.jor b/entity.jor index 1a2bd7d..801536d 100755 --- a/entity.jor +++ b/entity.jor @@ -58,3 +58,5 @@ array frames 14 defsingle {chair} 15 defsingle {pete-bed} 16 defsingle {horse} +17 defsingle {mary} +18 defsingle {phone} diff --git a/footer.jor b/footer.jor index 688609f..9a7313d 100755 --- a/footer.jor +++ b/footer.jor @@ -25,13 +25,16 @@ var text-color WHITE text-color ! : textxy ( s x y ) rot drop drop else drop break then more ; + +: canchooseleft ichoose @ 0 > ; +: canchooseright ichoose @ cchoose @ 1 - < ; + +: displaychoice + clear + canchooseleft if s" <" 6 20 textxy then + canchooseright if s" >" 38 20 textxy then + getchoice drop slowtext ; + +: navchoice ( -- done ) + 0 begin suspend + ^LEFT key-pressed canchooseleft and if drop 1 -1 ichoose +! then + ^RIGHT key-pressed canchooseright and if drop 1 1 ichoose +! then + ^ENTER key-pressed if drop 2 then + dup until 1 - ; + +: choose ( gen -- ) + ' choosegen redefine countchoosegen 0 ichoose ! + textleftchoice clear show-footer + begin displaychoice navchoice until + getchoice swap drop execute ; + : character ( iportrait color ) create , , does> dup @ text-color ! cell + @ draw-portrait ; @@ -75,6 +110,7 @@ var texttimer 1 MAGENTA character mary 2 BROWN character chuck 3 YELLOW character jeanne +4 LGRAY character phone : noone WHITE text-color ! s" " dup dup dup 8 portraity 16 portraity 24 portraity 32 portraity ; diff --git a/game.prj b/game.prj index f55542b7eecaad27e6007d79e19a8e53e75db662..0020605095303246ef5a44b81e820930eea1ee8c 100755 GIT binary patch delta 329 zcmZqF*{-`GK!8zabD)4TWBnl(eFg@G0G1}^Wh^sUteC4=Vp#tFmu7Kiu48mz(PY`o z{QrMH^DJg_mQv=W%(s{`n3-AbFz~Z5F+FGIXVPY}U^>fufZ3JlCBr$!r%Z`VVvMy+ zlFS>K*clTTW-)pJNd^WH25pAil}r8D85B5T#5lkt3z$@{2UDyJ7nel(2{MSSZt|03 zkXd5k$HdT(Gu4lu;Y;aMKQ4yPv!?hdGV~SJ`-w3GEm`3w$}j~eE5hJdQtv0pP#!ha z@Be=f1qFs;1~X}{Qr;U1AR!^3&B6actY9Bc7gs$GhW{Yz_4HzZD8xC&)6dx_RMN#Y z#?i;e-x(wga$|^VaEOzui=Ol3uYy@DAPt+7g^n_US(9}{WLa33Z}8jfE3$AkEPL tr2nUZ!Q_MN;*&41b3ic*FHq&SSL4dHE