From ab302d9ac8adefaf2bfe630e29c0847b0d372e16 Mon Sep 17 00:00:00 2001 From: Christoph Senjak Date: Mon, 24 Aug 2009 09:07:55 +0200 Subject: [PATCH] Key-Dungeons are now strings. Should work with run-room. --- on-collision.lisp | 3 +-- room.lisp | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/on-collision.lisp b/on-collision.lisp index 8fbaf2a..68e284e 100755 --- a/on-collision.lisp +++ b/on-collision.lisp @@ -28,8 +28,7 @@ ((moving-rectangle player) (standing-rectangle door) (collision collision)) - - (cond ((find (dungeon standing-rectangle) (keys moving-rectangle)) + (cond ((find-if #'(lambda (x) (string= x (dungeon standing-rectangle))) (keys moving-rectangle)) (setf (keys moving-rectangle) (delete (dungeon standing-rectangle) (keys moving-rectangle) :count 1)) (setf (visible standing-rectangle) nil) (setf (active standing-rectangle) nil) diff --git a/room.lisp b/room.lisp index f017379..e51b6d3 100755 --- a/room.lisp +++ b/room.lisp @@ -147,6 +147,16 @@ (add-object (make-instance 'flying-nasobem :x (* 128 x) :y (* 128 y)) room)) + ((eq type 'key) + (add-object (make-instance 'key + :x (* 128 x) + :y (* 128 y) + :dungeon arg1) room)) + ((eq type 'door) + (add-object (make-instance 'door + :x (* 128 x) + :y (* 128 y) + :dungeon arg1) room)) ((eq type 'burning-marshmallow) (add-object (make-instance 'burning-marshmallow :x (* 128 x) -- 2.20.1