My caracter (on the picture, the blue square) has coordinates
x and y.
When it is moving to right, x is increasing and to left it's decreasing.
Now, when there are an event (here for example : when the caracter is colliding a box) the caracter jumps.
The caracter jumps during 2 seconds on 300 pixel.
It is good for the x move.
But i can't get the y.
The problem is to find the y from the x.
(i wish to be clear ?)
The initials coodinates can be everything, it is not important.
On this exemple we can see 3 phases.
- Before jump
- During the jump
- After the jump
Before the jump Y don't change and x has a fix velocity.
During the jump y (i will find it one day
) and x adjust its velocity for the jump lenght (2 seconds)
After jump, x and y return to their initials states
Thx for the reply Zendar =)