offscreen clipping, start level 5

This commit is contained in:
Jeremy Penner 2020-12-12 11:55:22 -05:00
parent e7a89b9040
commit b25bd7d41a
4 changed files with 22 additions and 3 deletions

View file

@ -91,10 +91,22 @@
[:drop :jaye-yx :get vm.false :transition-gord-sitting 0 :gord-dir :set vm.true]
[:drop vm.false])])]))
(vm:def :yxclip? ; yx -- f
[:block
[:lda vm.TOP :x]
[:cmp mapw]
[:bcs :clipped]
[:lda vm.TOPH :x]
[:cmp maph]
[:bcs :clipped]
[:lda 0] [:sta vm.TOP :x] [:sta vm.TOPH :x] (vm:ret)
:clipped
[:lda 0xff] [:sta vm.TOP :x] [:sta vm.TOPH :x]])
(vm:word :try-move-player ; dir --
:dup :set-player-dir ; dir
:player-yx :get :yx+ ; yxnew
(vm:if-or [[:dup :touch-entity] [:dup :handle-special-move] [:dup :movable-player-flag :flag-at? :not]]
(vm:if-or [[:dup :yxclip?] [:dup :touch-entity] [:dup :handle-special-move] [:dup :movable-player-flag :flag-at? :not]]
[:drop :player-yx :get])
; always "move" so that player can visibly change direction
; touch-entity can modify player-yx so we have to refetch
@ -179,7 +191,7 @@
)
:quit])
(util.reload :game.level4)
(util.reload :game.level5)
(prg:assemble)

6
game/level5.fnl Normal file
View file

@ -0,0 +1,6 @@
(local {: deflevel : say : itile} (require :game.defs))
(local {: ev} (require :game.entity))
(local level (deflevel "game/map5.json"))
(local vm level.vm)
level

1
game/map5.json Normal file
View file

@ -0,0 +1 @@
{"neut":{"y":6,"x":20},"jaye":{"y":5,"x":19},"gord-following":true,"map":"21616161228161616161616161616161616162612102E0C0C0C0C0E0C04361C0C0C0C0C0A3C0C0612161C0C0C0C0C0C0C0C022C0C0C08282C0828261416103C0C0C0C0C0C0C081C0C0C0C0C0C0C0C2C1210203C0C0C0C0C0C04361C0C0C08282838282622161616161816161616161618161616161616161216163C0C0C0C0E0C0C06143C0C0C0C0C0C063612102C0C0C0C0C0C0C0C061C0C0C0C0C0C0C0C0814161C0C0C0C0E2C0E2836101C0C0C0C0C0C0C0C1216143C0C0C082A2A2A281C0C0C043034382E26121610261610261C16102616161026161610261612121212121214121212121212121214121212121","objects":[{"x":17,"func":"rexx","linkword":"","name":"","y":11},{"x":17,"func":"rexx","linkword":"","name":"","y":8},{"x":20,"link":13,"func":"switch","linkword":"","name":"","y":9},{"x":20,"link":16,"func":"switch","linkword":"","name":"","y":4},{"x":12,"link":9,"func":"term","linkword":"","name":"","y":4},{"x":10,"func":"rexx","linkword":"","name":"","y":4},{"x":8,"link":17,"func":"switch","linkword":"","name":"","y":2},{"x":8,"link":10,"func":"term","linkword":"","name":"","y":6},{"x":8,"link":5,"func":"term","linkword":"","name":"","y":11},{"x":3,"link":8,"func":"term","linkword":"","name":"","y":11},{"x":5,"link":12,"func":"scan","linkword":"","name":"","y":12},{"x":6,"func":"door","linkword":"","name":"","y":12},{"x":6,"func":"door","linkword":"","name":"","y":7},{"x":11,"func":"door","linkword":"","name":"","y":9},{"x":11,"link":14,"func":"scan","linkword":"","name":"","y":10},{"x":13,"func":"door","linkword":"","name":"","y":7},{"x":11,"func":"door","linkword":"","name":"","y":3}]}

View file

@ -1,8 +1,8 @@
Game:
* clipping on screen edges
* Neut tileset
* level loading
* Rexx can run over Jaye and vice versa
* drawing queue
tooling ideas:
* REPLy buffer (Polywell?)