How can I make my actor bounce other objects while not being able to bounce itself?

iUrBaNziUrBaNz Member Posts: 1
edited May 2012 in Working with GS (Mac)
Hey guys,
I understand the title might be a little confusing, but I'm new to GS and am stuck. Im creating a physics game that has a similar style to that of ZombieDrop or Danger Cats!, what I'm trying to achieve is an object with a trampoline like affect. So when an object collides with the trampoline it'll bounce the object. However, I have other objects that I want to collide with my main actor as well that I don't want to bounce, so I don't want to change my main actors restitution. My main concern with changing my trampolines restitution is that the trampoline is a moveable object that is affected by gravity (Acceleration behaviour) and I have a floor in my scene that bounces my trampoline when they collide (I don't want my floor to bounce the trampoline). So to clarify everything, because I don't really know how to explain it, is I want to have a trampoline bounce my main actor but not be affected (by bounce) by any other actors in the scene! Please try to keep the explanation as simple as possible because I'm new to GS ;)! Thanks in advance!

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    If you need one actor to bounce off of the trampoline, you might consider faking the bounce by using a Change Velocity behavior to "bounce" the actor in a new direction based on the direction it's moving and the rotation of the trampoline (if it rotates). This involves not using a Collide behavior but just using a game attribute for the Change Velocity's direction value.

    Here's a demo: http://dl.dropbox.com/u/19602014/Trampoline.zip

    The coding is not at all sophisticated... it just uses a 90° "bounce" but you can determine the bounce direction by other mathematical means if you prefer.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

Sign In or Register to comment.