Search the Community

Showing results for tags 'box2dweb'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 6 results

  1. Hello, I am having problem rotating box2d object back and forth around a point. To better understand my problem i have prepared an example clicking on key rotate the paddle when u click again the paddle rotate back to its initial position. i want to simulate something like this in box2dWeb. Thanks in advance
  2. Hi! I've created a game called Bokeh, using HTML5 canvas, EaselJS and Box2dWeb. It's available at (also Kongregate, Chrome Web Store and Facebook). The game aims to be meditative and relaxing, and is based on the blurred circles of light you get in an out-of-focus photograph. I also composed the 6 music tracks included in the game (Bandcamp). I'd be very grateful for feedback, but I'd also like your opinion on a particular point: I believe I've taken a risk in developing a game that does not adhere to the typical cute cartoon aesthetic seen in many casual games. Do you think Bokeh's quieter, more cinematic aesthetic has any appeal? There are some screenshots below to give you an idea. Thank you very much in advance! Vince.
  3. Hey guys, I was wondering if any box2D (javascript) users here could help me with this issue I am having. I have some boxes that will float to the top of a block of water. This function works fine //if inside the water this.waterObj.GetBody().SetLinearVelocity(new b2Vec2(0,-2)); I want my water take the boxes like a wave, however when the water block collides with the boxes, the collision handler is NOT called… However if I drop my boxes into the water it works fine (even if the water block is moving) I think this is to do with the collision handler not being called on my blocks if they are stand still, I have set the bodyDef.allowSleep = false; at creation and even reiterated throughout the boxes to check that sleeping is off; but this hasn’t changed anything, I even set the whole world sleep to false. Can anyone help me get the water collision handler to trigger if it hits my stand still (not sleeping) blocks? Cheers!
  4. Hi there, I'm new to Phaser here, previously did some html5 canvas game base on native javascript without any framework or engine. I'm doing a game now on box2dweb, it is running ok in native canvas way, but when i try to port to Phaser, i have some issue. Below are my issue, would appreciate if someone could help or someone would have some example for references: - box2dweb needs canvas context specify into its engine to render, my problem is i couldn't get context from Phaser game object neither do reference it manually as in var context = game.canvas.getContext('2d') - my box2d game is loaded from a box2d editor called R.U.B.E, and loaded into canvas. Due to the coordinate system in box2d and canvas is upside down, i need to do some, context.scale, context.translate, context.restore in order to render proper box2d world into canvas, otherwise it would be upside down, so without reference to context, i couldn't do any of those save and restore. my main problem now is because i loaded the box2d from a json file exported from R.U.B.E editor (which you can find it here, anyone experienced that ?
  5. Hello. I'm working on top-down 8 ball pool game. Box2D world has 0 gravity and when I use ApplyImpulse on ball it won't slow down and never stops. My question is how to apply friction for top down game? You can test it here: Source code: <html> <head> <title>8ball</title> </head> <body onload="init();"> <canvas id="canvas" width="600" height="400" style="background-color:#333333;" ></canvas> </body> <script type="text/javascript" src="Box2dWeb-2.1.a.3.min.js"></script> <script type="text/javascript"> function init() { var b2Vec2 = Box2D.Common.Math.b2Vec2 , b2AABB = Box2D.Collision.b2AABB , b2BodyDef = Box2D.Dynamics.b2BodyDef , b2Body = Box2D.Dynamics.b2Body , b2FixtureDef = Box2D.Dynamics.b2FixtureDef , b2Fixture = Box2D.Dynamics.b2Fixture , b2World = Box2D.Dynamics.b2World , b2MassData = Box2D.Collision.Shapes.b2MassData , b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape , b2CircleShape = Box2D.Collision.Shapes.b2CircleShape , b2DebugDraw = Box2D.Dynamics.b2DebugDraw , b2MouseJointDef = Box2D.Dynamics.Joints.b2MouseJointDef ; var world = new b2World( new b2Vec2(0, 0) //gravity , true //allow sleep ); function borders(){ var borderFix = new b2FixtureDef; borderFix.density = 1.0; borderFix.friction = 0.5; borderFix.restitution = 0.2; borderFix.shape = new b2PolygonShape; borderFix.shape.SetAsBox(20, 2); var borderBody = new b2BodyDef; borderBody.type = b2Body.b2_staticBody; borderBody.position.Set(10, 400 / 30 + 1.8); world.CreateBody(borderBody).CreateFixture(borderFix); borderBody.position.Set(10, -1.8); world.CreateBody(borderBody).CreateFixture(borderFix); borderFix.shape.SetAsBox(2, 14); borderBody.position.Set(-1.8, 13); world.CreateBody(borderBody).CreateFixture(borderFix); borderBody.position.Set(21.8, 13); world.CreateBody(borderBody).CreateFixture(borderFix); } function balls(){ var cue, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15; var ballFix = new b2FixtureDef; ballFix.density = 1.0; ballFix.friction = 0.5; ballFix.restitution = 0.2; var ballBody = new b2BodyDef; ballBody.type = b2Body.b2_dynamicBody; ballFix.shape = new b2CircleShape(0.4); ballBody.position.x = Math.random() * 10; ballBody.position.y = Math.random() * 10; var ball = world.CreateBody(ballBody).CreateFixture(ballFix); ball.GetBody().ApplyImpulse(new b2Vec2(1,0), new b2Vec2(0,0)); } var debugDraw = new b2DebugDraw(); debugDraw.SetSprite(document.getElementById("canvas").getContext("2d")); debugDraw.SetDrawScale(30.0); debugDraw.SetFillAlpha(0.5); debugDraw.SetLineThickness(1.0); debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit); world.SetDebugDraw(debugDraw); window.setInterval(update, 1000 / 60); function update() { world.Step(1 / 60, 10, 10); world.DrawDebugData(); world.ClearForces(); }; borders(); balls(); }; </script> </html>
  6. Box2D physics engine works according to the rules of physics. You have to work a little bit to set it up to work with platforms like HTML5 Canvas, iOS or Flash. Read the details Box2d coordinate system for HTML5 Canvas