|
-
Oct 21st, 2002, 01:47 PM
#1
Thread Starter
Addicted Member
Projectile
Hi everyone,
I'm just fooling around with vb right now, and i wonder if anyone knows how to make projectiles. I'm talking about a tank, shooting a projectile at a speciefied angle and with a speciefied power, how would i calculate the positions for this projectile?
Thanks in advance,
-Shell-
-
Oct 21st, 2002, 02:04 PM
#2
Addicted Member
Hi.
Have a look at this piece of code that i did, to rotate things and go in the same direction.
http://www.vbforums.com/showthread.p...hreadid=193280
Pete.
-
Oct 21st, 2002, 02:34 PM
#3
Thread Starter
Addicted Member
That helped, thanks!
But I still need to know something, how to add gravity so the projectile always ends up on the ground?
-Shell-
-
Oct 21st, 2002, 02:39 PM
#4
Addicted Member
At a guess, though i'd have to fiddle with it a bit. You would have to see that when the projectile gets to a certain point/height then add a little value onto the 'DipY' variable each time. That (I think) should make it arc down.
Pete.
-
Oct 21st, 2002, 04:14 PM
#5
Good Ol' Platypus
I didn't take a look at Pete's code, but if he's using a vector you can simply rotate that, until it's at 180 degrees (or hits the ground). You might need a more flexible way if you plan to add wind, such as a vector base but translating it into a speedX/speedY type thing.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|