The How part (4) - Automating tile generation for lower levels - http://droftware.github.io/tiles-generator/