additive restitution

CoIinCoIin Member Posts: 197
edited November -1 in Working with GS (Mac)
If a movable ball with a collide attribute is set to a restitution of 1, it will bounce on the specified non movable actor without losing energy. That happens no matter what the restitution is of the non movable actor.

Is it possible to have the bounce be based on the restitution of both actors? You can imagine, a rubber ball bouncing on concrete should have a different outcome than the same ball bouncing on grass, or on sand.

Comments

  • CoIinCoIin Member Posts: 197
    That makes no difference. It might affect one actor sliding along another, but doesn't affect a bouncing actor.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I haven't tried it, but you might be able to make a global game attribute for "bounciness".

    Constrain the ball's restitution to that global attribute.
    In the other surfaces, when the ball collides, set the global bounciness to something different.

    I agree that this is a shabby solution, it should be built into the engine, and will only work if you have one main ball...

    but maybe it's a start...
  • CoIinCoIin Member Posts: 197
    I thought of that, but the problem is that it's too late by then. The ball will already have bounced based on the previous surface's restitution. The next time it bounces would be at the value you had changed.
  • Fafnir312Fafnir312 Member Posts: 161
    A hack you might try is creating an invisible actor that's constrained to your ball and that's a tiny bit larger than your ball. Use that with firemaplegames' idea to detect the collision before it occurs.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    you could change it before it hits the object, by checking the ball's positionX and positionY...
    i.e. when the ball is within 10 pixels or whatever, change it then...

    but again, it is a hack. and would only work in a very controlled environment.

    btw, Colin, I come to some FCNY meetings, and have been using gamesalad since you demoed it a few weeks ago...I'll introduce myself again at this Wednesday's meeting. Thanks for showing me this great software! GameSalad is a lot of fun!

    I just submitted my first game the other night to the App Store: Danger Cats!

    You can try it here:

    http://gamesalad.com/game/play/30122

    Best,
    Joe
  • CoIinCoIin Member Posts: 197
    This week's meeting is me showing more Other Tools, and I'll have a lot more time to show GameSalad. I was definitely going to show Danger Cats! I have the project file, if you don't mind me opening it up in front of everyone?

    I have comments on Danger Cats, but I'll post those in the other thread.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Hey!

    No, that's fine. I'd like to show it off!

    I thought I had turned off sharing the project, though...
    When I uploaded it, I turned off that checkbox.

    How are you able to download the project files?
    I don't see how to do that...
  • CoIinCoIin Member Posts: 197
    Clearly you're a Junior level hacker...
  • firemaplegamesfiremaplegames Member Posts: 3,211
    it's true that i am...

    Well, if you hacked it, that's fine.
    I just didn't want the download project button to be visible

    hacking is the sincerest form of flattery...
Sign In or Register to comment.