Computer Science Canada need help with my enemy plane again, this time i've the code |
Author: | yingmu [ Sat Jun 11, 2005 1:03 pm ] | ||
Post subject: | need help with my enemy plane again, this time i've the code | ||
however at the loop part it says that my interceptor variable for the procedure addInterceptor haveny been declared, but i did my code based on my partners code which is flying gun shots, and he didnt decalre his shots(interceptor) variable either but his worked, so plz tell me how to fix it, thx a million.
|
Author: | Cervantes [ Sat Jun 11, 2005 1:38 pm ] | ||
Post subject: | |||
You never declared a interceptor array. You made the interceptorType, but no actual variable. To make a variable from a type, follow this example:
|
Author: | yingmu [ Sat Jun 11, 2005 5:02 pm ] | ||
Post subject: | |||
wait wat do u mean, u mean like this?
but it still doesnt work, plz explain it further |
Author: | Cervantes [ Sat Jun 11, 2005 5:13 pm ] | ||||
Post subject: | |||||
Yeah, the problem now is you've got a variable that you're trying to pass into your procedures as an array. Change the variable to an array. Now, we get another problem because the upper bounds of your parameter arrays and the upper bounds of your actual array are different. We can use an asterisk (*) to symbolize the upper bounds end of the array. You might recognize this because you can use it when dealing with strings to symbolize the last character:
This works because a string is essentially an array of characters. So, you'll need to apply this concept to your program. Try following this example.
|