Computer Science Canada two subsctipts? eg. q(x)(y) |
Author: | Saad85 [ Sun Dec 11, 2005 5:59 pm ] |
Post subject: | two subsctipts? eg. q(x)(y) |
yea, im sure its not possible but is there any way to mimmic the effect? because for the racing game i'm working on, i need a collision system(obviously) but the map is really big. 1000x1500, actually. i COULD split the usable path and non-usable part and then use whatdotcolor collision but that takesway too much processing power and makes it slow. i decided that it would be way easier if i drew the path once, and used whatdotcolor to declare whether collision=true or false. the thing is.. i cant figure out a way to assign an x and y value to each of the pixels. could anyone help me out? if im just being retarded then plz tell me a better way to do it. |
Author: | Cervantes [ Sun Dec 11, 2005 6:12 pm ] | ||||
Post subject: | |||||
Do you know about 2D arrays?
The only time I've ever seen something like q (x)(y) is when I have an array of strings:
|
Author: | [Gandalf] [ Sun Dec 11, 2005 6:22 pm ] | ||||
Post subject: | |||||
You might be talking about arrays, in which case you need a 2d array. Look up multidimensional arrays in the tutorials section.
If not, you are most likely talking about records:
|
Author: | Saad85 [ Sun Dec 11, 2005 6:23 pm ] |
Post subject: | |
thx, i had completely forgotten about those. you are now my god |
Author: | Tony [ Sun Dec 11, 2005 6:35 pm ] | ||
Post subject: | |||
Cervantes wrote: The only time I've ever seen something like q (x)(y) is when I have an array of strings
Actually if you declear an array of arrays (2D array, but decleared as)
Then you'd have to access that as (1)(2), instead of (1,2) |