Restitution Questions...

stocks109stocks109 Member Posts: 5
edited November -1 in Working with GS (Mac)
Hey guys,

I'm brand new to GS. I've been taking the tutorials, searching the forums, etc and one wall I've run up against is the Restitution attribute.

Here's what I want to do.

I want to set Restitution per actor and for it to be additive.

For example, if the character collides with the ground he'll bounce up at 2 Restitution (btw, what does 2 exactly mean?). If he collides with a special platform or object he could bounce up at 3, and so on.

But what I don't want to happen is the player to keep bouncing higher if he stays in one spot.

I thought I had this problem licked by creating rules for the actor (not player) but it appears these rules are not being followed.

Does anyone have any ideas on what I can do here?

Comments

  • stocks109stocks109 Member Posts: 5
    Oops, I meant I don't want the resitution to be additive.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Restitution is bounciness.
    1 means perfect bounciness.

    When you drop a rubber ball from a height, it will bounce back up - but not to the height you dropped it. That is because the ball's restitution is less than 1. If it WAS 1, it would bounce right back up to where you dropped it from.

    A restitution above 1 (up to 2) will cause the object to keep bouncing higher each time.

    Most things will usually have a restitution of somewhere between 0 and 0.2

    Also, you can set the restitution on BOTH the ball AND the ground. I would advise only setting restitution on the ground actors and set the restitution for the ball actor to 0.

    This will allow you to have different surfaces, like rubber, asphalt, etc...

    You cannot change Restitution at runtime, so you have to think creatively how you want your game to work.
  • stocks109stocks109 Member Posts: 5
    Thanks, Firemaplegames. Your explanation has helped me quite a bit!
Sign In or Register to comment.