I have an idea for a game I want to make. But I have to know how to make and array for a bitmap. I really need someones help and i would be very happy if someone could help.
create array for bitmap
BlitzPlus Forums/BlitzPlus Programming/create array for bitmap Do you mean an array of pointers to more than one bitmap or just read a bitmap's pixel colours into an array, or something else?
in case of the pointers:
Create a bank of size: amount_of_images * 4
And poke an int with the handle of the image at each 4th position in the bank.
Likewise, read the images out with peekint, each 4th position..
In the store-bitmap-in-array-case..:
Why would you want that, unless it's a workaround for not having to access the harddisk? There are smarter methods for that..
Create a bank of size: amount_of_images * 4
And poke an int with the handle of the image at each 4th position in the bank.
Likewise, read the images out with peekint, each 4th position..
In the store-bitmap-in-array-case..:
Why would you want that, unless it's a workaround for not having to access the harddisk? There are smarter methods for that..
You could use it for per-pixel collision detection/destruction like in worms :)
In the store-bitmap-in-array-case..:
Why would you want that, unless it's a workaround for not having to access the harddisk? There are smarter methods for that..
It's useful if you have to look up a pixel value and check to see if a pixel is at a certain co-ord, without having to use a read pixel command, which would be slower. Even banks are slower than 2d arrays in general.