Computer Science Canada Help with multiple bullets |
Author: | ha1o [ Thu May 10, 2007 9:48 pm ] | ||
Post subject: | Help with multiple bullets | ||
I'm trying to make a space shooter and I need help getting multiple bullets on the screen at once. This is what I have so far:
|
Author: | DIIST [ Fri May 11, 2007 6:24 am ] |
Post subject: | Re: Help with multiple bullets |
Why Do you Have 2 Input.KeyDowns? Far as I know you only need to use it once in the loop. As for the bullets and multiple of them consider either this: Arrays(probably the easiest) and/or a link list. For arrays you can check here http://www.compsci.ca/v3/viewtopic.php?t=14333 for a tut on how it works and when it should be used. For Linklist i don't know if a tutorial is up for that but you can try Googling it. ![]() |
Author: | LaZ3R [ Fri May 11, 2007 2:39 pm ] |
Post subject: | Re: Help with multiple bullets |
1) You only need one input keydown... No point in 2 2) Flexible arrays would be your best bet when it comes to creating and removing objects because it A) Won't lag Turing as much, B) Allows you to create as many bullets as you want as opposed to regular arrays which would only allow you to create a set amount of bullets right from start and any time you create more than that, Turing will crash. Flexible Arrays is what you should learn for this as it's most effective for this type of idea you want. If you don't already know them, try to learn regular arrays first considering flexible arrays aren't all that much more difficult! Good luck! |