Computer Science Canada bullet shooting |
Author: | sammi [ Sat Nov 05, 2011 11:17 am ] | ||
Post subject: | bullet shooting | ||
What is it you are trying to achieve? when i press the spacebar i want the bullets to shoot What is the problem you are having? <they wont shoot> Describe what you have tried to solve this problem <I though i did the right thing but its not working> Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using <Answer Here> |
Author: | evildaddy911 [ Sat Nov 05, 2011 4:10 pm ] | ||
Post subject: | Re: bullet shooting | ||
the reason that the space isnt working is because you need to put
you dont put " " or key()= true |
Author: | sammi [ Sat Nov 05, 2011 7:10 pm ] |
Post subject: | RE:bullet shooting |
its still not not working so im going to get rid of all the fancy stuff and try to make a ball appear on the screen by pressing space. |
Author: | sammi [ Sat Nov 05, 2011 9:30 pm ] | ||
Post subject: | RE:bullet shooting | ||
alright so i got right back down to the basics and made my code so that when press spacebar a green bullet appears on the screen but it doesnt go anywhere. I'm familiar with making objects move around the screen if they have an integer value but not when they are arrays. (in this case a round of bullets) I need the black circle to shoot out a bullet when i press spacebar.
|
Author: | Tony [ Sat Nov 05, 2011 9:59 pm ] |
Post subject: | Re: RE:bullet shooting |
sammi @ Sat Nov 05, 2011 9:30 pm wrote: I'm familiar with making objects move around the screen if they have an integer value but not when they are arrays.
But it's an array of integer values! So when you do my_array(index), you have an integer -- something that you already know how to move. |
Author: | Raknarg [ Sun Nov 06, 2011 4:13 pm ] | ||
Post subject: | RE:bullet shooting | ||
Just a note:
Your program will crash after 11 loops i believe. Also, you're going to want to work with an array of booleans fro each bullet so you can see whether or not they are dead without having to check them each individually. |