Tag Info

New answers tagged


ok guys, it was so simple. its a shame that this cost me 2 days of heavy thinking ^_^ it was, once again, the code order: hope this helps someone!


What you should optimize for is probably best shown in and around slide 40 of this presentation: http://www.slideshare.net/cellperformance/gdc15-code-clinic The idea is to prevent the code from doing wasteful things with the CPU. Loading memory and then throwing it away is rather wasteful. So, naturally, you can reorder data to make better use of it. If you ...


One thing that you could do is on command, run a method that would create a body relative to the position of the main body using body.getPosition.set(); set the filter bits to not collide, then set the linear velocity or apply force, whatever you want to move it forward after starting a timer to destroy after x amount of game loops Or you could do the ...


One approach is to take the coordinates of the users click in game world and interpolate the points on either side to alter the terrain. The result are going to be determined by your method of interpolation. For instance a linear interpolation will result in triangle forming. https://en.wikipedia.org/wiki/Interpolation


I'm working on a little project that has a similar type of landscape to how you describe. I use a Box2d chain shape for the physics. The Box2d chain shape just needs to follow the terrain edge, so it's dead simple, and it doesn't have issues with concave shapes and the restrictions Box2d polygons have. For the graphics, I break down my terrain into ...


I figured it out. Each dynamic body (what you control) must have an accompanying kinetic body "shadow". Their collisions must be set up as follows: each dynamic body only collides with other dynamic bodies' kinematic body shadows but not their own shadow, so dynamic bodies no longer collide with each other. This way, since dynamic bodies can't push kinematic ...


You need to destroy a body after world.step()

Top 50 recent answers are included