Advertisement
Brandan

Untitled

Aug 5th, 2014
568
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.72 KB | None | 0 0
  1.     Public Function GenerateMap(ByVal size As Integer)
  2.  
  3.         Dim bitmap As New Bitmap(128, 128)
  4.         Dim initial As UShort = 800
  5.         Dim cur As UShort = initial
  6.         Dim r As New FastRandom.FastRandom
  7.  
  8.         For x As Integer = 0 To size - 1
  9.             For y As Integer = 0 To size - 1
  10.                 If cur > 0 Then
  11.                     Try
  12.                         bitmap.SetPixel(x, y, Color.FromArgb(0, (cur \ 4), 0))
  13.                     Catch
  14.                         bitmap.SetPixel(x, y, Color.Yellow)
  15.                     End Try
  16.                 Else
  17.                     bitmap.SetPixel(x, y, Color.Blue)
  18.                 End If
  19.             Next
  20.         Next
  21.  
  22.         Return bitmap
  23.  
  24.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement