ScratchData LogoScratchData
Back to gtoal's profile

Finite map generator

GTgtoal•Created March 18, 2016
Finite map generator
12
7
400 views
View on Scratch

Instructions

This uses the same stateless algorithm as my infinite map generator ( https://scratch.mit.edu/projects/114733627/ ) except here we limit the size by generating and testing random maps until we get a good one. (In this test, any size between 200 and 300 non-empty tiles) The code requires one array element of storage space per non-empty tile.

Description

It took me a little time to get the basic code working and I haven't yet gone back over it to clean it up and optimise it. TO DO: suppress display while searching for a valid map that meets the constraints; don't allow scrolling off the active area; work on the case with 4 exits (either a crossroads or two non-connected segments) which causes disjoint maps. Optimise map drawing rather than drawing entire connected map on each scroll? (can't be done on the fly, has to have a stored data structure mapping the graph to an array)

Project Details

Project ID102170546
CreatedMarch 18, 2016
Last ModifiedJune 27, 2016
SharedMarch 18, 2016
Visibilityvisible
CommentsAllowed