Commit b9787a33 authored by Cory Chamblin's avatar Cory Chamblin

remove brackets from class names

parent 7fa07570
......@@ -10,62 +10,61 @@
;;;; scenes ---------------------------------------------------------------------
(defclass <scene> () ())
(defclass scene () ())
(defgeneric display-scene (scene window))
(defgeneric handle-input (scene key))
(defclass <start-scene> (<scene>) ())
(defclass start-scene (scene) ())
(defmethod display-scene ((s <start-scene>) window)
(defmethod display-scene ((s start-scene) window)
(draw-string window 0 2 " CORYS ROGUELIKE")
(draw-string window 0 4 " Press [Space] to start")
(draw-string window 0 5 " Press [Q] to quit"))
(defmethod handle-input ((s <start-scene>) key)
(defmethod handle-input ((s start-scene) key)
(case key
(#\Space (make-instance '<play-scene>))
(#\Space (make-instance 'play-scene))
(#\Q (progn
(setf *running* nil)
s))
(otherwise s)))
(defclass play-scene (scene) ())
(defclass <play-scene> (<scene>) ())
(defmethod display-scene ((s <play-scene>) window)
(defmethod display-scene ((s play-scene) window)
(draw-string window 0 0 " You are having fun.")
(draw-string window 0 1 "-- press [Esc] to lose or [Enter] to win --"))
(defmethod handle-input ((s <play-scene>) key)
(defmethod handle-input ((s play-scene) key)
(case key
(#\Escape (make-instance '<lose-scene>))
(#\Newline (make-instance '<win-scene>))
(#\Escape (make-instance 'lose-scene))
(#\Newline (make-instance 'win-scene))
(otherwise s)))
(defclass <win-scene> (<scene>) ())
(defclass win-scene (scene) ())
(defmethod display-scene ((s <win-scene>) window)
(defmethod display-scene ((s win-scene) window)
(draw-string window 0 0 " !! YOU WIN !!")
(draw-string window 0 1 "-- press [Enter] to restart --"))
(defmethod handle-input ((s <win-scene>) key)
(defmethod handle-input ((s win-scene) key)
(case key
(#\Newline (make-instance '<start-scene>))
(#\Newline (make-instance 'start-scene))
(otherwise s)))
(defclass <lose-scene> (<scene>) ())
(defclass lose-scene (scene) ())
(defmethod display-scene ((s <lose-scene>) window)
(defmethod display-scene ((s lose-scene) window)
(draw-string window 0 0 " You lose.")
(draw-string window 0 1 "-- press [Enter] to restart --"))
(defmethod handle-input ((s <lose-scene>) key)
(defmethod handle-input ((s lose-scene) key)
(case key
(#\Newline (make-instance '<start-scene>))
(#\Newline (make-instance 'start-scene))
(otherwise s)))
......@@ -81,7 +80,7 @@
(defun initialize ()
(setf *running* t)
(make-instance '<start-scene>))
(make-instance 'start-scene))
(defun gameloop ()
(let* ((window charms:*standard-window*)
......
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