Hey everyone! I made this capx example after a request from Anik on facebook. Anik wanted to know how to make his grasshopper jump from position to position. Turns out it's not too complicated... but not that easy either!
The principle is the following:
1. We use a timer to determine the grasshopper's jump's duration.
2. When the player touches a nenuphar, we store the starting and target position of the Grasshopper.
3. We do a linear interpolation between the start and target position to represent the grasshopper's movement on the ground.
4. We substract a value to the resulting Y position, using a periodic function, to simulate a jump!
Comments are available in the capx file. Made with C2 beta 197.