Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'Randomised' map fill
#1
Basically i have 4 grass tiles and when thrown all over the map randomly it looks really nice... however it takes ages and i'v only done three test maps and they were to post on here!

My question, is it possible to have a map fill that will randomly place these over the map on the ground, would save so much time.

If it is possible, some help with the coding would be good xD

If it isnt, looks like i'm going to have to have a fill that specifically puts them over the map in pre-set locations, which will take forever to code -.-

Cheers!
Foxy
Reply
#2
get the locations of the tiles on the tile sheet and blt them to the .ground using some for loops.

Code:
For x = 1 To max_mapx
    For y = 1 To max_mapy
        f = Int(Rnd(3) * 3)

        With Map.Tile(x, y)
            Select Case f
                Case 0
                    .Ground = ' tile 1
                Case 1
                    .Ground = ' tile 2
                Case 2
                    .Ground = ' tile 3
                Case 3
                    .Ground = ' tile 4
            End Select
        End With
    Next y
Next x

Obviously just a mock up but that's how I would do it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)