most efficient way to implement bullets
Posted: Thu Oct 13, 2016 6:37 am
Hi,
I was trying to add bullets to the game I'm working on, but came across a couple of problems. Firstly, I am probably going to need a function updateBullets() so that the game can continue while bullets are moving, etc. Also, I only want a maximum of three bullets allowed at a time. I am not sure how to implement these things. I was thinking possibly with an array that stores the bullet x and another for the y, and then changes the amount on each call of updateBullets() but I'm not sure. Any ideas?
Thanks in advance, Noah
I was trying to add bullets to the game I'm working on, but came across a couple of problems. Firstly, I am probably going to need a function updateBullets() so that the game can continue while bullets are moving, etc. Also, I only want a maximum of three bullets allowed at a time. I am not sure how to implement these things. I was thinking possibly with an array that stores the bullet x and another for the y, and then changes the amount on each call of updateBullets() but I'm not sure. Any ideas?
Thanks in advance, Noah