Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not quite sure what I need to do, but I have a ball falling from the sky and it needs to bounce when it hits an object. Do I configure the ball in some way or do I need to setup a spring object or possibly do something on collision?

share|improve this question
up vote 1 down vote accepted

I figured it out. Requires a bit of tweaking but it works as I expect.

Body ball1 = PrefabBodtFactory.CreateBody(PrefabType.Ball, _world, new Vector2(3.8f, -0.75f));
            ball1.CreateFixture(new CircleShape(0.25f, 0.5f));
            ball1.FixtureList[0].Restitution = 1f;
            ball1.ApplyLinearImpulse(new Vector2(0.1f, 0));
share|improve this answer
Care to mark this as the answer? – doppelgreener Aug 21 '11 at 1:46
@Jonathan Hobbs: He has to wait at least 2 days (I think) to do that. – bummzack Aug 21 '11 at 12:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.