View Single Post
Old
Powerhouse64
Senior Member
 
Powerhouse64's Avatar
 
Status: Offline
Posts: 54
Join Date: Nov 2011
Location: In ur base, movin ur stuffs
Default 11-05-2011, 03:11 PM

Quote:
Originally Posted by deathsniper127 View Post
THANK YOU SO MUCH!!!! I DID THIS AND IT WORKS !!!!

also centuri0n thanks this works but can you make multiple bullets(spheres) shoot?
Yay! Glad I could help!

For multiple bullets, create only about 5-6 maximum in the barrel (depending on how fast you want the gun to wait between bullets and how fast the bullets move) then WHILE (not when) the user clicks run a method that goes something like this:
Loop infinity times(
Do in order(
bullet 1 move to (starting position in gun)
Move bullet 1 forward (away from the gun) X distance in X seconds
wait a very tiny amount of time
bullet 2 move to (starting position in gun)
Move bullet 2 forward X distance in X seconds
wait a very tiny amount of time

do the same for bullets 3-5 and you should have a working automatic gun that can have multiple bullets shooting on screen at a time!

If the first bullet does not disappear off screen by the time the last bullet fires, add extra bullets (with the same functions) to taste until the first bullet is no longer visible, then have the function loop.

Once again, I hope this helps!


Hogwarts: Where everything is made up, and the points don't matter

Last edited by Powerhouse64; 11-05-2011 at 03:18 PM.
   
Reply With Quote