Tagged Questions
1
vote
0answers
93 views
Why won't my Box2d bodies collide? [closed]
I'm doing something wrong when trying to get bodies to collide using jBox2d & Slick2d. Here is have just my basic init, update, and render methods. Render and update seem to work fine for drawing ...
1
vote
1answer
133 views
Debug Render In Cocos2d Android
I want to implement debug render for cocos2d android.So I can view how bodies are created.
Right now I use gdx.jar file for box2d and load that jar file following way.
static {
...
0
votes
2answers
74 views
Problem with sensor in box2d [closed]
I have two bodies: one green static sensor (spikes) and one orange dynamic body (brick).
I have bullet and it's a dynamic body too, but with bullet flag set.
My problem is that when the bullet is ...
1
vote
2answers
293 views
Non-physics character movement in a Box2d Environment
I am in the process of creating a physics platformer. However, I want the player movement to feel very old-school(as in: non-physics like), which means that the character:
Should always move equally ...
2
votes
1answer
246 views
What's the best way to handle slopes for a platfomer game using Box2D
I would like to know if there is any known solution for handling the player's movement on slopes using Box2D engine.
I tried to do it using a circle as the player. Everything was fine until I tried ...
4
votes
2answers
206 views
Detecting a ledge in Box2D [duplicate]
Possible Duplicate:
Detect Open Space in Farseer
How do I detect ledges?
I'm making a 2D platformer with Box2D. The player needs to be able to grab onto a ledge and pull him/herself up.
...
1
vote
1answer
426 views
How make a laser path prediction line like a “slingshot cowboy” game?
How so I make a laser path prediction line like a “slingshot cowboy” game in cocos2d or box2d and select the target like "slingshot cowboy" game.
1
vote
1answer
1k views
Setting a Box2D Bodies Center?
How do I set the center of a fixture/body consisting of multiple shapes (triangles)?
2
votes
0answers
212 views
how to attach a body to a rope and making it swing to another rope
I've set some ropes (using cocos2d and box2d) and would like to attach a body to one rope in such a way that it can swing to another rope. I am not sure how to go about this. I read making and object ...
1
vote
1answer
445 views
Box2D platformer movement. Should i mess with velocity?
I have a platformer game in which I implemented the movement using a wheel attached to the hero. For jumping I use this:
player.body.applyLinearImpulse(new Vec2(0, 30000000), ...
1
vote
1answer
937 views
Box2D platformer movement. Are joints a good idea?
So i smashed my brains trying to make my character move. As i wanted later in the game to add explosions and bullets it wasn't a good idea to mess with the velocity and the forces/impulses didn't work ...
0
votes
1answer
532 views
JBox2D applyLinearImpulse doesn't work
So i have this line of code:
if(input.isKeyDown(Input.KEY_W)&&canJump())
{
body.applyLinearImpulse(new Vec2(0, 30), cam.screenToWorld(body.getPosition()));
...
1
vote
1answer
147 views
How to pin a body in case of collision in Box2D or Farseer?
I'm trying to get an understanding for the Box2D/Farseer physics engine by implementing a small air hockey simulation.
There, I have the problem that the CPU player attacks the puck, kicks it, but ...
1
vote
1answer
998 views
Making an object swing from one rope to another
I am trying to make a Tarzan like game with Cocos2D and Box2D. I am having issues with the physics - making an object swing from one rope to another. I am not really sure how to do this. Could anyone ...
3
votes
1answer
549 views
How to simulate backspin or topspin in a box2d billiard game?
I am designing a simple billiard game with box2d. I think I can easily simulate hitting left or right side of a ball. Since box2d is not 3D, however, I am not sure how to simulate hitting upper or ...
3
votes
4answers
350 views
When connecting a physics engine to another engine, should you do all your logic in the units used by the physics side or the rendering side
I'm currently intergrating pygame and pyBox2D, and am wondering which side is best to try to keep to in terms of game units of size.
Box2D is Meters
PyGame is Pixels
At the moment I am thinking I ...
0
votes
0answers
217 views
Box2D high-level c++ wrapper
Is there a high level wrapper around Box2D out there?
I know that the library isn't exactly very low level as-is, but in my opinion some things in the library could be made more intuitive at the cost ...
2
votes
2answers
437 views
Physics in carrom like game using cocos2d + Box2D
I am working on carrom like game using cocos2d + Box2D. I set world gravity(0,0), want gravity in z-axis. I set following values for coin and striker body:
Coin body (circle with radius - ...
1
vote
1answer
1k views
How can I cancel a contact in a b2ContactListener?
To know when contacts happen we can derive from b2ContactListener and implement our own solution which is great. I'm wondering is there anyway we can cancel a contact, that is to say when we hit begin ...
1
vote
1answer
666 views
Bodies are colliding but refusing to rotate in Box2D
I'm running box2d in C++ and hooking it up to C# via p/invoke. All physics stuff occurs in C++.
My problem is that bodes know when they are colliding and do so with great precision. However if I have ...
1
vote
2answers
1k views
Box2D Platform body not moving player body along with it
I am creating a game using Box2D (Javascript implementation) - and I added the ability to have a static platform, that is moved along an axis as a function of a sine.
My problem is when the player ...
7
votes
6answers
360 views
Determining player.isFalling() through change of y?
I'm currently using Box2D and my character is a bunch of fixtures in Box2D. I was wondering if, to determine if a player is falling, detecting a change in Y position would be appropriate?
Are there ...
1
vote
1answer
233 views
Mouse joint isn't restricting the ball from going to the other part of the screen
I'm developing a application in cocos2d using the Box2D framework, but unfortunately I am having issues. I'm not able to restrict the orange ball in the half screen area, taking the image below as ...
7
votes
1answer
2k views
Basic Box2D collision detection
I don't understand how to listen for collisions in Cocos2D/Box2D. Say I have two dynamic circle bodies. One is very small and the other is relatively large. When the small circle collides w/ the ...
3
votes
2answers
966 views
When and how should I apply forces in a Cocos2D + Box2D game?
I have some small circles just rolling across the bottom of the screen in my Cocos2D/Box2D iOS app. The bodies are dynamic... so I make them roll by applying a horizontal force to the center of mass ...
3
votes
2answers
750 views
Why are my objects becoming permanently stuck to walls using Box2D?
I setup a simple simulation environment something like billiards. There are four circle balls (dynamic) and four box walls (static).
Simulation works... except one thing. Sometimes when a ball rest ...
4
votes
1answer
195 views
Box2D stable range and position
Box2D marks stable range of object size is 0.1M ~ 10M. This specifies object size range. How about space size? If I make an 1M object at (1000.0f,1000.0f) position? Is it can be stable? Or should I ...
2
votes
2answers
1k views
Using box2d DrawDebugData with multi layer scene?
In my Game, a Scene is composed by several layers. Each layer has different camera transformations.
This way I can have a layer at z=3 (GUI), z=2 (Monsters), z=1 (scrolling background), and this 3 ...
6
votes
1answer
1k views
What causes Box2D revolute joints to separate?
I have created a rag doll using dynamic bodies (rectangles) and simple revolute joints (with lower and upper angles). When my rag doll hits the ground (which is a static body) the bodies seem to ...
7
votes
3answers
930 views
How to implement 2d explosions that will cause damage taking into account covers and distance?
How can I implement a 2D explosion in a way that it will cause less damage to characters that hide behind crates or other cover? Ideally damage will depend on the strength of the cover (e.g. metal ...
5
votes
1answer
427 views
Strangeness when simulating a chain
I'm using box2d and I simply hook up 10 points each with a similar length constraint to the adjacent point.
When I move 1 point, the others follow just like a rope/chain. Just like one would expect.
...
4
votes
2answers
1k views
How to create simple physics for a group of balloons colliding in the screen (2D)
The game is 2D, how can I make simple physics for a group of balloons colliding in the screen.
What I need is the balloons not to overlap and to bounce when they reach the limits of the screen or ...
7
votes
1answer
378 views
How can I copy or back-calculate definitions for an entire b2World?
I'm working on a platformer where I'd like to be able to move or copy bodies between multiple Box2D b2Worlds. The desire has cropped up three times now - moving objects between documents in my editor, ...
7
votes
2answers
1k views
Box 2D Set Origin
I'm trying to set the origin of a box2d shape. By default, a shape rotates around the center. But I'm trying to get it to rotate around the left of the shape. Like a clock for example.
I've heard of ...
4
votes
1answer
696 views
Problem with box2d at beggining
I have problem with simple box2d physics: I have two bodies : 1 - static box , 2 - dynamic box. I only want to this dynamic box fall on this static, and lay. But now it looks like that at end , ...
49
votes
5answers
14k views
Good 2D Platformer Physics
I have a basic character controller set up for a 2D platformer with Box2D, and I'm starting to tweak it to try to make it feel good. Physics engines have a lot of knobs to tweak, and it's not clear to ...
5
votes
2answers
3k views
Using The Box2D Polygon “Set()” function?
I'm using the Box2D physics engine. And there's a type of shape for box2D called b2PolygonShape.
In this class, you can create polygons. There is also a Set() function that takes an array of points ...
5
votes
3answers
3k views
Box2D Check If Point Intersects a Body
Is there a way to check if a point is intersecting a body?
For example, lets say there's a body in the world at a position of (100,100).
Is there a way to check if a point at (100,100) intersects ...
9
votes
1answer
2k views
Box2D Get Bounding Box of a Body
In Box2D, I was curious if it's possible to get a bounding box of a body already created in the world.
So basically, the Body is created, it's interacting with the world and such. And I needed that ...
