浏览代码

change for collision chain

rsredsq 10 年之前
父节点
当前提交
e637d85bb5
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      Breakout/Resources/Components/Wall.js

+ 1 - 3
Breakout/Resources/Components/Wall.js

@@ -7,7 +7,7 @@ exports.component = function(self) {
         self.rigidBody = self.node.getComponent("RigidBody2D");
 
         //create a new chain to define a wall
-        var chain = new Atomic.CollisionChain2D();
+        var chain = self.node.createComponent("CollisionChain2D");
         chain.loop = false;
         //set vertex cound to 4
         chain.setVertexCount(4);
@@ -19,7 +19,5 @@ exports.component = function(self) {
         chain.setVertex(1, [-halfWidth, halfHeight]);
         chain.setVertex(2, [halfWidth, halfHeight]);
         chain.setVertex(3, [halfWidth, -halfHeight]);
-        //add a CollisionChain2D component
-        self.node.addComponent(chain, 0, Atomic.LOCAL);
     }
 }