Ich hab mal einen kleinen Code dazu geschrieben, aber wenn ich diesen ausführen möchte lädt es nur.
Code: Alles auswählen
InitSprite()
InitKeyboard()
Global Biom, Groesse, SteigungX, SteigungY, aktX = 0, lastY = 10, y
Global Dim Karte(160,90)
Procedure Generate()
Repeat
Biom = Random(3)
If aktX <= 120
Groesse = Random(40,20)
aktX + Groesse
Else
Groesse = 160 - aktX
EndIf
For x = aktx - Groesse To aktX
SteigungX = Random(3,1)
SteigungY = Random(5,0)
If Random(1) = 0
y = lastY + Round(SteigungY/SteigungX,#PB_Round_Nearest)
Else
y = lastY - Round(SteigungY/SteigungX,#PB_Round_Nearest)
EndIf
If y < 0
y = 0
ElseIf y > 90
y = 90
EndIf
lastY = y
Karte(x,y) = Biom
Next
Until aktX = 160
EndProcedure
Procedure DrawMap()
For x = 0 To 1600 Step 10
For y = 0 To 900 Step 10
DisplaySprite(Karte(x/10,y/10), x, y)
Next
Next
EndProcedure
OpenScreen(1600, 900, 32, "Test")
Generate()
CreateSprite(0, 10, 10)
If StartDrawing(SpriteOutput(0))
Box(0,0,10,10,RGB(255,255,0))
Box(1,1,8,8,RGB(0,0,0))
StopDrawing()
EndIf
CreateSprite(1, 10, 10)
If StartDrawing(SpriteOutput(1))
Box(0,0,10,10,RGB(255,0,0))
Box(1,1,8,8,RGB(0,0,0))
StopDrawing()
EndIf
CreateSprite(2, 10, 10)
If StartDrawing(SpriteOutput(2))
Box(0,0,10,10,RGB(0,255,0))
Box(1,1,8,8,RGB(0,0,0))
StopDrawing()
EndIf
CreateSprite(3, 10, 10)
If StartDrawing(SpriteOutput(3))
Box(0,0,10,10,RGB(0,0,255))
Box(1,1,8,8,RGB(0,0,0))
StopDrawing()
EndIf
Repeat
FlipBuffers()
ClearScreen(RGB(0, 0, 0))
ExamineKeyboard()
DrawMap()
Delay(1)
Until KeyboardPushed(#PB_Key_Escape)