self.layer = display.newLayer()
self.layer:addNodeEventListener(cc.NODE_TOUCH_EVENT, function(event)
self.aStarBox:runAction( CCMoveBy:create(0.3,ccp(0,300)) ) – 这里执行动作 好像执行不了,菜鸟才学,求大神教下,谢谢!!
end)
self.layer:setTouchEnabled(true)
self:addChild(self.layer)
self.aStar = display.newSprite("AStar.png")
self:addChild(self.aStar)
self.world = CCPhysicsWorld:create(0, -500)
self:addChild(self.world)
self.worldDebug = self.world:createDebugNode()
self:addChild(self.worldDebug)
self.aStarBox = self.world:createBoxBody(1, 200, 200)
self.aStarBox:bind(self.aStar)
self.aStarBox:setPosition(100, display.cy + 150)
self.aStarBox:setCollisionType(0)