mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
some more hardcore network testing
This commit is contained in:
parent
5a3d3d0764
commit
26aa471b14
7 changed files with 123 additions and 31 deletions
|
|
@ -2,7 +2,7 @@ var bodiesNum = 3;
|
|||
var world;
|
||||
|
||||
var xport = 8003;
|
||||
var xhost = '127.0.0.1';
|
||||
var xhost = 'fuuuuu.de';
|
||||
|
||||
var b2Vec2 = Box2D.Common.Math.b2Vec2,
|
||||
b2AABB = Box2D.Collision.b2AABB,
|
||||
|
|
@ -23,7 +23,7 @@ function setupWorld() {
|
|||
var fixDef = new b2FixtureDef;
|
||||
fixDef.density = 1.0;
|
||||
fixDef.friction = 0.5;
|
||||
fixDef.restitution = 0.2;
|
||||
fixDef.restitution = 0.01;
|
||||
|
||||
var bodyDef = new b2BodyDef;
|
||||
|
||||
|
|
@ -56,7 +56,9 @@ function setupWorld() {
|
|||
bodyDef.position.x = (i + 1) * 4;
|
||||
bodyDef.position.y = 3;
|
||||
|
||||
bodyDef.userData = {"bodyId" : parseInt(i) };
|
||||
bodyDef.userData = {
|
||||
'bodyId': i + ''
|
||||
};
|
||||
|
||||
world.CreateBody(bodyDef).CreateFixture(fixDef);
|
||||
}
|
||||
|
|
@ -65,7 +67,7 @@ function setupWorld() {
|
|||
function jump() {
|
||||
var body = findBody(1);
|
||||
body.SetAwake(true);
|
||||
body.ApplyImpulse(new b2Vec2(0, -5), body.GetPosition());
|
||||
body.ApplyImpulse(new b2Vec2(0, -9), body.GetPosition());
|
||||
}
|
||||
|
||||
function findBody(index) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue