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

0 favourites
  • 8 posts
From the Asset Store
Throw daggers and hit the most fruit! Watch out for the wind, if you run out of daggers you'll lose the game!
  • 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

    Thanks in advance, and sorry again if this question as been asked before!

  • Those links are still online and should answer your question.

  • Thanks for the pointers!

    Does anyone as the .capx R0J0hound mentioned in this thread :

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

  • pmerineau

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



    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.

  • 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

  • link updated in other topic

  • R0J0hound Thank you sir!!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)