Category Archives: Box2d

Revolute Joint Revolute joint is a useful joint in box2d that allows 2 bodies to be pinned together at a point without restricting rotation. The joint can be made between 2 dynamic bodies or between a static and dynamic body. The pendulum on left is a static circle joined to dynamic rectangle. Whereas the cart… Read More »

Weld joint in box2d The weld joint can be used to join to bodies tightly at a common point. Here is an example A weld joint is created like this The joint definition needs to know the bodies to connect and the coordinates on each of them where the weld is to be done. It… Read More »

Rope In this experiment we shall make a rope like thing in box2d. There is no rope like structure that box2d supports directly. But if multiple small units are connected together at their edges using a revolutejoint, then it was act somewhat like a rope. You can move any part of the rope using your… Read More »

Distance In the previous post on mouse joints we learned how to interact with box2d objects using the mouse. Now its time to take a look at another joint in box2d, the distance joint. Distance joint connects 2 bodies maintaining a fixed distance between them, its like metal wire connecting the 2 bodies, such that… Read More »

Mouse Joint Out of the many joints that box2d has, one is mouse joint. It is not used in physics simulations, but helps to make the physics world interactive by making a body move towards a specific point, like the mouse coordinates for example. So objects can be picked up, dragged etc by the user…. Read More »

Demo First lets play the game that we shall be making in this tutorial. Its called Fruit Hunter. Tested on Chrome and Firefox. Click in the game then start using the arrow keys to control the monkey. Press the left, right and up arrow keys to make the monkey move and jump. Do not fall… Read More »

Box2d Box2d is a 2d physics simulation library written for C++ and ported to many languages including Javascript. From Box2d’s Website Box2D is a feature rich 2D rigid body physics engine, written in C++ by Erin Catto. It has been used in many games, including Crayon Physics Deluxe, winner of the 2008 Independant Game Festival… Read More »

Racing car in box2d Box2d is a physics 2d simulation library and is used in game development. Apart from C/C++ it has ports for various languages like python, javascript etc. With the availability of the html5 canvas element and many other html5 apis, it becomes possible to write browser based games in javascript. So in… Read More »

Search

Search for:

Connect with us

This site, binarytides.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com.