Add Rexx, various cleanup

This commit is contained in:
Jeremy Penner 2020-02-17 20:43:11 -05:00
parent 555785db1d
commit 96d2cd0c57
20 changed files with 50 additions and 59 deletions

BIN
end.jim

Binary file not shown.

Binary file not shown.

View file

@ -1,3 +1,4 @@
-1 const EVNOP
0 const EVTICK 0 const EVTICK
1 const EVTOUCH 1 const EVTOUCH
2 const EVUNTOUCH 2 const EVUNTOUCH
@ -79,16 +80,12 @@ var entity-defstate
: frame ( s n e w ) b, b, b, b, ; : frame ( s n e w ) b, b, b, b, ;
array frames array frames
( 0: car ) 3 1 0 2 frame ( 0: gord stand ) 5 7 9 11 frame
( 1: gord stand ) 5 7 9 11 frame ( 1: gord walk ) 6 8 10 12 frame
( 2: gord walk ) 6 8 10 12 frame ( 2: jaye stand ) 30 32 34 36 frame
( 3: mary stand ) 17 20 22 24 frame ( 3: jaye walk ) 31 33 35 37 frame
( 4: mary walk ) 19 21 23 25 frame ( 4: duck ) 44 45 44 45 frame
( 5: car lights ) 29 27 26 28 frame ( 5: rexx stand ) 15 16 17 18 frame
( 6: jeanne stand ) 30 32 34 36 frame
( 7: jeanne walk ) 31 33 35 37 frame
( 8: boat w/ pete ) 42 41 40 39 frame
( 9: duck ) 44 45 44 45 frame
: sprindex ( dir frame ) 2 << frames + + b@ ; : sprindex ( dir frame ) 2 << frames + + b@ ;
: defstatic ( frame -- ) create b, does> b@ sprindex ; : defstatic ( frame -- ) create b, does> b@ sprindex ;
@ -107,26 +104,15 @@ array frames
-1 defsingle {blank} -1 defsingle {blank}
0 defsingle {gord-sit} 0 defsingle {gord-sit}
5 defstatic {car-lit} 0 defstatic {gord-stand}
1 defstatic {gord-stand} 0 1 2 5 defanim {gord-walk}
1 2 2 5 defanim {gord-walk} 2 defstatic {jaye-stand}
13 defsingle {pete-table} 2 3 2 5 defanim {jaye-walk}
14 defsingle {chair} 4 defstatic {duck}
15 defsingle {pete-bed}
16 defsingle {horse}
3 defstatic {mary}
3 4 2 5 defanim {mary-walk}
6 defstatic {jeanne}
6 7 2 5 defanim {jeanne-walk}
18 defsingle {phone}
38 defsingle {fridge}
43 defsingle {boat}
8 defstatic {boat-pete}
9 defstatic {duck}
46 defsingle {aliem}
13 14 2 5 defmulti {neut} 13 14 2 5 defmulti {neut}
5 defstatic {rexx}
: sprite-bob ( x y sprindex -- x y sprindex ) : sprite-bob ( x y sprindex -- x y sprindex )
dup 13 >= over 14 <= and if dup 13 >= over 18 <= and if
>rot 2dup + ticks + 40 % 20 < if 1 + then <rot >rot 2dup + ticks + 40 % 20 < if 1 + then <rot
then ; then ;

Binary file not shown.

BIN
game.jim

Binary file not shown.

View file

@ -37,7 +37,7 @@ var player.prevdir
: {jaye} : {jaye}
isjaye? player.state MOVING f@ and isjaye? player.state MOVING f@ and
if {jeanne-walk} else {jeanne} then ; if {jaye-walk} else {jaye-stand} then ;
: player.canmove? ( x y -- ) : player.canmove? ( x y -- )
player.state NOCLIP f@ not if player.state NOCLIP f@ not if
@ -116,7 +116,7 @@ var q-level
: player-tick : player-tick
^SPACE key-pressed player.state HASNEUT f@ and if ^SPACE key-pressed player.state HASNEUT f@ and if
player.state ISNEUT fnot! player.state ISNEUT fnot!
isneut? if night else day then isneut? if prog-view else human-view then
then then
0 ^LEFT key-down if drop 1 W player entity.dir ! then 0 ^LEFT key-down if drop 1 W player entity.dir ! then
^RIGHT key-down if drop 1 E player entity.dir ! then ^RIGHT key-down if drop 1 E player entity.dir ! then
@ -289,6 +289,7 @@ does> @ objects ! ;
and sets the listener of the entity on the stack to the new func ) and sets the listener of the entity on the stack to the new func )
: chain-listener ( entity xp -- ) swap dup @ , ! ; immediate : chain-listener ( entity xp -- ) swap dup @ , ! ; immediate
: cancel-ev ( ev -- EVNOP ) drop EVNOP ;
:noname :noname
reset-level reset-level

BIN
jiles.jim

Binary file not shown.

View file

@ -37,7 +37,7 @@ array preview 128 allot
0 edittarget = if 0 edittarget = if
s" sprite.gfx" s" sprite.gfx"
else 1 edittarget = if else 1 edittarget = if
NIGHT flag@ if PROG-VIEW flag@ if
s" ntiles.gfx" s" ntiles.gfx"
else else
s" tiles.gfx" s" tiles.gfx"

BIN
job.jim

Binary file not shown.

View file

@ -13,7 +13,7 @@ objects: O
2 6 door d9 2 6 door d9
4 2 door d10 4 2 door d10
end.jor 7 0 exitdoor dx lev00003.jor 7 0 exitdoor dx
' dx 6 0 scanner sx ' dx 6 0 scanner sx
defer c10 ' c10 5 1 computer cx defer c10 ' c10 5 1 computer cx

Binary file not shown.

View file

@ -3,10 +3,18 @@
objects: O objects: O
9 9 door d1 9 9 door d1
7 5 door d2
' d1 7 7 switch b1 ' d1 7 7 switch b1
' unconnected 5 7 computer c1 ' d2 0 3 switch b2
defer c2 ' c2 5 7 computer c1
' c1 8 3 computer _c2 ' _c2 ' c2 redefine
end.jor 0 4 exitdoor dx
' dx 0 5 scanner sx
6 7 N ' {gord-sit} defentity Gord 6 7 N ' {gord-sit} defentity Gord
5 2 S ' {rexx} defentity Rexx
: flicker c1 EVTOG entity>do 15 sleep ; : flicker c1 EVTOG entity>do 15 sleep ;
@ -18,38 +26,39 @@ c1 :noname
flicker flicker flicker flicker flicker flicker flicker flicker
neut say" > HUMAN ASSISTANCE IS\REQUIRED" neut say" > HUMAN ASSISTANCE IS\REQUIRED"
neut say" > IF HUMAN IS PRESENT\PLEASE RESPOND" neut say" > IF HUMAN IS PRESENT\PLEASE RESPOND"
day human-view
flicker flicker flicker flicker flicker flicker flicker flicker
gord say" What the..." gord say" What the..."
gord say" Is someone in the terminal?" gord say" Is someone in the terminal?"
gord say" > HUMAN IS PRESENT" gord say" > HUMAN IS PRESENT"
night prog-view
neut say" > GREETINGS, HUMAN" neut say" > GREETINGS, HUMAN"
neut say" > THIS IS NEUT v0.71.4rc12" neut say" > THIS IS NEUT v0.71.4rc12"
neut say" > PLEASE STATE NAME AND\STATUS" neut say" > PLEASE STATE NAME AND\STATUS"
day human-view
gord say" > THIS IS GORD" gord say" > THIS IS GORD"
gord say" v1, I guess." gord say" v1, I guess."
gord say" > LEG IS PINNED UNDER DESK\UNABLE TO MOVE" gord say" > LEG IS PINNED UNDER DESK\UNABLE TO MOVE"
night prog-view
neut say" > CAN YOU REACH THE SWITCH\BEHIND YOU?" neut say" > CAN YOU REACH THE SWITCH\BEHIND YOU?"
day human-view
gord say" Huh? Oh, there is a\switch there on the wall." gord say" Huh? Oh, there is a\switch there on the wall."
gord say" Never thought about what\it connected to." gord say" Never thought about what\it connected to."
b1 EVACT entity>do 15 sleep 5 sleep b1 EVACT entity>do 15 sleep
gord say" > I TURNED IT ON" gord say" > I TURNED IT ON"
night prog-view
neut say" > MY PROGRAMMER THANKS\YOU, GORD" neut say" > MY PROGRAMMER THANKS\YOU, GORD"
neut say" > WE WILL ASSIST YOU SOON" neut say" > WE WILL ASSIST YOU SOON"
day human-view
gord say" > AWAITING YOUR HELP, NEUT" gord say" > AWAITING YOUR HELP, NEUT"
night prog-view
cancel-ev
then chain-listener ; then chain-listener ;
:noname :noname
reset-level O reset-level O
:| Gord yield done |; ' entities redefine :| Gord yield Rexx yield done |; ' entities redefine
s" lev00003.map" load-map s" lev00003.map" load-map
7 11 tile>world pjaye entity.pos! 7 11 tile>world pjaye entity.pos!

Binary file not shown.

BIN
map.jim

Binary file not shown.

View file

@ -32,6 +32,7 @@ array tileflags
( scanner-off ) NEUTABLE b, ( scanner-off ) NEUTABLE b,
( scanner-on ) NEUTABLE b, ( scanner-on ) NEUTABLE b,
( cracked-wall ) 0 b, ( cracked-wall ) 0 b,
( rexx-pod ) NEUTABLE b,
here tileflags - 1 - const MAXTILE here tileflags - 1 - const MAXTILE

Binary file not shown.

Binary file not shown.

BIN
state.jim

Binary file not shown.

View file

@ -1,12 +1,6 @@
0 const JEANNE-ANGRY userword 0 const PROG-VIEW userword
1 const CHUCK-GONE userword
2 const CHUCK-FOLLOW userword
3 const CHUCK-HOME userword
4 const CHUCK-STOLEN userword
5 const CHUCK-EXPLAINED userword
6 const NIGHT userword
7 const FLAG-COUNT 1 const FLAG-COUNT
array flags FLAG-COUNT 8 / 1 + allot array flags FLAG-COUNT 8 / 1 + allot
@ -16,7 +10,7 @@ array flags FLAG-COUNT 8 / 1 + allot
: setflag 1 swap flagsf! ; userword : setflag 1 swap flagsf! ; userword
: clearflag 0 swap flagsf! ; userword : clearflag 0 swap flagsf! ; userword
: day s" tiles.gfx" loadtiles invalidate-map NIGHT clearflag ; userword : human-view s" tiles.gfx" loadtiles invalidate-map PROG-VIEW clearflag ; userword
: night s" ntiles.gfx" loadtiles invalidate-map NIGHT setflag ; userword : prog-view s" ntiles.gfx" loadtiles invalidate-map PROG-VIEW setflag ; userword

BIN
tiles.gfx

Binary file not shown.