O
Oliver Melroy
Guest
Hey! I am currently working on a project, and I watched this video [
] on how to make AutoTiling on objects. This video shows how to do the outsides, but not the insides of the Tiles (As in the inner corners). The code will be down below for the autoTiling script, any help is appreciated. I also asked in the comments a few weeks ago, with no answer, so I came here. Thanks!
P.S: The image below can help with the code.
AutoTiling Script:
WR = Tile right side
WL = Tile left side
WU = Tile top
WD = Tile bottom
Also here is the image of the tiles with helpful info:
Original Tileset:
P.S: The image below can help with the code.
AutoTiling Script:
WR = Tile right side
WL = Tile left side
WU = Tile top
WD = Tile bottom
Code:
BS = sprite_width; //Base Size
image_speed = 0;
WR = position_meeting(x + BS, y, oDirt);
WL = position_meeting(x - BS, y, oDirt);
WU = position_meeting(x, y - BS, oDirt);
WD = position_meeting(x, y + BS, oDirt);
if (!WL and !WU and !WD and !WR)
image_index = 0;
else if (!WL and !WU and WR and WD)
image_index = 1;
else if (WR and WL and !WU and WD)
image_index = 2;
else if (WL and WD and !WR and !WU)
image_index = 3;
else if (!WR and WL and WU and WD)
image_index = 4;
else if (WU and WL and !WR and !WD)
image_index = 5;
else if (WL and WR and WU and !WD)
image_index = 6;
else if (!WL and !WD and WU and WR)
image_index = 7;
else if (!WL and WU and WD and WR)
image_index = 8;
else if (WL and WR and WD and WU)
image_index = 9;
else if (!WL and !WU and !WD and WR)
image_index = 10;
else if (WL and !WU and !WD and WR)
image_index = 11;
else if (WL and !WU and !WD and !WR)
image_index = 12;
else if (!WL and !WU and !WR and WD)
image_index = 13;
else if (!WL and !WR and WU and WD)
image_index = 14;
else if (!WL and !WR and !WD and WU)
image_index = 15;
Original Tileset: