diff --git a/game.jim b/game.jim index 9100a5b..846c6cf 100755 Binary files a/game.jim and b/game.jim differ diff --git a/game.jor b/game.jor index b3c38e3..83252cc 100755 --- a/game.jor +++ b/game.jor @@ -94,8 +94,10 @@ defer player-touch ( x y -- b ) : try-move-entity ( e -- ) dup entity-dst check-entity-touch not if move-entity then ; -var queued-level -: queue-level queued-level ! ; +var q-level +var q-player.x +var q-player.y +: queue-level q-level ! q-player.y ! q-player.x ! ; player :tick 0 ^LEFT key-down if drop 1 W player entity.dir ! then @@ -116,9 +118,10 @@ player :tick ' hello-world JOB send then tick-debounce - queued-level @ dup if - 0 queue-level + q-level @ dup if + 0 q-level ! loadlevel + q-player.x @ q-player.y @ tile>world player entity.pos! else drop then ; ' mode-move MODE-MOVE ! diff --git a/gameboot.jor b/gameboot.jor index 8140a93..a10c3d7 100755 --- a/gameboot.jor +++ b/gameboot.jor @@ -22,6 +22,7 @@ s" game.jor" loadfile intern pete.jor intern petehous.jor +intern road.jor :noname loadfile ; checkpoint _loadlevel ' _loadlevel ' loadlevel redefine diff --git a/map.jim b/map.jim index cbb112a..71c915f 100755 Binary files a/map.jim and b/map.jim differ diff --git a/map.jor b/map.jor index e86a0a0..b92e0f5 100755 --- a/map.jor +++ b/map.jor @@ -13,7 +13,7 @@ var tileselect array tileflags ( grass ) WALKABLE b, -( dirt ) WALKABLE b, +( dirt ) WALKABLE DRIVABLE | b, ( water ) 0 b, ( pavement ) WALKABLE DRIVABLE | b, ( brick ) 0 b, @@ -29,6 +29,7 @@ array tileflags ( fridge ) 0 b, ( countertop ) 0 b, ( sink ) 0 b, +( house ) 0 b, here tileflags - 1 - const MAXTILE @@ -47,7 +48,7 @@ here tileflags - 1 - const MAXTILE MOUSEL mousedown if tileselect @ mousetile tile b! invalidate-map then MOUSER clicked if mouseworldpos world>tile - 2dup tile b@ dup tileselect ! . + 2dup tile b@ tileselect ! swap . . cr then ; : copy-mapseg ( neww oldw y -- ) diff --git a/pete.jim b/pete.jim index e0772b5..e2d70ab 100755 Binary files a/pete.jim and b/pete.jim differ diff --git a/pete.jor b/pete.jor index e81e94b..17e92f0 100755 --- a/pete.jor +++ b/pete.jor @@ -12,13 +12,18 @@ car :touch player.driving? not if car yield then 0 |; ' entities redefine - :| touch-begin S leaving? player.driving? not and dup if - pete say" It's too far to walk to town." then - touch-next 12 7 2= dup if - player.driving? not if - petehous.jor queue-level - then then + :| touch-begin S leaving? dup + if player.driving? not + if pete say" It's too far to walk to town." + else 5 10 road.jor queue-level + then + then + touch-next 13 8 2= player.driving? and dup + if 0 player.state DRIVING f! + 12 8 tile>world player entity.pos! + then + touch-next 12 7 2= player.driving? not and dup + if 16 9 petehous.jor queue-level then touch-last |; ' player-touch redefine s" pete.map" load-map ; ' onload redefine - diff --git a/pete.map b/pete.map index 29ec624..cb3160b 100755 Binary files a/pete.map and b/pete.map differ diff --git a/petehous.jim b/petehous.jim index 2b12a94..89ca4a6 100755 Binary files a/petehous.jim and b/petehous.jim differ diff --git a/petehous.jor b/petehous.jor index c9d4880..7a94fc7 100755 --- a/petehous.jor +++ b/petehous.jor @@ -2,11 +2,9 @@ :noname reset-level - 16 9 tile>world player entity.pos! :| touch-begin 16 10 2= dup if - 12 8 tile>world player entity.pos! - pete.jor queue-level + 12 8 pete.jor queue-level then touch-next 9 4 2= dup if pete say" The closet is a disaster.\I don't want to deal with that\right now." then touch-next 11 4 2= dup if diff --git a/road.jim b/road.jim new file mode 100755 index 0000000..0afbdd8 Binary files /dev/null and b/road.jim differ diff --git a/road.jor b/road.jor new file mode 100755 index 0000000..687d93d --- /dev/null +++ b/road.jor @@ -0,0 +1,20 @@ +( O V E R W O R L D ) + +:noname + reset-level + 1 player.state DRIVING f! + + :| +touch-begin E leaving? dup + if pete say" It's 100 miles to the next town." then +touch-next 5 9 2= dup + if 13 12 pete.jor queue-level then +touch-next 13 6 2= dup + if pete say" Old hiking trail." then +touch-next 24 6 2= dup + if mary say" Welcome to my place, Pete!" then +touch-last |; ' player-touch redefine +s" road.map" load-map + +; ' onload redefine + diff --git a/road.map b/road.map new file mode 100755 index 0000000..dd0d26e Binary files /dev/null and b/road.map differ diff --git a/tiles.tif b/tiles.tif index a988833..eb2d365 100755 Binary files a/tiles.tif and b/tiles.tif differ