05-09-2003, 06:11 AM
That constant zero is 'cause QB orders its arrays in columns and not in files. In C, for example, if you have a 4x4 array you have in fact a 4 files array of 4 columns.
When you have an array a%(10,10), C stores it in files, so you have in memory (1,1), (1,2), (1,3)...(2,1),(2,2)...(10,10). QB stores it in columns, so you have (1,1), (2,1), (3,1), ...,(1,2), (2,2), ... (10,10).
A sprite is just a list of numbers stored one after another in memory. When you set up an array that contains several sprites, you have data for the first sprite, then data for the second, then data for the third and so on, allocated in memory one right after the previous. When you PUT a sprite, the last parameter is, in fact, some kind of pointer that tells QB where the data it has to plot starts. As QB stores the data in columns and not in rows, you have to point your nth sprite as (0,n) and not as (n,0).
I know this is VERY confusing
When you have an array a%(10,10), C stores it in files, so you have in memory (1,1), (1,2), (1,3)...(2,1),(2,2)...(10,10). QB stores it in columns, so you have (1,1), (2,1), (3,1), ...,(1,2), (2,2), ... (10,10).
A sprite is just a list of numbers stored one after another in memory. When you set up an array that contains several sprites, you have data for the first sprite, then data for the second, then data for the third and so on, allocated in memory one right after the previous. When you PUT a sprite, the last parameter is, in fact, some kind of pointer that tells QB where the data it has to plot starts. As QB stores the data in columns and not in rows, you have to point your nth sprite as (0,n) and not as (n,0).
I know this is VERY confusing
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i