also wie kann ich way-points in map-editor erstellen?

Übersicht BlitzBasic Allgemein

Neue Antwort erstellen

dimaster

Betreff: also wie kann ich way-points in map-editor erstellen?

BeitragFr, Apr 23, 2004 22:06
Antworten mit Zitat
Benutzer-Profile anzeigen
also hier ist map-editor:
Code: [AUSKLAPPEN]

Dim map(200,200)
Graphics 800,600,32
Tileset = LoadAnimImage("gfx/tileset2.bmp",32,32,0,45)
Maus = LoadImage("gfx/maus.bmp")

For x = 0 To 200
For y = 0 To 200
   map(x,y)=Rnd(40)
Next
Next

SetBuffer BackBuffer()
   Repeat
   If KeyDown(57) Then End

   For x = 0 To 200
   For y = 0 To 200
      DrawImage tileset,x*32-scrollx,y*32-scrolly,map(x,y)
   Next
   Next

If KeyDown(2) Then tile = 1
If KeyDown(3) Then tile = 2
If KeyDown(4) Then tile = 3
If KeyDown(5) Then tile = 4
If KeyDown(6) Then tile = 5
If KeyDown(7) Then tile = 6
If KeyDown(8) Then tile = 7
If KeyDown(9) Then tile = 8
If KeyDown(10) Then tile = 9
If KeyDown(11) Then tile = 10
If KeyDown(12) Then tile = 11
If KeyDown(13) Then tile = 12
If KeyDown(14) Then tile = 13
If KeyDown(15) Then tile = 14
If KeyDown(16) Then tile = 15
If KeyDown(17) Then tile = 16
If KeyDown(18) Then tile = 17
If KeyDown(19) Then tile = 18
If KeyDown(20) Then tile = 19
If KeyDown(21) Then tile = 20
If KeyDown(22) Then tile = 21
If KeyDown(23) Then tile = 22
If KeyDown(24) Then tile = 23
If KeyDown(25) Then tile = 24
If KeyDown(26) Then tile = 25
If KeyDown(27) Then tile = 26
If KeyDown(28) Then tile = 27
If KeyDown(29) Then tile = 28
If KeyDown(30) Then tile = 29
If KeyDown(32) Then tile = 30
If KeyDown(33) Then tile = 31
If KeyDown(34) Then tile = 32
If KeyDown(35) Then tile = 33
If KeyDown(36) Then tile = 34
If KeyDown(37) Then tile = 35
If KeyDown(39) Then tile = 36
If KeyDown(40) Then tile = 37
If KeyDown(41) Then tile = 38
If KeyDown(42) Then tile = 39
If KeyDown(43) Then tile = 40
If KeyDown(1) Then tile = 0

   If MouseDown(1) Then
      For x = 0 To 200
      For y = 0 To 200
         If RectsOverlap(x*32-scrollx,y*32-scrolly,32,32,MouseX(),MouseY(),1,1) Then
            map(x,y)=tile
         End If
      Next
      Next
   End If

   If KeyDown(208) Then scrolly = scrolly + 32
   If KeyDown(200) Then scrolly = scrolly - 32
   If KeyDown(205) Then scrollx = scrollx + 32
   If KeyDown(203) Then scrollx = scrollx - 32
   If KeyHit(31) Then save()
   If KeyHit(38) Then load()

   DrawImage maus,MouseX(),MouseY()

   Flip
   Cls
Forever
Function save()
karte$ = WriteFile("map1.map")
For x = 0 To 200
For y = 0 To 200
WriteLine(karte$,tile)
WriteInt(karte$,map(x,y))
Next
Next
CloseFile(karte$)
End Function
Function load()
karte$ = ReadFile("map1.map")
For x = 0 To 200
For y = 0 To 200
tile = ReadLine(karte$)
map(x,y) = ReadInt(karte$)
Next
Next
CloseFile(karte$)
End Function

also helft mir bitte!!
danke schon vorher Wink

Hubsi

BeitragSa, Apr 24, 2004 13:50
Antworten mit Zitat
Benutzer-Profile anzeigen
Kannst Du mit Types um? Dann würd ich bei Rechtsklick oder so einen neuen Eintrag erstellen und beim Speichern am Ende der Datei alles durchgehen und die Positionen speichern.
Beim Auslesen dann werden die Standartmapdaten eingelesen, dann mit einer While...Wend bis zum Dateiende die Positionen gelesen und gleich wieder Typeeinträge erstellen. Alternativ kannst Du für die Types auch Dim-Felder verwenden, je nachdem mit was es leichter für Dich ist Wink
Den ganzen Doag im Bett umanandflagga und iaz daherkema und meine Hendl`n fressn...

dimaster

BeitragSa, Apr 24, 2004 19:19
Antworten mit Zitat
Benutzer-Profile anzeigen
danke

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group