Fix tile editor, level warp, chuck mode

This commit is contained in:
Jeremy Penner 2021-02-11 22:38:20 -05:00
parent 6d005950a5
commit 1e062dd281
5 changed files with 20 additions and 6 deletions

Binary file not shown.

View file

@ -62,8 +62,8 @@
(draw-bit-color b px py)
(draw-bit b px py (= (% bitx 2) 1)))
(when (and (active? self :tile) (mouse-inside px py pixel-size pixel-size))
(when (= self.bit nil) (set self.bit (not bit)))
(when (not= self.bit bit)
(when (= self.bit nil) (set self.bit (not b)))
(when (not= self.bit b)
(self:update-tile (set-tile-bit tile ibyte ibit self.bit))))))
(love.graphics.setColor 1 1 1 1)
(values editor-w editor-h))

View file

@ -1,4 +1,4 @@
(local {: vm} (require :game.defs))
(local {: vm : say-runon : say} (require :game.defs))
(fn defcheat [name ...]
(local cheatdata (.. name "-data"))
@ -17,7 +17,20 @@
(defcheat :NTSPISPOPD :noclip :get :not :noclip :set)
(vm.code:append :level-pointers
[:vm :level1 :level2 :level3 :level4 :level5 :level6])
(defcheat :NTXYZZY
(say-runon :term "WARP TO ROOM #?" "(0 TO NOT CHEAT)")
:read-digit :hide-footer (vm:if-and [[:dup 1 :>=] [:dup 7 :<]]
[:dec :dup :+ :lit :level-pointers :+ :get :load-level]
[:drop]))
(defcheat :NTCHUCK :chuck-mode :get :not :chuck-mode :set
:chuck-mode :get (vm:if
[(say :neut "CHUCK MODE ENABLED!" "* W H I N N Y *")]
[(say :neut "CHUCK MODE DISABLED." "BEEP BOOP.")]))
(vm:word :cheat-key ; ascii --
(vm:if-and [[:dup (string.byte "A") :>=] [:dup (string.byte "Z") :<=]]
[:NTSPISPOPD]
[:dup :NTSPISPOPD :dup :NTXYZZY :NTCHUCK]
[:drop]))

View file

@ -137,8 +137,9 @@
[0x00ff (itile :gord-w)]
[:else (itile :gord-e)])]))
(vm:var :chuck-mode vm.false)
(vm:word :two-frame :tick-count :get 0x1f :& 0x10 :<)
(vm:word :neut-tile :two-frame (vm:if [(itile :neut1)] [(itile :neut2)]))
(vm:word :neut-tile :chuck-mode :get (vm:if [(itile :t-chuck)] [:two-frame (vm:if [(itile :neut1)] [(itile :neut2)])]))
(vm:word :libb-tile :two-frame (vm:if [(itile :libb1)] [(itile :libb2)]))
(vm:word :flag-at? ; yx flag -- f

File diff suppressed because one or more lines are too long