12-06-2004, 05:58 PM
Quote:I'm totally confused... Can anybody tell me how big array must I dim for 9x9 image in SCREEN 7 pls?
In SCREEN 7 you have 16 colours. Each one can be represented by 4 bits, that's the half of a byte. So you need an amount of memory that's equal to the number of pixels divided by two.
9x9 -> 81 pixels; 81/2 = 41 if we round it up.
You are creating an integer array to hold this data, and an integer takes 2 bytes. So the array has to have as much indexes as the number of bytes divided by two, rounded up:
41 bytes -> 41/2 = 21 if we round up.
So we need 21 integer array positions to store 41 bytes. We also need two extra array positions so GET can store width/height, that makes a total of 43 array positions.
As QB arrays begin in 0, you have to DIM your array this way:
Code:
DIM sprite%(42)
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