Commit 50fda7d2 authored by Tt's avatar Tt

修改box2d的用法

parent f14aad3d
......@@ -41,9 +41,12 @@ export default class NewClass extends cc.Component {
cc.PhysicsManager.POSITION_ITERATIONS = 8;
let item = this.node.getChildByName("item2")
let rigid = item.getComponent(cc.RigidBody)
rigid.applyLinearImpulse(cc.v2(1000, 10000), rigid.getWorldCenter(), true)
setTimeout(() => {
let item = this.node.getChildByName("item2")
let rigid = item.getComponent(cc.RigidBody)
rigid.linearVelocity = cc.v2(-100, 0)
}, 1500);
// rigid.applyLinearImpulse(cc.v2(1000, 10000), rigid.getWorldCenter(), true)
// setTimeout(() => {
// let item = this.node.getChildByName("item2")
......
......@@ -6,7 +6,6 @@
"experimentalDecorators": true,
"skipLibCheck": true,
"outDir": "temp/vscode-dist",
"allowJs": true,
"forceConsistentCasingInFileNames": true
},
"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