Hi all,
What is the best way of implimenting blocks into a tile oriented game? blocks like fences, sign posts, chairs maybe and generally things that have unique data to each block. for example each sign post has unique text attached to each one. The way I have it implimented now is giving me trouble with the unique block.
I’ve got it implimented in the same way my tiles are, the tile class initiates all the tiles. Heres a code snippit of what I mean.
FROM Block.class
public class Block{
private static SpriteSheet spriteSheet = new SpriteSheet("/spriteSheets/block_sheet.png");
public static Block[] blocks = new Block[256];
public static Block empty = new blockVoid (spriteSheet, 0xFF00FF00, 0);
public static Block fence = new blockFence (spriteSheet, 0xFFFF0000, 1);
public static Block sign = new blockSign (spriteSheet, 0xFF, 2);
this doesn’t really allow for individual setup because if you change it there then it changes for all of the objects.
Thanks for the help,
James