Computer Science Canada Wall Collision |
Author: | Mr. T [ Tue Jun 20, 2006 10:18 pm ] | ||
Post subject: | Wall Collision | ||
The commented part of code is that which I wish to be helped with. Using whatdotcolour (preferably ), how could I determine if the expanding bars have collided with the outer boundaries that I have drawn. TheOneTrueGod suggested using grid collision, but I wanted to know if there is a whatdotcolour solution.
|
Author: | Mr. T [ Tue Jun 20, 2006 11:50 pm ] |
Post subject: | Alex's Opinion |
Ok, I managed to solve that problem on my own, but I have a new one. I know it's impossible to pass a flexible array into a procedure through a parameter, so how would I convert my code so that I can draw an increasing # of walls after the first one is complete. I have already gotten a few suggestions from TheOneTrueGod, but I'm still a little bit confused as to how I would implement it in my code. |
Author: | Mr. T [ Wed Jun 21, 2006 4:04 am ] | ||
Post subject: | Alex's Opinion | ||
^Read the post above, then look at the code below:
|
Author: | zylum [ Thu Jun 22, 2006 12:00 am ] | ||
Post subject: | |||
you can pass a flexible array to a procedure but you cant change its dimension once in the procedure.. ie:
if that doesnt help, can you explain a little further what you need this for? |
Author: | Mr. T [ Thu Jun 22, 2006 12:15 am ] |
Post subject: | Alex's Opinion |
I know...so how would you work around this problem? I will need to update the flexible array. |
Author: | Tony [ Thu Jun 22, 2006 12:22 am ] |
Post subject: | |
you could pass a reference to the array using a pointer |
Author: | Mr. T [ Thu Jun 22, 2006 12:27 am ] |
Post subject: | Alex's Opinion |
I didn't understand a single thing you just said. Care to link me to the necessary tutorials? |
Author: | Tony [ Thu Jun 22, 2006 12:34 am ] |
Post subject: | |
pointers part of the Turing Walkthrough actually |
Author: | Mr. T [ Sat Jun 24, 2006 9:52 pm ] |
Post subject: | Alex's Opinion |
I read over the tutorial, but I'm still not sure how pointers will allow me to update a flexible array that has been passed into a procedure through a paramater...? |