Grenade physics

Get help using Construct 2

Post » Sun Sep 29, 2013 8:54 pm

hey guys im in the middle of making grenade feature and im having some issues e.g the grenade don't seem to point at mouse cant get a decent feature going cant seem to get power right and i wanted to make a projected line for it to tell user where it will land and how it will bounce but i have no idea how to do it if anyone can help possible get it done i will hugely appreciate it

https://www.dropbox.com/s/ectjsf5hda7z2xe/Zombie%20Shoot%20em%20up.capx

tyvm
B
16
S
5
Posts: 139
Reputation: 1,652

Post » Sun Sep 29, 2013 9:44 pm

Well, the grenade does aim towards the angle between where it is spawned and the mouse, so that part looks like it works okay.

Do you mean you want it to have more of an upward angle (eg: lob it in the air then it falls?), if so then you might want to base the throw strength based on the distance between the grenade and mouse as well: distance(grenade.x, grenade.y, mouse.x, mouse.y) * POWER

Then lower the value of power.
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
116
S
41
G
17
Posts: 2,204
Reputation: 19,545

Post » Mon Sep 30, 2013 12:07 am

ahhh fantastic that is what i wanted tyvm :) do u know how i can do a line of projected throw like angry birds?
B
16
S
5
Posts: 139
Reputation: 1,652

Post » Mon Sep 30, 2013 2:26 am

hmm im not sure if there's a problem with my computer or something but on my screen it always aims below the mouse? but that bit of code worked pretty awesome to get power based on the distance tyvm
B
16
S
5
Posts: 139
Reputation: 1,652


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 12 guests