Commit 5b0f5fbd authored by Cory Chamblin's avatar Cory Chamblin

fixed broken input handling

parent 1ac535de
...@@ -45,10 +45,10 @@ ...@@ -45,10 +45,10 @@
(draw-string (window s) 0 1 "-- press [Esc] to lose or [Enter] to win --")) (draw-string (window s) 0 1 "-- press [Esc] to lose or [Enter] to win --"))
(defmethod handle-input ((s <play-scene>) key) (defmethod handle-input ((s <play-scene>) key)
(when (char= #\Escape key) (case key
(make-instance '<lose-scene> :window (window s))) (#\Escape (make-instance '<lose-scene> :window (window s)))
(when (char= #\Newline key) (#\Newline (make-instance '<win-scene> :window (window s)))
(make-instance '<win-scene> :window (window s)))) (otherwise s)))
(defclass <win-scene> (<scene>) ()) (defclass <win-scene> (<scene>) ())
...@@ -58,9 +58,9 @@ ...@@ -58,9 +58,9 @@
(draw-string (window s) 0 1 "-- press [Enter] to restart --")) (draw-string (window s) 0 1 "-- press [Enter] to restart --"))
(defmethod handle-input ((s <win-scene>) key) (defmethod handle-input ((s <win-scene>) key)
(when (char= #\Newline key) (case key
(make-instance '<start-scene> :window (window s)))) (#\Newline (make-instance '<start-scene> :window (window s)))
(otherwise s)))
(defclass <lose-scene> (<scene>) ()) (defclass <lose-scene> (<scene>) ())
...@@ -69,8 +69,9 @@ ...@@ -69,8 +69,9 @@
(draw-string (window s) 0 1 "-- press [Enter] to restart --")) (draw-string (window s) 0 1 "-- press [Enter] to restart --"))
(defmethod handle-input ((s <lose-scene>) key) (defmethod handle-input ((s <lose-scene>) key)
(when (char= #\Newline key) (case key
(make-instance '<start-scene> :window (window s)))) (#\Newline (make-instance '<start-scene> :window (window s)))
(otherwise s)))
;;;; drawing -------------------------------------------------------------------- ;;;; drawing --------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment