Tagged Questions
3
votes
1answer
567 views
How do I implement smooth movement in a Box2D platform game?
I have implemented a character in JBox2D which moves with the help of a wheel rotating at the bottom of it. The movement is the best result I've had 'till now but it's a little glitchy when the ...
1
vote
1answer
334 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() {
...
2
votes
1answer
222 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 ...
0
votes
0answers
1k views
LibGDX Box2D Body and Sprite AND DebugRenderer out of sync
I am having a couple issues with Box2D bodies. I have a GameObject holding a Sprite and Body. I use a ShapeRenderer to draw an outline of the Body's and Sprite's bounding boxes. I also added a ...
4
votes
3answers
343 views
Box2d Collision problem
I'm not good with words so here's a picture to describe my problem:
In my game there is this big ball which the user can move on x-axis only. Now, if the ball is falling like the red one, it's ...
3
votes
3answers
333 views
Why does creating dynamic bodies in JBox2D freeze my app?
My game hangs/freezes when I create dynamic bullet objects with Box2D and I don't know why. I am making a game where the main character can shoot bullets by the user tapping on the screen. Each touch ...
1
vote
1answer
818 views
Best way to create a level editor in java
I am creating an iPhone game using cocos2d + box2d that needs a lot of levels. My friends and I are creating the game and most of them have no programming experience and end up with nothing to do. I ...
0
votes
1answer
154 views
JBox2D - how to get vertex positions?
I've created a triangle for jbox2d...
public void createTri(){
PolygonDef shape = new PolygonDef();
shape.density = 2.0f;
shape.friction = 0.8f;
shape.restitution = 0.3f;
...
1
vote
1answer
347 views
Box2D how to implement a camera?
By now i have this Camera class.
package GameObjects;
import main.Main;
import org.jbox2d.common.Vec2;
public class Camera {
public int x;
public int y;
public int sx;
public int sy;
public ...
1
vote
1answer
324 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
693 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
324 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()));
...
5
votes
1answer
813 views
Box2D Difference Between WorldCenter and Position
So this problem has been brothering for a couple of days now. First off, what is the difference between say Body.getWorldCenter() and Body.getPosition(). I heard that WorldCenter might have to do ...
1
vote
1answer
1k views
How would I use JBox2d in Java?
So I did some research and a found Box2d. I then proceeded to download it and the testbed. Now that i have it, I don't know how to properly use it. I'm looking for a clear simple answer on how to ...
2
votes
1answer
415 views
How to setup JBox2D
I resently downloaded the JBox2D but how do I set this up?..
Its jbox2d-2.1.2.2 All I can see is a bunch of code and folders.
Any websites with step by step tutorial??
You know how??