~octaspire/crates2

d3d9b5a552ee27e1197a7e77bab298b4f51edd98 — octaspire 10 months ago 0829ad8
Fix few things
4 files changed, 7 insertions(+), 7 deletions(-)

M src/crates.lisp
M src/level.lisp
M src/levels.lisp
M src/main.lisp
M src/crates.lisp => src/crates.lisp +4 -2
@@ 121,9 121,10 @@
(defmethod update ((self vacuum))
  (let ((crate (find-at-of-type (crate-x self) (crate-y self) 0 'moving)))
    (when crate
      (crate-active! crate nil)
      (setf (active crate) nil)
      (when (typep crate 'player)
        (setf (lamented crate) t)
        (request-restart-level)
        (setf (full self) t))))
  (call-next-method))



@@ 208,7 209,8 @@
(defmethod escape ((self moving))
  (setf (active self) nil)
  (when (typep self 'player)
    (setf (lamented self) t)))
    (setf (lamented self) t)
    (request-restart-level)))

(defmethod collide ((self moving) (target crate))
  (setf (velocity self) :zero))

M src/level.lisp => src/level.lisp +1 -4
@@ 19,10 19,7 @@
(defmethod update ((self list))
  (let ((level (get-current-level)))
    (when (runningp) (loop for crate in level
                           do (update crate)
                              (when (and (typep crate 'player)
                                         (lamented crate))
                                (request-restart-level))))))
                           do (update crate)))))

(defmethod render ((self list))
  (when (runningp)

M src/levels.lisp => src/levels.lisp +1 -1
@@ 27,5 27,5 @@

(defun load-level-1 ()
  (list (make-instance 'exit     :x 1 :y 2 :z 0)
        (make-instance 'vacuum   :x 3 :y 2 :z 0)
        (make-instance 'vacuum   :x 3 :y 2 :z -1)
        (make-instance 'player   :x 5 :y 2 :z 0)))

M src/main.lisp => src/main.lisp +1 -0
@@ 112,6 112,7 @@
  (setf *next-level* (+ *level-number* 1)))

(defun request-restart-level ()
  (format t "RESTART~%")
  (setf *next-level* *level-number*))

(defun request-previous-level ()