From d679d61b640ac38589c97aee655e4509a469298d Mon Sep 17 00:00:00 2001 From: logsol Date: Wed, 18 Jul 2012 18:06:35 +0200 Subject: [PATCH] implemented throwing --- joint/common.js | 7 +++++++ joint/index.html | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/joint/common.js b/joint/common.js index 3249ade..c0a0682 100644 --- a/joint/common.js +++ b/joint/common.js @@ -101,4 +101,11 @@ function jump(body) { function drop() { world.DestroyJoint(joint); joint = null; +} + +function throwItem(){ + drop(); + body = item; + body.SetAwake(true); + body.ApplyImpulse(new b2Vec2(-2, -.7), body.GetPosition()); } \ No newline at end of file diff --git a/joint/index.html b/joint/index.html index f96ed1f..d3689fe 100644 --- a/joint/index.html +++ b/joint/index.html @@ -10,8 +10,10 @@
- - - +
+
+
+
+