September 19, 2018, 02:51:28 PM

 



Rock Tile Generator
Rock Tile Generator
Previous Image | Next Image
Description: I spend the morning and part of the afternoon working on some code to create a rock tile generator that can be used for games. Most of the times they should be seamless(I hope)

It works by creating a array of 32x32, then by placing a amount of points with a unique number in them. I then grow those and keep a adjustable distance between the different rock numbers, I also if the rock comes near the edge put that current point to the opposide edge. For the last pass I then add 2 colors on the edges(and inside) for shading.

It only creates one 32x32 tile every time and draws these on the screen next to each other in different sizes.

https://cromdesi.home.xs4all.nl/html5/generatortilestone/MonkeyGame.html

edit : I made a version with more various tiles to break the pattern..

That one creates a number of tiles based on the original. It erases the center part and regrows the center so that they look different but still connect at the edges,

https://cromdesi.home.xs4all.nl/html5/generatorvartilestone/MonkeyGame.html


The code is on my monkeyx github(pakz001)
Picture Stats:
Views: 1851
Filesize: 95.8kB
Height: 580 Width: 772
Posted by: Pakz at October 30, 2017, 01:06:21 PM


Comments (0)



Powered by: SMF Gallery