Tag Info

Hot answers tagged

5

What's happening First of all, note that this behavior is not specific to oblique collisions. Below is an example of two balls colliding head on with a wall. All fixtures have m_restitution = 1.0, and m_friction = 0.0. The ball on the left is traveling with v = 0,1 and the ball on the right has v = 0,1.01. I found three similar questions asked on the ...


2

The position of a Box2D body is defined as its center. So if you set the body's position to the lower left corner of the Sprite, then it will be displayed as you showed in the image. What you need to do is set the Body's position to the center of the Sprite like so: bodyDef1.position.set(player.getX() + player.getWidth() / 2, player.getY() + ...


1

Thanks for asking Narek. I've struggled with understanding these joints in the past, and I'd like to use this answer to clear up some misconceptions. b2DistanceJoint This joint has two input parameters: frequency w, and damping d. Together they define the linear response of the connected bodies. Here I will always consider one body as the ground body (set ...


1

If you want well defined behavior, you should consider perpetuating the oscillations yourself. I will assume, for simplicity, that we are working with a simple spring-mass-damper system where the spring and damper behavior is encapsulated in a b2DistanceJoint. The basic idea is to evaluate the total energy (kinetic + potential) of the system and apply a ...


1

I think easiest way to solve this is to use very simple maze solver tactic. That is the "wall follower". Find wall Put your hand on the wall, either left or right of you Keep hand on wall Start moving Never let go off the wall, if there is a turn, you turn with the wall and if its "dead end" you turn but you still keep your same hand on the same side ( ...


1

I don't think it is a good idea to mix logic and art; or more precisely, base your logic on your art. In simpler terms, don't do what you're doing. Separate logic from art. The idea behind this is that the person who draws the sprites should be able to do any kind of drawings and change them at will, without having to worry that artistic changes will have ...


1

The client and the server will go out of sync eventually, so you'll have a smoother game if you interpolate instead of simulating with the server and then correcting, but this will induce extra lag. You cannot answer this definitely, it's up to you to decide which suits your application better. Also your questions seems a bit lacking in terms of describing ...



Only top voted, non community-wiki answers of a minimum length are eligible