Questions tagged [box2dweb]

Box2dWeb is port of box2dFlash port to javascript.

Box2dWeb is a physics engine and it's basically a port of Box2DFlash library to JavaScript.

95 questions
0
votes
1 answer

Box2D rope, Javascript vs Objective-C

I had a question for the experienced fellers. I'm trying to produce a game where you move an object with a chain hanging below it, I'm using Box2DWeb and EaselJS with HTML5/CSS and I plan on wrapping it with PhoneGap once I get it running properly.…
Josh
  • 23
  • 3
0
votes
1 answer

EaselJS: Can't add event listener to an EaselJS + Box2dWeb example

I'm trying to add an event listener to the example here: http://www.luxanimals.com/blog/article/combining_easel_box2d What I'm trying to do is, I changed the Bitmap to var birdBMP = new createjs.Bitmap("images/bird.png"); birdBMP.x =…
user1767833
  • 129
  • 2
  • 10
0
votes
1 answer

Adding a second fixture as sensor to body in Box2Dweb

I have two problems adding a sensor fixture in the following code. The repositioning vector b2Vec2(0,50) is not working; the second fixture is still centered at the origin of the body. Both fixtures can be seen in debug mode but I can't move the…
user6811
  • 417
  • 1
  • 6
  • 13
0
votes
1 answer

Linear velocity x and y are greater than zero, but still no movement

So I have something going on that's confusing me, involving a body not moving. I used the SetLinearVelocity() member function on a body, like so: dude.body.SetLinearVelocity(new b2Vec2(0.1, 0.1)); I then place a console.log() right before calling…
John L.
  • 1,903
  • 2
  • 13
  • 15
0
votes
2 answers

easelJS - Simulating lower FPS on determined action

Have any way to create the frames repeated like this, above: character = new createjs.SpriteSheet({ images: [img], frames: {width: frameW, height: frameH, regX: frameW/2, regY: frameH/2}, animations: { run: [0,9, "run"], …
scel.pi
  • 703
  • 6
  • 9
0
votes
1 answer

Why are objects not anchoring to prismatic joint(s)

I am creating a bunch of random objects and constraining them to a fixed body (circle) with a prismatic joint. The goal is to have them slide towards that fixed circle. Problem is - objects are falling off the edges of the joints, as they don't seem…
enko
  • 615
  • 6
  • 20
0
votes
1 answer

Struggling to make an object always follow the mouse in box2dweb

I'm trying to learn how to use box2dweb and would like to have an object (a circle in this case) follow the mouse at all times, not just when dragging. The idea being it could be used for an air hockey type game where the circle is your…
pogo
  • 2,287
  • 2
  • 25
  • 36
0
votes
0 answers

ApplyForce in box2dweb.js

I am trying to apply a force to a body I created. But i cant seem to get it right. This is the body I am creating: //create some objects var fixDef2 = new b2FixtureDef; fixDef2.density = 1.0; fixDef2.friction = 0.5; …
Morne
  • 1,623
  • 2
  • 18
  • 33
0
votes
1 answer

How to resolve performance lag while moving objects with Box2D JS physics engine in Android browser?

I am in planning of developing HTML5-Canvas based cross platform game targeting Android and iPhone platforms using Box2D js framework. My game contains some of good physics moves, thus I chose Box2D JS(http://box2d-js.sourceforge.net/). So, I…
Kaushal O
  • 47
  • 2
  • 7
0
votes
1 answer

Change world boundaries with window resize

I'm new to Box2D, and working on a first project using EaselJS along with Box2DWeb. I'm hoping to have the standard static shapes that comprise the walls and floor of the world to move/update along with the browser window when it's resized. I'm…
gomper
  • 1
  • 2
0
votes
0 answers

Box2DWeb Destroy body and fixture

I have created a list of the bodies and fixtures, everything works fine, but cannot delete objects by some reason, here is my code ("id" is the id of the div that is linked to a body and fixture, that info is being holding in the body and fixture…
0
votes
1 answer

Box2DWeb - GetBody() not working

I need to get the body of a fixture but when I call the fixture.GetBody() function, It returns this error: Object # has no method 'GetBody'; here is the code: var bodyDef = new b2BodyDef; var bouncebodyDef = new b2BodyDef; bouncebodyDef.type =…
adam
  • 807
  • 3
  • 11
  • 17
0
votes
1 answer

How to cast parent class to child class in javascript

I am working with box2dweb and i am trying to make a function, that would add instructions how to draw a 'body' based on the 'body' shape. That is: When received a 'b2BodyDef' get the shape, and with external information, get the shape…
susundberg
  • 650
  • 7
  • 14
0
votes
1 answer

Box2dWeb custom shape interaction

I've got a Box2DWeb simulation with a custom shape body but it doesn't interact with other bodies at all. The debug draw shows that the collision is detected but it has no effect. Reading about custom shapes I didn't find anything to set up to…
lelloman
  • 13,883
  • 5
  • 63
  • 85
0
votes
0 answers

Box 2d: gravity and collisions

I'm using box2dweb 2.1a3 and a problem (I want to reproduce Angry Birds): I read a file with level and when box2d body (#1) collides with other thing (#2) I want to destroy first body(#1). But when I will put b2d bony on another b2d body these…