Discord
Login
Community
DARK THEME

Procedural generation in microstudio.

i saw some games with procedural generation here but... i really don't understood this so, can some one help??

You create 4 Sprites - e.g. each with a different color and name them "red", "blue", "yellow", "green"

init = function()
  name = ["red", "blue", "yellow", "green"]
  map = new Map( 20, 10, 15, 15 )
  for w = 0 to map.width -1
    for h = 0 to map.height -1
      map.set(w,h, name[ random.nextInt(4) ])
    end
  end
end

draw = function()
  screen.drawMap( map, 0, 0, 300, 150 )
end

You always have a new dynamically generated map.

What kind of procedural generation? Top-down terrain?

@TwiceUponATime is a top-down terrain, i wanna make a farm game

@Loginus thank you toooooooooooooo much

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community