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

Get help using Construct 2

Post » Thu Jun 29, 2017 2:17 am

Ok, sorry for asking again, but I know that this question has been asked and answered before, but every sample that was already posted on this forum is 404 on DropBox...

I'm making a defence 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 enemy 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 (not drawn, just the effect, like in real life if you would throw a grenade in the air :) ....)

I'm pretty sure that it's easy to do, so I really need your help! If there a .capx example out there, I am a taker :o
Thanks in advance, and sorry again if this question as been asked before!


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

Post » Thu Jun 29, 2017 10:53 am

Those links are still online and should answer your question.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Thu Jun 29, 2017 3:14 pm

Thanks for the pointers!

Does anyone as the .capx @R0J0hound mentioned in this thread : how-do-i-make-parabolic-projectile-and-movement_t103232
B
14
S
5
G
1
Posts: 8
Reputation: 1,870

Post » Thu Jun 29, 2017 3:29 pm

i second this, ive been looking around for something similar for arrows but everywhere has capx files on dropbox which doesnt work anymore, anyone have them or could post one?
B
19
S
6
Posts: 143
Reputation: 1,835

Post » Fri Jun 30, 2017 4:56 pm

@pmerineau

Are you looking for an arc prediction that includes movement prediction of the enemy?

___________

@darkrealos

Do you want arrows at the point where the object will hit the ground after it flies across the arc?
You can use the above mentioned thread for that.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Fri Jun 30, 2017 9:12 pm

@randomly thanks for reply i haven't started this code as having another problem atm but when i do i want it like the capx shows and stick in the ground at .x .y which i don't think will be hard but i would like it to sometimes predict enemy movement and sometimes go bit off which i would imagine random(num,num) would help, i just don't know how to predict movement lol, as the archers that firing the arrows will be ai based so they fire on sight of enemy in arc sometimes hitting the enemy and sometimes not based on their accuracy variable/abit of luck. hope what i said makes sense :)
B
19
S
6
Posts: 143
Reputation: 1,835

Post » Mon Jul 03, 2017 6:36 pm

link updated in other topic
B
94
S
33
G
117
Posts: 5,387
Reputation: 75,335

Post » Tue Jul 04, 2017 8:15 pm

@R0J0hound Thank you sir!!!
B
14
S
5
G
1
Posts: 8
Reputation: 1,870


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests