start level 3, add Gord

This commit is contained in:
Jeremy Penner 2020-02-16 21:36:02 -05:00
parent bee7922a9f
commit 555785db1d
20 changed files with 72 additions and 19 deletions

Binary file not shown.

View file

@ -80,8 +80,8 @@ 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: car ) 3 1 0 2 frame
( 1: pete stand ) 11 9 7 5 frame ( 1: gord stand ) 5 7 9 11 frame
( 2: pete walk ) 12 10 8 6 frame ( 2: gord walk ) 6 8 10 12 frame
( 3: mary stand ) 17 20 22 24 frame ( 3: mary stand ) 17 20 22 24 frame
( 4: mary walk ) 19 21 23 25 frame ( 4: mary walk ) 19 21 23 25 frame
( 5: car lights ) 29 27 26 28 frame ( 5: car lights ) 29 27 26 28 frame
@ -106,10 +106,10 @@ array frames
does> ( dir a -- ) swap drop lookup-frame ; does> ( dir a -- ) swap drop lookup-frame ;
-1 defsingle {blank} -1 defsingle {blank}
0 defstatic {car} 0 defsingle {gord-sit}
5 defstatic {car-lit} 5 defstatic {car-lit}
1 defstatic {pete-stand} 1 defstatic {gord-stand}
1 2 2 5 defanim {pete-walk} 1 2 2 5 defanim {gord-walk}
13 defsingle {pete-table} 13 defsingle {pete-table}
14 defsingle {chair} 14 defsingle {chair}
15 defsingle {pete-bed} 15 defsingle {pete-bed}

Binary file not shown.

View file

@ -109,6 +109,7 @@ var cchoose
0 LGREEN character neut userword 0 LGREEN character neut userword
3 LBLUE character jaye userword 3 LBLUE character jaye userword
5 CYAN character gord userword
: noone WHITE text-color ! s" " dup dup dup : noone WHITE text-color ! s" " dup dup dup
8 portraity 16 portraity 24 portraity 32 portraity ; userword 8 portraity 16 portraity 24 portraity 32 portraity ; userword

BIN
game.jim

Binary file not shown.

View file

@ -1,7 +1,3 @@
var MODE-MOVE
var MODE-WAIT
( T I C K ) ( T I C K )
defer party defer party
defer entities defer entities
@ -151,9 +147,6 @@ var q-level
party each follow more party each follow more
else drop then ; else drop then ;
' mode-move MODE-MOVE !
' tick-debounce MODE-WAIT !
: draw-entity : draw-entity
>r r@ entity.x @ r@ entity.y @ >r r@ entity.x @ r@ entity.y @
r@ entity.dir @ <r entity>sprite r@ entity.dir @ <r entity>sprite
@ -288,6 +281,8 @@ does> @ objects ! ;
dup SCAN-ON SCAN-OFF handle-onoff dup SCAN-ON SCAN-OFF handle-onoff
SCAN-ON handle-link |; listener! ; SCAN-ON handle-link |; listener! ;
0 const unconnected
( usage: entity :noname [ ev -- ev ] ... chain-listener ; ( usage: entity :noname [ ev -- ev ] ... chain-listener ;
ONLY works with :noname at top-level interpretation time - not :| |; ONLY works with :noname at top-level interpretation time - not :| |;
compiles a reference to the previous listener into the :noname func compiles a reference to the previous listener into the :noname func
@ -297,9 +292,9 @@ does> @ objects ! ;
:noname :noname
reset-level reset-level
MODE-MOVE @ ' tick redefine ' mode-move ' tick redefine
' full-draw ' draw redefine ' full-draw ' draw redefine
:| pjaye yield done |; ' party redefine :| pjaye yield done |; ' party redefine
:| MODE-WAIT @ ' tick redefine |; ' any-job-started redefine :| ' tick-debounce ' tick redefine |; ' any-job-started redefine
:| MODE-MOVE @ ' tick redefine hide-footer |; ' all-jobs-complete redefine :| ' mode-move ' tick redefine hide-footer |; ' all-jobs-complete redefine
; ' onload redefine ; ' onload redefine

View file

@ -1,7 +1,7 @@
: blah ' seremit task-emit ! ; : blah ' seremit task-emit ! ;
blah blah
0 const DEV 1 const DEV
s" game.log" open seekend fdeactivate const LOGFILE s" game.log" open seekend fdeactivate const LOGFILE
: emit-log ' fputc LOGFILE withfp ; : emit-log ' fputc LOGFILE withfp ;
@ -31,10 +31,11 @@ s" game.jor" loadfile
intern lev00001.jor intern lev00001.jor
intern lev00002.jor intern lev00002.jor
intern lev00003.jor
intern end.jor intern end.jor
:noname loadfile ; checkpoint _loadlevel :noname loadfile ; checkpoint _loadlevel
' _loadlevel ' loadlevel redefine ' _loadlevel ' loadlevel redefine
lev00001.jor loadlevel lev00003.jor loadlevel

BIN
jiles.jim

Binary file not shown.

BIN
job.jim

Binary file not shown.

Binary file not shown.

View file

@ -16,7 +16,6 @@ objects: O
end.jor 7 0 exitdoor dx end.jor 7 0 exitdoor dx
' dx 6 0 scanner sx ' dx 6 0 scanner sx
: unconnected :| 0 |; ;
defer c10 ' c10 5 1 computer cx defer c10 ' c10 5 1 computer cx
' cx 5 4 computer _c10 ' _c10 ' c10 redefine ' cx 5 4 computer _c10 ' _c10 ' c10 redefine
defer c8 ' c8 11 4 computer c9 defer c8 ' c8 11 4 computer c9

BIN
lev00003.jim Executable file

Binary file not shown.

58
lev00003.jor Executable file
View file

@ -0,0 +1,58 @@
( L E V 0 0 0 0 3 )
objects: O
9 9 door d1
' d1 7 7 switch b1
' unconnected 5 7 computer c1
6 7 N ' {gord-sit} defentity Gord
: flicker c1 EVTOG entity>do 15 sleep ;
var gord-introduced
c1 :noname
dup EVTOUCH = isneut? and gord-introduced @ not and if
1 gord-introduced !
neut say" HUMAN PRESENCE\DETECTED"
flicker flicker flicker flicker
neut say" > HUMAN ASSISTANCE IS\REQUIRED"
neut say" > IF HUMAN IS PRESENT\PLEASE RESPOND"
day
flicker flicker flicker flicker
gord say" What the..."
gord say" Is someone in the terminal?"
gord say" > HUMAN IS PRESENT"
night
neut say" > GREETINGS, HUMAN"
neut say" > THIS IS NEUT v0.71.4rc12"
neut say" > PLEASE STATE NAME AND\STATUS"
day
gord say" > THIS IS GORD"
gord say" v1, I guess."
gord say" > LEG IS PINNED UNDER DESK\UNABLE TO MOVE"
night
neut say" > CAN YOU REACH THE SWITCH\BEHIND YOU?"
day
gord say" Huh? Oh, there is a\switch there on the wall."
gord say" Never thought about what\it connected to."
b1 EVACT entity>do 15 sleep
gord say" > I TURNED IT ON"
night
neut say" > MY PROGRAMMER THANKS\YOU, GORD"
neut say" > WE WILL ASSIST YOU SOON"
day
gord say" > AWAITING YOUR HELP, NEUT"
night
then chain-listener ;
:noname
reset-level O
:| Gord yield done |; ' entities redefine
s" lev00003.map" load-map
7 11 tile>world pjaye entity.pos!
6 12 tile>world pneut entity.pos!
; ' onload redefine

BIN
lev00003.map Executable file

Binary file not shown.

BIN
map.jim

Binary file not shown.

Binary file not shown.

BIN
space

Binary file not shown.

Binary file not shown.

BIN
state.jim

Binary file not shown.

View file

@ -19,5 +19,4 @@ array flags FLAG-COUNT 8 / 1 + allot
: day s" tiles.gfx" loadtiles invalidate-map NIGHT clearflag ; userword : day s" tiles.gfx" loadtiles invalidate-map NIGHT clearflag ; userword
: night s" ntiles.gfx" loadtiles invalidate-map NIGHT setflag ; userword : night s" ntiles.gfx" loadtiles invalidate-map NIGHT setflag ; userword
: {car-drive} NIGHT flag@ if {car-lit} else {car} then ;