Moving solids without physic-enabled are in COLGROUP_STATIC now.
authorWolfgang Becker <uafr@gmx.de>
Wed, 2 Aug 2006 22:23:11 +0000 (22:23 +0000)
committerWolfgang Becker <uafr@gmx.de>
Wed, 2 Aug 2006 22:23:11 +0000 (22:23 +0000)
SVN-Revision: 4113

data/levels/test/scriptdoor.stl
src/object/scripted_object.cpp

index b4c517f..7f5efa4 100644 (file)
@@ -37,6 +37,26 @@ door3.set_solid( false );")
       (sprite "images/objects/bonus_block/brick.sprite")
     )
     (scriptedobject
+      (name "foo")
+      (z-pos 0)
+      (visible #t)
+      (physic-enabled #t)
+      (solid #t)
+      (x 640)
+      (y 320)
+      (sprite "images/objects/bonus_block/brick.sprite")
+    )
+    (scriptedobject
+      (name "door2")
+      (z-pos 0)
+      (visible #t)
+      (physic-enabled #f)
+      (solid #t)
+      (x 320)
+      (y 256)
+      (sprite "images/objects/bonus_block/brick.sprite")
+    )
+    (scriptedobject
       (name "door1")
       (z-pos 0)
       (visible #t)
@@ -47,13 +67,23 @@ door3.set_solid( false );")
       (sprite "images/objects/bonus_block/brick.sprite")
     )
     (scriptedobject
-      (name "door2")
+      (name "foo")
       (z-pos 0)
       (visible #t)
       (physic-enabled #f)
       (solid #t)
-      (x 320)
-      (y 256)
+      (x 608)
+      (y 352)
+      (sprite "images/objects/bonus_block/brick.sprite")
+    )
+    (scriptedobject
+      (name "foo")
+      (z-pos 0)
+      (visible #t)
+      (physic-enabled #f)
+      (solid #t)
+      (x 544)
+      (y 352)
       (sprite "images/objects/bonus_block/brick.sprite")
     )
     (tilemap
index ee6000b..65dffb4 100644 (file)
@@ -48,7 +48,11 @@ ScriptedObject::ScriptedObject(const lisp::Lisp& lisp)
   lisp.get("visible", visible);
   lisp.get("z-pos", layer);
   if( solid ){
-    set_group( COLGROUP_MOVING );
+    if( physic_enabled ){
+      set_group( COLGROUP_MOVING );
+    } else {
+      set_group( COLGROUP_STATIC );
+    }
   } else {
     set_group( COLGROUP_DISABLED );
   }
@@ -130,7 +134,11 @@ ScriptedObject::set_solid(bool solid)
 {
   this->solid = solid;
   if( solid ){
-    set_group( COLGROUP_MOVING );
+    if( physic_enabled ){
+      set_group( COLGROUP_MOVING );
+    } else {
+      set_group( COLGROUP_STATIC );
+    }
   } else {
     set_group( COLGROUP_DISABLED );
   }