Pretty Terrain Renderer ===================== Create stunning landscapes and render it with procedural generation! Made with 1.5K blocks and a painful amount of artwork. controls down below ===================== ❤️ Love and ⭐ Fav this project and also follow me to support me, because projects like this takes a long time to make. ===================== this project is not mobile friendly ===================== Controls: ▹ Press the blue button to change modes. ▹ To draw manually, change the mode to draw, set edit to ON and press space to hide UI. then click to change the selected tile. ▹ Press the CPU button when edit is ON to fill the whole canvas with the selected tile (displayed on top right) ▹ Space: Toggle UI ▹ 1-5: Change selected tile (in editing) ▹ Q: Next tile (in editing) ▹ R: Refresh/rerender/whatever that's called =====================
How does this project work? ===================== ◯ Scratch lists are one dimensional, so to make a 2 dimensional tile world, I used some tricks by dividing the list into sections, and each section represents a row. each item in the list represents a tile and contains a value between 1 (grass) to 5 (snow) to get the x and y position of a tile in the list, the project uses this formulas: ▹ tile x in grid = (item no of tile - 1) % width ▹ tile y in grid = floor of ((item no of tile - 1) / width) then, the renderer will loop through the list and stamp the tiles on the x and y positions. ◯ For decorations, the renderer loops through the tiles. for each tile, it checks the value of the tile and then stamps a random variation of the decoration of each tile. ◯ For edges, it just goes to every tile, check the neighbours, and stamps each edge. it decides which sides have edges by checking if the current tile is higher than the neighbour on that side and is different from the current tile, using a hierarchy: ▹Snow > Forest > Grass > Water > Sand so snow will have edges on any side that meets any other different tile, and don't have edges on sides that meets other snows, making it seamless. ===================== You really did read all of this! here's a code for you to load: ▹0&111111111313131113331111131313111313131111111111 ===================== Upgraded ver of: https://scratch.mit.edu/projects/1306070883/ ===================== #Render ===================== Upgraded ver of: by my alt account