Tag Info

New answers tagged

1

This is a quite known issue in box2d, the problem is that you are rendering a rectangle per Tile and in the joint of those there is a ghost vertex, you can read extensive explanation here: http://www.iforce2d.net/b2dtut/ghost-vertices As for a solution to that i solved it by creating an object layer in my tiled map and created a Polyline object that defines ...


0

Your best bet is to extend the Image class and add a touch listener. Add this code into your Image subclass: private void addTouchListener() { this.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { YourClassName.this.wasTouched(); } }); }


2

Why would you make the game free on android and let PC users pay $10 + $1/month? The big trend for most indies is building a fanbase as soon you have something to show from your game. Blogging about everything that involves your game and perhaps let your fans influence your design. You can find a lot of sources at open indie developers like Grid Sage ...


2

I found the solution, so I think I should write here for other ones later. First I download the source code of box2dlights. Then open BaseLight.java and find "segments" member variable. This variable contains all information about what I was finding. This code below is just for debugging purpose: rayHandler.setCombinedMatrix(camera.combined); ...


0

I found a fix for this by adjusting the world update time interval. Initially the world was being once per frame updated using delta t, the time since the previous update. world:update(dt) From what I understand, by splitting this down into several smaller updates the forces being generated each update are small enough to be kept in check by Box2D. ...


0

It looks like it is probably based on curves - like maybe piecewise Bezier curves, or maybe B-splines. Internally in the code they could also be using hermite splines, catmul-rom splines or some other variant but without seeing the code its nearly impossible to tell what specific curve is being used since many of the above are visually equivalent, but are ...


0

If you want to check which of your body sides collided with obstacles, you can create your box-shaped body consisting of four b2EdgeShape sides having independent fixtures instead of single b2PolygonShape (in case you are using b2PolygonShape). In this way, while your are checking for contacts, can easily determine which fixture of my body is currently in ...


0

I took some time to think about the issue and realized that logically, there is no purpose for disposing the World or re-initializing it whenever a new Level is loaded it seems a lot better to dispose and reinitialize the world when a new Level is loaded - thanks to @Shiro for helping me see this. I won't have to manually clear all of the World's bodies, ...


1

Shortly after posting I tested this out a bit more and found that the assert will fail. GetFixtureA() may or may not return a fixture belonging to playerPhysicsBody. I'm now using this convenience function to safely find the fixture that I want: inline const b2Fixture *contactFixtureFor(const b2Body *body, const b2ContactEdge *contactEdge) { return ...


0

You don't want to use setLinearVelocity for horizontal movement as that set's the velocity to a value it will cancel out any force applied because of a jump. For moving left and right you want to use either applyForceToCenter (like what you do for your jump), or applyLinearImpulse. You might want your code to do something like this to limit the ever ...



Top 50 recent answers are included