# How to throw a grenade at Mouse.X and Mouse.Y

Get help using Construct 3!

### » Wed Jun 28, 2017 9:56 pm

Ok, sorry for asking again, but I know that this question as been asked and answered before, but every sample that are already posted on this forum are 404 on DropBox!

I'm making a tower game where the ennemies are attacking my tower (tower is on the left, ennemies are coming from the right side).
The player can click on the ennemy at X and Y to throw a grenade.
I would like to simulate a throw with a parabolic/arc effect where the grenade will be thrown from the player and the final destination of the grenade will be the Mouse.X and Mouse.Y WITH a parabolic curve....

I'm pretty sure that it's easy to do, so I really need your help!
Thanks in advance, and sorry again if this question as been asked before.

B
14
S
5
G
1
Posts: 8
Reputation: 1,870

### » Thu Jun 29, 2017 12:42 am

R0J0hound wrote:With just two points all you exactly have defined is a line. You'll need three points to define a curve.

The standard formula for a parabola is the following:
y=a*x^2+b*x+c

Plugging in the x,y positions for the three points into the formula will give you three equations where the only unknowns are a,b and c. Then it's just a matter of using standard algebra to solve for the unknowns.

In general the process is called curve fitting:
http://en.wikipedia.org/wiki/Curve_fitt ... 2013-06-24 18:46:22
B
28
S
14
G
1
Posts: 148
Reputation: 3,218

### » Thu Jun 29, 2017 1:49 am

To much theory for my small brain
Any C2 instructions for help? If anyone as a .capx exemple for something similar, that would really help.
Meanwhile, thanks a lot for the info!
B
14
S
5
G
1
Posts: 8
Reputation: 1,870

### » Thu Jun 29, 2017 4:16 am

i dont have c2 so i cant check the work as im on linux; but it seems rojo has it down. these capx files arent 404d btw parabola-tracjectory-tracing-with-physics-box2d_t77802?start=10
B
28
S
14
G
1
Posts: 148
Reputation: 3,218