Archived

This topic is now archived and is closed to further replies.

flares

simple question

Recommended Posts

this might be a dumbquestion but how do you implement a bullet firing system, i tried arrays but, i''m not sure bout it, is there tutorials or examples on simple game programming concepts ? any help is welcome, thnkz

Share this post


Link to post
Share on other sites
What would you need an array for?

Unless you want to see the bullets (in which case you probably aren''t seeing bullets, but rather "slow moving projectiles"), you simply use line of sight to determine if you''re aiming at an enemy unit while firing, and if so, inflict damage.


swift URL | browse my bookmarks [server may not always be on]

Sensimed | Info/download

Share this post


Link to post
Share on other sites
i use an array for a shooting game to take control of my bullets.

i have a function that return a bool value true if the bullet keeps in the screen or false if it doesn''t..
you have to keep a the max number of shoots

for (all the bullet) {
if (!bulets->paint()) {
maxShoots--;
bullets[i] = bullets[maxShoots];
i--;
}
}

i hope that had help you

Share this post


Link to post
Share on other sites