Hi!
I'm trying to launch the cat from one point to another. I know the coordinates, Velocity along X and Gravity. The cat has Platformer behavior. MaxSpeed, MaxFallSpeed and Deceleration are set to 99999999. The gravity is constant.
Using this formulas:
[quote:29esez9r]x(t)=x(0)+vx(0)*t
y(t)=y(0)+vy(0)*t-0.5*g*t^2
where t is the flight time.
I've managet to get the Velocity along Y I need to apply to cat to launch him so he lands at specific spot but when I test the game I can't get the correct result - the cat lands slightly further every time.
Here are my calculations:
[quote:29esez9r]Vx:=300;Xc:=20;Yc:=290;Xt:=300;Yt:=290;G:=1500
= 1500
t:=(Xt-Xc)/Vx
= 0.9333
Vy:=(Yt-Yc+0.5*G*t*t)/t
= 700
Cat starts at (20,290) and has to land at (300,290). Horisontal velocity is 300 and gravity is 1500. According to my calculations the vertial velocity shoud be equal to 700 but when I set this velocity to the cat he lands not at (300,290) but from 5 to 10 pixels further along the X.
Here's the link for the project:
https://www.dropbox.com/s/gi940wsgoozqquv/Asshole%20Cat.capx