Computer Science Canada flexible |
Author: | upthescale [ Tue Jun 06, 2006 4:16 pm ] | ||
Post subject: | flexible | ||
ok i wanna benable ot shot and have multiple bullets come otu leik a machine gun my code is as follows:
y is the ball dissapeared? y aernt there more than one bullet? |
Author: | Clayton [ Tue Jun 06, 2006 4:20 pm ] |
Post subject: | |
there isnt more than one bullet because you only ever have a maximum upper bound to your array of 1, so you therefore need a new statement to increase the upper bounds of your array and add another bullet to the screen, also, you dont get another bullet because the x value of your bullet is never reset to its original coordinate, causing it to be drawn further and further off the screen ![]() |
Author: | Clayton [ Tue Jun 06, 2006 4:22 pm ] |
Post subject: | |
oops double post, but anyway, in that second for loop (the one inside your main loop) you should have the upper bounds of the for be upper(arrayName) instead of a hardcoded 1 because you are only accessing the data for the first bullet in your array and you can therefore not draw anymore than the first bullet |