Game: Shooting towards the mouse
I'm making a pretty basic game, however:
How do I make it so when I click, a line (the bullet) gets created on my ship and sent towards the position of the mouse when clicked (as in, I want it to go to were the mouse *was* at the time of the click, not follow the mouse around, lol)
Thanks
Re: Game: Shooting towards the mouse
Moved To Games And Graphics Programming
Re: Game: Shooting towards the mouse
This should get you started.
Clicky
Re: Game: Shooting towards the mouse
yes, i know how to detect all that (even tho I am working with VB6)
What I want to do is, create the bullet were the player is (I can do this) and have the bullet move at a reasonable speed TOWARDS the mouses position?
1 Attachment(s)
Re: Game: Shooting towards the mouse
Here is a super basic project to atleast give you an idea of what do to. It doesn't work great but it is a start in the right direction.
You'll need to edit it heavily though as right now all it does is move in a diagonal based on the quadrant you clicked in relative to the green circle. Also when you move the green circle the "bullet" stops traveling.
To get around the direction you would need to calculate the speed in both the x and y directions using the sin function.
Re: Game: Shooting towards the mouse
Wow. Thankyou very much Veritas2.0, very helpful ^.^ but still, i'm not sure if i want to do it this way. Anyone else have some other idea's?