Box2D is an open-source rigid-body 2D physics simulation library for games, written in C++.
-2
votes
1answer
235 views
How to fly enemies like galaxian game enemies?
I am developing game like galaxian and using cocos2d with box2d .I don't have idea how to create enemies like galaxian game enemies and how do they fly over the screen.
...
4
votes
2answers
215 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.
...
2
votes
3answers
373 views
Rotate Body From Corner
I want to ask that how to rotate body from corner?
movableBeam.getBeamBody().setTransform(movableBeam.getBeamBody().getPosition(), angle);
The above line of code rotate the beam from center that I ...
1
vote
0answers
249 views
Box2D Bicycle Wheels Motor Problem - Flash 2.1a
I have made a bicycle with Box2D using several polygons for the frame at different angles connected using weld joints, and I have revolute joints on the wheels with a motor.
I have made some basic ...
2
votes
1answer
368 views
RagDoll in AndEngine
I want to create a RagDoll body in andEngine which can run and jump over different jumpObjects. Can any one give a nice tutorial on how to create RagDoll body and how to move it, like jump and ...
3
votes
3answers
243 views
Semi Fixed-timestep ported to javascript
In Gaffer's "Fix Your Timestep!" article, the author explains how to free your physics' loop from the paint one.
Here is the final code, written in C:
double t = 0.0;
const double dt = 0.01;
double ...
2
votes
1answer
275 views
Implementing a wheeled character controller
I'm trying to implement Boxycraft's character controller in XNA (with Farseer), as Bryan Dysmas did (minus the jumping part, yet).
My current implementation seems to sometimes glitch in between two ...
0
votes
1answer
160 views
box2d tween what am I missing
I have a Box2D project and I want to tween an kinematic body from position A, to position B. The tween function, got it from this blog:
function easeInOut(t , b, c, d ){
if ( ( t /= d / 2 ) < ...
0
votes
1answer
227 views
GetContactList stops reporting collisions on welded bodies
I have some strange problem with my game which uses Box2D as physics engine and I'm out of ideas on what I can do to solve it.
My game is a class assignment where I need to build a simple game where ...
1
vote
0answers
228 views
changing body type without change of center of mass
I have an box2d project with some bodies in it, which move around without any user interaction. But if the user selects one of the bodies, he should be able to move it around just like he wants to.
...
0
votes
2answers
374 views
How to move Objects smoothly like swimming arround
I have a Box2D project that is about to create a view where the user looks from the Sky onto Water. Or perhaps on a bathtub filled with water or something like this. The Object which holds the fluid ...
2
votes
1answer
417 views
Pathfinding and BSP with Box2D
I'm looking into implementing AI in my 2D side-scrolling platformer, and I'm looking into using algorithms such as A*. For many kinds of pathfinding, we need some sort of grid or systems of nodes or ...
2
votes
1answer
718 views
Andengine. Put bullet to pool, when it leaves screen
i'm creating a bullet with physics body. Bullet class (extends Sprite class) has die() method, which unregister physics connector, hide sprite and put it in pool
public void die() {
...
0
votes
1answer
132 views
Box2d — get free space
I am developing a little Game with something like particles, where every particle is represented by a box2d Body.
To insert new particles I need to find a place in the b2World where no bodies reside. ...
4
votes
1answer
815 views
making a box2d body move along a Bezier curve/ arc path
I have been trying to make a box2d body move along a Bezier curve/ arc path. Most of the posts I've seen recommend an approach of manipulating SetLinearVelocity and SetTransform to arrive at an ...
1
vote
2answers
893 views
Can i add friction in air?
I have issue regarding speed in air. When i jump and move simultaneously that time speed of player increase.For jump i am using impuls and for movement i am using force.I want to slow speed when ...
1
vote
2answers
326 views
strange behavior in Box2D+LibGDX when applying impulse
I have been playing around with Box2D and LibGDX and have been using a sample code from DecisionTreeGames as the testing ground. Now I have a screen with four walls and a rectangle shape, lets call it ...
5
votes
1answer
463 views
Farseer Physics: Ways to create a Body?
I want to create something similar to this using farsser and Kinect:
https://vimeo.com/33500649
This is my implementation until now:
http://www.youtube.com/watch?v=GlIvJRhco4U
I have the outline ...
0
votes
1answer
131 views
Creating multiple fixtures in one body
I want to create this type of fixture in one body. Here square and circle both are different fixtures but attach to one body. How do I do this?
0
votes
0answers
118 views
Box2dWeb - Current Vertices of a Polygon? [closed]
I'm trying to develop a game where I need to find the current vertices of a Polygon. When I try to get vertices using this method -- fixture.GetShape().GetVertices(), I get the original vertices and ...
1
vote
2answers
180 views
Confusing box2d forces
Hello Friends.
This is my demo game screen-shoot. Here i am using three buttons. Right-bottom button is used for jump and left-bottom buttons used for move left and right.
I have some questions
1) ...
1
vote
0answers
594 views
How to properly add texture to multi-fixture/shape b2Body
Hello to everyone this is my first poste here I hope that will be not fail start.
At start I must say I make part 1 in Ray's Tutorial "How To Make A Game Like Fruit Ninja With Box2D and Cocos2D". But ...
1
vote
1answer
99 views
Sprite Body can not stop
Hey i have issue regarding jump sprite body. In my code i am using moveLeft and moveRight Button and when i am press moveRight Button using following code
if (moveRight.active==YES)
{
...
0
votes
1answer
255 views
moving box2d bodies in an arc or curved path
How can I make a b2Body move in a arc-like or curved path? I have heard about cocos2d Bezier curve function (ccBezier) but this is for moving cocos2d sprites. Or can it be modified to move box2d ...
0
votes
1answer
321 views
EXC_BAD_ACCESS error when box2d joint is destroyed
When I destroy the weldJoint in the update method (see below) I get an EXC_BAD_ACCESS error pointing to the line
world->DestroyJoint(weldJoint);
in the update method below:
-(void) update: ...
0
votes
0answers
106 views
How to create move button for movement of box2d body continous
I have some problem regarding movement of box2d sprite body.Problem is when i press left button than my sprite move left and when i release button my sprite will stop.
I know the logic of movement ...
0
votes
0answers
57 views
limiting a sprites movement after a mouseJoint is released
I have created a weldJoint between two sprites and I also created a method (spritePositionRelease) that returns the exact position of a sprite when a mouseJoint is released. I want to track the ...
0
votes
2answers
339 views
How to move a b2Body explosively to a new Location
I am building an Game based on Box2d with the following basic structure:
The Box2d World itself does not have any Gravity and is filled with some bodies (sheres and simple polygons) of more or less ...
1
vote
1answer
679 views
AndEngine Physics: Shape rotating but not updating physics effects
I was looking at PhysicsExample from AndEngine's Examples. I made the following change that I added a vertical line shape and created a fixture for it. Then I registered a rotation modifier for that ...
0
votes
0answers
132 views
Farseer non-colliding bodies affect eachother
I'm trying to use Farseer to make a tile engine, but bodies that are not colliding with a sprite are still having an effect on it.
In this image there is a single sprite(the green box) and a single ...
1
vote
1answer
231 views
Cocos2d: Using single timer/scheduler for multiple sprites
want to know if is it possible to use single timer or scheduler method for multiple sprites ? Like I am now working on a game and there could be any number of sprites and i want to perform some ...
3
votes
1answer
214 views
What algorithms exist for generating collision geometry from an image?
I am currently working on a game using SFML and Box2D. I am interested in generating collision geometry from the sprite data that I load into SFML. So, for example, an algorithm that would do this ...
2
votes
0answers
258 views
Box2d based tile map game scrolling problem
I am using a tile based game and also used a joystick. Using joystick sprite body move perfectly but tile map can not scroll.
-(void)setCenterOfScreen:(b2Vec2)position
{
int ...
0
votes
0answers
99 views
Using same b2World in different classes/Layers
How can we use same b2world in different classes in our game.. ? I am having two classes gameLayer and weaponLayer respectively. I am trying to use the b2world I am using in gameLayer in weaponLayer ? ...
0
votes
1answer
118 views
HUD layer not being added on my scene [closed]
I have a CCScene which already holds my gameLayer and I am trying to add HUD layer on that.But the HUD layer is not getting added in my scene, I can say that because I have set up a CCLabel on HUD ...
-2
votes
1answer
562 views
How change the size of sprite in cocos2d?
I want to change the scale of sprite like a paper in 'Paper Toss' game.
'Paper Toss' is the game is available on the App store. I want to make a sprite like a paper and change the scale of sprite ...
0
votes
1answer
374 views
Cocos2d Box2d contact listener call different method in collided object
I have the building object, wen it hit with other, i want to call some method inside it.
Building.mm
-(void)printTest
{
NSLog(@"printTest method work correctly");
}
in my ContactListener i ...
1
vote
1answer
432 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.
0
votes
0answers
194 views
Box2DWeb problems
I'm having problems with box2DWeb. I can't seem to get 2 objects on the screen at once. I can get either a static body, or a dynamic one. But when trying both at the same time it messes up and just ...
2
votes
1answer
222 views
Show path of a body of where it should go after linear impulse is applied
I am making a game with Andengine and Box2D. I have a dynamic body and I apply linear impulse on the body to move it around when the user have touched the screen.
Now I want to show the path where ...
1
vote
1answer
208 views
How do I identify a collision with a specific body?
How can I identify when the ground body collides with another b2Body? I can use b2ContactListener to be notified of collision events, but how do I tell which bodies collided?
-1
votes
1answer
131 views
Interacting with box2D objects
How can I interact with an object in box2d, I'm completely new to this so I have no clue what to do. The box is created like this:
bodyDef.type = b2Body.b2_dynamicBody;
fixDef.shape = new ...
1
vote
1answer
101 views
Why is the MaskBit maxed out
Hi there for some reason the maskbit of my b2FixtureDef is being maxxed out and im not sure why
Here is the declaration of the items that are used in the game
enum PhysicBits {
PB_NONE = 0x0000,
...
1
vote
2answers
197 views
Box 2D Collision Question
I am very new to Box 2D Physics world. I wanted to know how to collide 2 bodies when one is Dynamic and other is Kinematic.
The whole Scenario is explained below:
I have 3 balls in total. I want to ...
4
votes
1answer
365 views
Cocos2d: Tongue effect like in Munch Time
I'm wanting to do a tongue effect for my character like the one in Munch Time( shown in pic ). The player does some action and his tongue attaches to the nearest platform.
I'm thinking this is ...
0
votes
0answers
176 views
How to attach an object to a rotating circle?
I am trying to make an object get attached on a collision point to a circle that is rotating, but the player needs to get attached with a constant point on the player. For example the player is moving ...
0
votes
0answers
62 views
Creating a contact listener with sprites from different classes
I've been trying to set a contact listener that creates a joint on contact between two sprites which have their own classes. Both sprites are inheriting from NSObject and they are initialized in their ...
1
vote
0answers
208 views
Design pattern for procedural terrain assets
I'm developing a procedural terrain class at the moment and am stuck on the correct design pattern. The terrain is 2D and is constructed from a series of (x,y) points. I currently have a method that ...
2
votes
2answers
548 views
Simple 2D Flight Physics with Box2D
I'm trying to build a simple side scroller with an airplane being the player. As such, I want to build simple flight controls with simple but realistic-feeling physics. I'm making use of cocos2D and ...
0
votes
1answer
623 views
RevoluteJoint Stop Rotating when Some Physics Body Collide in Andengine + Box2d?
I am making a Game from andengine + box2d in Which i am using RevoluteJoint in that case i am facing some problem that when physics body or Sprite Collide with this Revolute joint body then Revolute ...
