I would almost certainly do this with animation of the trampoline to give the impression of the stretch and return, as doing it with physics in actors would be a pain. And if I knew the bouncing main actor was only arriving in one orientation I would then switch it's alpha out and use a replacement animation the trampoline, or constrain it temporally to positions that match the frames of the bouncing surface of the trampoline, then switch back visible with a new speed/direction as it reached the release from the trampoline. I would also (to make it less work) have a narrow trampoline so it looked correct with one set of behaviours rather than having to account for different surface positions.
This is slightly complex thing to do and if you are new to GS I would either avoid it or realise you might have to put some time into making this look good. The results might well be worth it.
Hello, I recently just did this exact thing in my upcoming game. I will post the rules for you. Take a deep breath because really, this isn't that hard to do!
Assuming you are starting from having your character jumping onto the tramp from the ground:
STEP 1:
Here is my player starting at the ground, about to jump up on the tramp. You may be tempted to use accelerate or move, but resist that. There is a more efficient way using interpolate. Interpolate represents a gradual change, unlike the change attribute behavior which is instant. You can get a great jumping effect by using its "ease out" feature (to simulate the peak of the jump) and its "ease in" feature to show the jumping off the ground. Here are the rules:
Here is the result:
STEP 2:
Now we have our actor going up, we need a rule to make him go back down to "bounce" on the trampoline. Same idea, just opposite direction. We do this by ID'ing when he is at the "peak" of the jump.
STEP 3:
Finally we make it all happen again.
Please note that I have my character just jumping ONCE and starting my game. To have your character jump up and down all over again, just loop back to the rule above stating when is at the peak of the jump to keep things going. Here is the end result:
Hope this helps!
****Try to use interpolate whenever you can, you can get great moving effects while turning off "moveable" in your actor. This save A LOT of memory, which you will find is everything using Gamesalad. Also, for me the "animate" behavior is just a placeholder. You can easily animate with timers and using the "change attribute" behavior to save on loading times. When you use animate, the Gamesalad engine must load all of those images, and sometimes that can take awhile.
I am afraid that I don't have time to explain it in detail as I am working on a deadline at the moment, but the above solution is cool, or roughly you would do something like-
have the bounce actor have a on collision rule that looked for collision with the trampoline actor, and this then stopped the actor by setting it's speeds (x and y) to 0, and at the same time switch it's colour alpha to 0, the in the trampoline actor have an animation have it run the animation for the bounce based on a rule that it is overlapped by the incoming bouncing actor. Then when it's played the image of the last frame of animation of the bounce, send a switch to boolean game attribute that the bouncing actor can see and fires a change in speed/acceleration in it based on receiving that signal.
For a constraining of bouncing actor (so you could account for rotation of the incoming bouncing actor) you would keep it visible but use a constrain to current x during the bounce and a series of offsets that were triggered by the frame image names from the trampoline.
All these things are explained (not exactly for this particular case) in the cookbook video and cookbook, but if you go through the videos in some depth you should be able to construct a solution for the problem.
sorry I can't offer more in-depth help at the moment but I hope my reply gives you some help...
Comments
This is slightly complex thing to do and if you are new to GS I would either avoid it or realise you might have to put some time into making this look good. The results might well be worth it.
Hope that helps.
kipper
Assuming you are starting from having your character jumping onto the tramp from the ground:
STEP 1:
Here is my player starting at the ground, about to jump up on the tramp. You may be tempted to use accelerate or move, but resist that. There is a more efficient way using interpolate. Interpolate represents a gradual change, unlike the change attribute behavior which is instant. You can get a great jumping effect by using its "ease out" feature (to simulate the peak of the jump) and its "ease in" feature to show the jumping off the ground. Here are the rules:
Here is the result:
STEP 2:
Now we have our actor going up, we need a rule to make him go back down to "bounce" on the trampoline. Same idea, just opposite direction. We do this by ID'ing when he is at the "peak" of the jump.
STEP 3:
Finally we make it all happen again.
Please note that I have my character just jumping ONCE and starting my game. To have your character jump up and down all over again, just loop back to the rule above stating when is at the peak of the jump to keep things going. Here is the end result:
Hope this helps!
****Try to use interpolate whenever you can, you can get great moving effects while turning off "moveable" in your actor. This save A LOT of memory, which you will find is everything using Gamesalad. Also, for me the "animate" behavior is just a placeholder. You can easily animate with timers and using the "change attribute" behavior to save on loading times. When you use animate, the Gamesalad engine must load all of those images, and sometimes that can take awhile.
have the bounce actor have a on collision rule that looked for collision with the trampoline actor, and this then stopped the actor by setting it's speeds (x and y) to 0, and at the same time switch it's colour alpha to 0, the in the trampoline actor have an animation have it run the animation for the bounce based on a rule that it is overlapped by the incoming bouncing actor. Then when it's played the image of the last frame of animation of the bounce, send a switch to boolean game attribute that the bouncing actor can see and fires a change in speed/acceleration in it based on receiving that signal.
For a constraining of bouncing actor (so you could account for rotation of the incoming bouncing actor) you would keep it visible but use a constrain to current x during the bounce and a series of offsets that were triggered by the frame image names from the trampoline.
All these things are explained (not exactly for this particular case) in the cookbook video and cookbook, but if you go through the videos in some depth you should be able to construct a solution for the problem.
sorry I can't offer more in-depth help at the moment but I hope my reply gives you some help...
kipper