The red lines marked on the image are the walls that will go inbetween each of the colour areas. I know how to loop through each tile and work out if the tile next to it in any of the four directions (North, South, East, West) is a different colour and hence a wall is required. I don’t know an efficient way to store the information and cancel out any walls that are found from looping through every tile.
Obviously the first time I scan a tile with the one below registering a different colour will indicate a wall. But then when I look at that 2nd tile in my loop, it will also register the need for a wall. So 2 walls will be created.
I would like to know if there is any easy way to calculate this wall information another way, but more importantly how can I store this information in say another int[,] array so I can generate the walls from there. Every tile in my game is a 1x1 quad rotated to point upwards. So the int array relates to the X and Z coordinates of the tile itself.
Any help would be greatly appreciated. It’s 6:12am and I have been up all night trying to figure this out for a game I am making.
One solution would be to store the wall information in a four-dimensional bool-array. Since a wall sits between two tiles, you need the coordinates of two neighboring tiles. The dimensions or the array would be:
0: tile A x-coordinate
1: tile A y-coordinate
2: tile B x-coordinate
3: tile B y-coordinate
The array would have lengths equal to the x and y lengths of your grid + 1 (for the non-existent tile at max + 1 coordinates, which doesn’t have to correspond to tiles for the process of checking for walls). For border cases, you would always set the bool to true instead of attempting to access the tiles array which would be out of bounds).
To create objects you simply place LEGO-style bricks in virtual space. Once you’ve built your model you can export to an STL file for printing on a Makerbot or similar printer. Aimed at the very young, Tiles offers a number of building styles including additive building by dropping blocks and “chip-way” that lets you remove material from a larger block. Unlike tools like Printcraft, which translate game worlds into STL files, this is a true CAD tool, albeit one with considerably reduced complexity. https://forpc.onlhttps://jiofilocalhtml.run
,To create objects you simply place LEGO-style bricks in virtual space. Once you’ve built your model you can export to an STL file for printing on a Makerbot or similar printer. Aimed at the very young, Tiles offers a number of building styles including additive building by dropping blocks and “chip-way” that lets you remove material from a larger block. Unlike tools like Printcraft, which translate game worlds into STL files, this is a true CAD tool, albeit one with considerably reduced complexity.
In the tile-based approach, each visual element is broken down into smaller pieces, called tiles, of a standard size. These tiles will be arranged to form the game world according to pre-determined level data - usually a 2D array. Tutuapp9AppsAptoide