Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Bouncing on a trampoline

  1. Jul 29, 2011 #1
    Currently I am making a small video game where a cat is constantly falling through the sky! I want to add in some trampolines that when hit you will bounce according to the trampolines angle.

    What equation would I use to perform this function?

    I have provided a picture to help illustrate what I am trying to achieve

    For all of you programmers out there here is the code that I used so far

    if (trampTime <= 0)
    //trampRotation is in radians
    character.velocity.Y = 10 * (float)Math.Sin(trampRotation);
    character.velocity.X = 10 * (float)Math.Cos(trampRotation);
    if (trampTime > 30)
    character.trampoline = false;
    trampTime = 0;

    Any help would be greatly appreciated

    Attached Files:

  2. jcsd
  3. Jul 29, 2011 #2


    User Avatar
    Staff Emeritus
    Science Advisor

    You might try the Computer and Technology forum instead of General Physics. You should have the best chance of getting help there!
  4. Jul 30, 2011 #3


    User Avatar
    Science Advisor

    Welcome to PhysicsForums!

    Since you seem to grok code, I presume that you're more interested in the physics of the situation, rather than code that models the physics.

    If you make the assumption that the bounce is completely elastic (not a bad assumption, for the lulz) the angle of incidence will be the same as the angle of reflection, as measured from the normal of the plane (or, in your case, trampoline):

    If you make the assumption that you don't have perfectly elastic collisions, you have to do some vector analysis (all while dealing with gravity, as I presume you are).
    Last edited: Jul 30, 2011
  5. Jul 30, 2011 #4


    User Avatar

    Staff: Mentor

    Yes, I agree that a physics forum is probably better for this particular question, since it's basically a physics question. If the OP wants to get into discussing the programming code specifically, the "Programming & Comp Sci" forum would be the place for that.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook