From: Christoph Senjak Date: Wed, 19 Aug 2009 18:46:13 +0000 (+0200) Subject: Quak. X-Git-Url: http://uxul.de/gitweb/?p=uxul-world.git;a=commitdiff_plain;h=4c1a1495ec36735c08989ffcd46c824f06b2777b Quak. --- diff --git a/on-collision.lisp b/on-collision.lisp index d9e47f7..9f9f329 100755 --- a/on-collision.lisp +++ b/on-collision.lisp @@ -54,6 +54,7 @@ (collide-blocks moving-rectangle standing-rectangle collision) + (setf (bounced moving-rectangle) T) (setf (mayjump moving-rectangle) T) (setf (autojump moving-rectangle) 5) (player-hits-enemy moving-rectangle diff --git a/player.lisp b/player.lisp index 72090d6..bbfb7d1 100755 --- a/player.lisp +++ b/player.lisp @@ -31,6 +31,9 @@ (last-y :initarg :last-pos :accessor last-y :initform nil) + (bounced :initarg :bounced + :accessor bounced + :initform nil) (jump-accel :accessor jump-accel :initform -50) (mayjump :accessor mayjump @@ -156,10 +159,13 @@ (defmethod invoke ((obj player)) "Do whatever a player does ^^" - (if (and - (last-y obj) - (< (last-y obj) (y obj))) - (setf (mayjump obj) nil)) + (cond + ((bounced obj) + (setf (bounced obj) nil)) + ((and + (last-y obj) + (< (last-y obj) (y obj))) + (setf (mayjump obj) nil))) (setf (last-y obj) (y obj))