ID:268241
 
I'm trying to create a system where 256 objects are created on a tile. They each have different pixel_x and pixel_y so when they are layered on top of each other, it would look like a full tile. Each of the 256 tiles is a 2x2 icon. Any ideas how to create one?

Here is what I have so far:

for(var/y=16,y>=1,y--)
var/drawbit/D = new (src)
D.pixel_y += y*2
for(var/x=16,x>=1,x--)
D.pixel_x += x*2


This one obviously doesn't work..

~~> Dragon Lord
Unknown Person wrote:
I'm trying to create a system where 256 objects are created on a tile. They each have different pixel_x and pixel_y so when they are layered on top of each other, it would look like a full tile. Each of the 256 tiles is a 2x2 icon. Any ideas how to create one?


> for(var/y=16,y>=1,y--)
> for(var/x=16,x>=1,x--)
> var/drawbit/D = new (src)
> D.pixel_y += y*2
> D.pixel_x += x*2
>


I tried modifying the one you had. Not sure if it will work, but it's something to try.
Bump...
In response to Unknown Person
You didn't say what your problem was in enough detail. How doesn't it work, why doesn't it work, and what's wrong with what Jon88 posted?
In response to Crispy
Crispy wrote:
You didn't say what your problem was in enough detail. How doesn't it work, why doesn't it work, and what's wrong with what Jon88 posted?

When I use that, it just makes the bit's pixel_x go crazy, and makes the pixel_y add by 2. Nothing was wrong what Jon88 posted, I tried out other ways. The thing I'm trying to prevent is to manually code new drawbits and stick them on the map.

~~> Dragon Lord