Return to original place after "Bounced"
sevek
Member, PRO Posts: 30
Hi~ @gyroscope and @RThurman !
So, I am almost done with my first game and would like to ask one more question.
I have this character which moves up and down at a constant X-coordination (Thus, the character is only moving up and down).
When this character collides with an object that flies at him, i made it so that these two actors bounce off each other.
I realized that they bounce off infinitely and off the screen.
Is there a way to return the main character back to its original x-coordiation even after the bounce?
Thanks!
Comments
Try to reduce bounciness valve on both the charactors and object (.5 or .2).
Current Projects I am working on: Stupid Duck, Zango's Shark Adventure, AoD: Age of Dragons, Rocket Jump: The Pixel Invaders
Facebook: https://facebook.com/reflectivebytegamestudios
Web: reflectivebyte.com
Hi @sevek How about amending an aspect of your game and not have the actor that moves up and down react to the collision?
To explain further, just have the When your other actor collides with it, have it Collide behaviour make it bounce off, but the one moving up and down keeps travelling on its merry way...
A thought - but if you don't like that idea I'll think again...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
For the bouncing actor increase drag so that when the object that flies at him knocks him out of his X position he comes to a rest before leaving the screen.
Then in the bouncing actor have a rule that says when linear velocity is less than 1 (or whatever value you want) interpolate the bouncing actor back to its orginal X position (use easy ease in).
@nabbo @gyroscope @Socks !
Thank you for the wonderful comments!
I will try these methods and see what I come up with!
Thanks and have a wonderful Sunday!
ps. I know it is a small feature, but I think it adds to the user experience when they see things bounce off as they would expect in real life
Thanks guys!
I got it working!
(ps. for those, who wants the same function, refer to the screenshot)
Thanks