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

fixed broken input handling

parent 1ac535de
......@@ -45,10 +45,10 @@
(draw-string (window s) 0 1 "-- press [Esc] to lose or [Enter] to win --"))
(defmethod handle-input ((s <play-scene>) key)
(when (char= #\Escape key)
(make-instance '<lose-scene> :window (window s)))
(when (char= #\Newline key)
(make-instance '<win-scene> :window (window s))))
(case key
(#\Escape (make-instance '<lose-scene> :window (window s)))
(#\Newline (make-instance '<win-scene> :window (window s)))
(otherwise s)))
(defclass <win-scene> (<scene>) ())
......@@ -58,9 +58,9 @@
(draw-string (window s) 0 1 "-- press [Enter] to restart --"))
(defmethod handle-input ((s <win-scene>) key)
(when (char= #\Newline key)
(make-instance '<start-scene> :window (window s))))
(case key
(#\Newline (make-instance '<start-scene> :window (window s)))
(otherwise s)))
(defclass <lose-scene> (<scene>) ())
......@@ -69,8 +69,9 @@
(draw-string (window s) 0 1 "-- press [Enter] to restart --"))
(defmethod handle-input ((s <lose-scene>) key)
(when (char= #\Newline key)
(make-instance '<start-scene> :window (window s))))
(case key
(#\Newline (make-instance '<start-scene> :window (window s)))
(otherwise s)))
;;;; 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