new state flag system, more story

This commit is contained in:
Jeremy Penner 2019-05-18 15:30:58 -04:00
parent a9dfc15130
commit 459235117d
8 changed files with 67 additions and 12 deletions

BIN
game.exe

Binary file not shown.

BIN
game.prj

Binary file not shown.

View file

@ -14,7 +14,7 @@ car :touch
:noname :noname
0 player.state DRIVING f! 0 player.state DRIVING f!
:| chuck.state @ CHUCK-HOME = if e_chuck yield then :| CHUCK-HOME state@ if e_chuck yield then
player.driving? not if car yield then player.driving? not if car yield then
done |; ' entities redefine done |; ' entities redefine
@ -33,6 +33,7 @@ touch-next 6 21 2= dup
pete say" Nobody home, I guess." pete say" Nobody home, I guess."
jeanne say" Go away before I call the\cops, Pete!" jeanne say" Go away before I call the\cops, Pete!"
pete say" Oh.\I guess she's still mad." pete say" Oh.\I guess she's still mad."
JEANNE-ANGRY setstate
else else
pete say" Jeanne hates me enough already\without driving through her\front door!" pete say" Jeanne hates me enough already\without driving through her\front door!"
then then

View file

@ -446,6 +446,7 @@ void f_comma() {
} }
void f_allot() { void f_allot() {
memset(HERE, 0, TOP().u);
HERE = CELL_OFFSET(HERE, TOP().u); HERE = CELL_OFFSET(HERE, TOP().u);
DROP(1); DROP(1);
} }

View file

@ -9,9 +9,54 @@ table :touch pete say" Yesterday's breakfast is still\on the table."
say" Maybe the day before's too." ;entity say" Maybe the day before's too." ;entity
chair :touch pete say" I've had my morning coffee\already." ;entity chair :touch pete say" I've had my morning coffee\already." ;entity
bed :touch pete say" I'm not tired yet." ;entity bed :touch pete say" I'm not tired yet." ;entity
e_phone :touch phone e_phone :touch phone :|
:| s" [don't pick up]" :| pete say" Hmm... no answer." |; yield
s" Hey Pete, what's up?" :| pete say" Not much, old friend!" |; yield s" [don't pick up]"
:| pete say" Hmm... no answer." |; yield
s" Hey Pete, what's up?"
:| pete say" Not much, old friend!"
0 begin phone :|
JEANNE-ANGRY state@ CHUCK-GONE state@ not and if
s" I hear Jeanne's awful mad\at you!"
:| pete say" Ohh, she'll come round."
phone say" What'd you do, anyway?"
pete say" Me?! What makes you think I\did anything?"
phone say" Come on, Pete, how long\have we known each other?"
pete say" Haw haw haw! Well, it's a\pretty good story..."
say" I was taking Chuck out for a\midnight ride, see..."
phone say" *sigh* You didn't even think\of asking, did you."
pete say" Hell no! He's my horse!"
phone say" Chuck hasn't been your horse\for years, Pete. That's what\happens when you sell them."
pete say" Quit moralizing and let me tell\my story. So there I was,\riding on the trail..."
say" We get to the clearing, and\I look up at the stars."
say" It's the clearest night\you've ever seen in your life."
say" Just as I'm looking up,\I see something."
phone say" 'Something'?"
pete say" I have seen my share of\airplanes and shooting stars.\This was not that."
say" I'm not saying it was aliens..."
phone say" ... but it was aliens."
pete say" I'm not saying it!\You said it."
say" Anyway, I get off Chuck and\lie down on the grass, to\get a better look, see?"
say" Maybe have a pull or two of\whiskey, while I'm watching\the sky."
say" I guess I must've dozed off,\because next thing I know\it's morning and Chuck's gone."
phone say" You LOST him??"
pete say" I figured he just went home!\But when I went to Jeanne's,\he wasn't there."
phone say" You lost him."
pete say" He's a smart old goat,\just like me. He'll\turn up soon."
CHUCK-GONE setstate
|; yield
then
CHUCK-GONE state@ if
s" You found Chuck yet?"
:| pete say" I'm sure he'll turn up soon!\Sheesh, get off my back." |; yield
then
s" Goodbye, Pete." :| pete say" Goodbye!" drop 1 |; yield
done |; choose
dup until drop
|; yield
done |; choose ;entity done |; choose ;entity
:noname :noname

View file

@ -4,7 +4,7 @@
:noname :noname
1 player.state DRIVING f! 1 player.state DRIVING f!
:| chuck.state @ CHUCK-HOME = if chuck yield then :| CHUCK-HOME state@ if chuck yield then
done |; ' entities redefine done |; ' entities redefine
:| :|
touch-begin E leaving? dup touch-begin E leaving? dup

View file

@ -1,12 +1,20 @@
0 const CHUCK-GONE 0 const JEANNE-ANGRY
1 const CHUCK-SEARCH 1 const CHUCK-GONE
2 const CHUCK-FOLLOW 2 const CHUCK-FOLLOW
3 const CHUCK-HOME 3 const CHUCK-HOME
var chuck.state
3 const LAST-STATE
array state LAST-STATE 8 / 1 + allot
: statef ( f -- v f ) dup 8 % 1 swap << swap 8 / state + swap ;
: state! ( b f -- ) statef f! ;
: state@ ( b f -- ) statef f@ ;
: setstate 1 swap state! ;
: clearstate 0 swap state! ;
16 18 W ' {horse} defentity p_chuck 16 18 W ' {horse} defentity p_chuck
:noname :noname
:| player yield :| player yield
chuck.state @ CHUCK-FOLLOW = if p_chuck yield then CHUCK-FOLLOW state@ if p_chuck yield then
done |; ' party redefine done |; ' party redefine
; ' onload redefine ; ' onload redefine

View file

@ -10,7 +10,7 @@ car :touch
:noname :noname
0 player.state DRIVING f! 0 player.state DRIVING f!
:| chuck.state @ CHUCK-SEARCH = if e_chuck yield then :| CHUCK-GONE state@ if e_chuck yield then
player.driving? not if car yield then player.driving? not if car yield then
done |; ' entities redefine done |; ' entities redefine
@ -21,7 +21,7 @@ touch-begin S leaving? dup
else player move-entity 13 7 road.jor queue-level else player move-entity 13 7 road.jor queue-level
then then
then then
chuck.state @ CHUCK-SEARCH = if CHUCK-GONE state@ if
touch-next 37 60 2= dup touch-next 37 60 2= dup
if if
pete say" Oh for the love of..." pete say" Oh for the love of..."