Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Parabolic Canon Ball Movement
So far i made it so when im looking right and i press space i shoot a canonball which moves like a parabola, tho i dont know how to make it so when im turned left and i press space that it moves the same way, just to the left....
this is the code:
and this is the parabolic function im using:
And with my variables:
I added *0.5 because i didn't canon ball to land too far away from the ship
Here is the video on how the canon ball moves using this function :
If any1 could figure out a function which i could use for when my ship is turned left i'd really appreciate it... I tried adding and subtracting stuff from this function but nothing worked out as it should've.... So please if anyone knows any solution to it please help me out :(
Its not so nice with pictures for code as you cant cut and paste. or even scroll to see all of it.
the x()+moveByX seems to control the direction so
MoveByX += 0.1
MoveByX += - 0.1 ( when direction == 3 )
to decrease the x ?
the parabolic seems only to be used for the y decay.
JonB last edited by JonB
g / 2 vO2 cos2(theta)
Excuse me, may I ask: is
vvelocity?? what is the big
i tried and it doesn't work :/ y is getting lower and lower
ye g is gravity while v0 is initial speed
tried and it doesn't work :
try to output x values with QDebug and see why.
yep i did so and i figured it out just minutes ago, i had to add another variable for X cords and now it's working perfectly thank you all!