Commit 50fda7d2 authored by Tt's avatar Tt

修改box2d的用法

parent f14aad3d
...@@ -41,9 +41,12 @@ export default class NewClass extends cc.Component { ...@@ -41,9 +41,12 @@ export default class NewClass extends cc.Component {
cc.PhysicsManager.POSITION_ITERATIONS = 8; cc.PhysicsManager.POSITION_ITERATIONS = 8;
setTimeout(() => {
let item = this.node.getChildByName("item2") let item = this.node.getChildByName("item2")
let rigid = item.getComponent(cc.RigidBody) let rigid = item.getComponent(cc.RigidBody)
rigid.applyLinearImpulse(cc.v2(1000, 10000), rigid.getWorldCenter(), true) rigid.linearVelocity = cc.v2(-100, 0)
}, 1500);
// rigid.applyLinearImpulse(cc.v2(1000, 10000), rigid.getWorldCenter(), true)
// setTimeout(() => { // setTimeout(() => {
// let item = this.node.getChildByName("item2") // let item = this.node.getChildByName("item2")
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"skipLibCheck": true, "skipLibCheck": true,
"outDir": "temp/vscode-dist", "outDir": "temp/vscode-dist",
"allowJs": true,
"forceConsistentCasingInFileNames": true "forceConsistentCasingInFileNames": true
}, },
"exclude": [ "exclude": [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment