Da euch allen langweilig ist...

Übersicht BlitzBasic Allgemein

Gehe zu Seite 1, 2  Weiter

Neue Antwort erstellen

 

ZAiMoN

Betreff: Da euch allen langweilig ist...

BeitragDo, Apr 08, 2004 14:16
Antworten mit Zitat
Benutzer-Profile anzeigen
...könnt ihr mir ja helfen einen map-editor für ISO zu erstellen.

jo also ich weiss garnicht wo ich anfangen soll, habe bis jetzt auch keinen map editor erstellt aber wird langsam zeit, da ich es für mein neues game brauchen werde.

bissle code wäre am besten

tilewidth = 64
tileheight = 32
In Online Games Gilt:

Luck Beats Skill
Lag Beats Skill
Cheat Beats Skill

rambo256

BeitragDo, Apr 08, 2004 14:45
Antworten mit Zitat
Benutzer-Profile anzeigen
Hab schon einen erstellt,der besteht so aus 2 Teilen:
1. Man kann die Tiles in 2d ansicht anordnen wie man will,abspeichern,laden.
2. Man kann dann im betrachter seine 2d-map,die man im editor gebastelt hat,sich in iso-perpektive anschauen.

Oder willst du die Tiles schon direkt im Editor in der Iso-Pespektive anordnen?
 

ZAiMoN

BeitragDo, Apr 08, 2004 15:45
Antworten mit Zitat
Benutzer-Profile anzeigen
hmmm ja so hatte ich ich es mit ungefähr vorgestellt. Very Happy

kann ich den code haben?

Bekommst dann auch einen eintrag bei den credits im fertigen game Wink
In Online Games Gilt:

Luck Beats Skill
Lag Beats Skill
Cheat Beats Skill

rambo256

BeitragDo, Apr 08, 2004 15:52
Antworten mit Zitat
Benutzer-Profile anzeigen
Ok,warte,oder gib mir mal deine e-mail

rambo256

BeitragDo, Apr 08, 2004 15:54
Antworten mit Zitat
Benutzer-Profile anzeigen
Also hier der Quellcode für den Editor:

Code: [AUSKLAPPEN]

; ISO-Map Editor v.1.0

Graphics Width,Height,Farbtiefe,Anzeige

SetBuffer BackBuffer()


Const Width = 800
Const Height = 600
Const Farbtiefe = 32
Const Anzeige = 2
Const Tile_Width = 64
Const Tile_Height = 64
Const Tile_Map_Width_max = 50
Const Tile_Map_Height_max = 50
Const key_speichern = 31
Const key_laden = 38
Const Max_tiles_X = 50
Const Max_tiles_Y = 50
Const Key_UP = 200
Const Key_Left = 203
Const Key_Right = 205
Const Key_Down = 208
Const scroll_speed = 1

Global Max_tiles = 6
Global Dateiname$
Global Tileset$ = "World_einfach.bmp"
Global Mouse_gfx$ = "pointer.bmp"


; GFX's

Tile_map_gfx = LoadAnimImage(Tileset$,Tile_width,Tile_height,0,Max_tiles)
Mouse_gfx = LoadImage(Mouse_gfx)
MaskImage Mouse_gfx,255,0,255
MaskImage Tile_map_gfx,255,0,255




; Hauptmenü

Text 150,200,"Tile Map Editor  v.1.0"
Text 175,220,"1. Neue Map"
Text 175,230,"2. Map laden und bearbeiten"
Locate 175,245
Menüauswahl$ = Input$()



; Wenn Menüasuwahl=1,dann neue Map

If Menüauswahl = "1" Then
   Cls
   Text 250,200,"Mapname:"
   Locate 320,200
   dateiname$ = Input$()
    Dim Tile_matrix(Max_tiles_X,Max_tiles_Y)
For i = 0 To Max_tiles_X
   For e = 0 To Max_tiles_Y
      Tile_matrix(i,e) = t
   Next
Next


; Wenn Menüauswahl=2,dann Map laden

EndIf
If Menüauswahl = "2" Then
   Cls
   Text 200,200,"Name der zu ladenden Map:"
   Locate 405,200
   dateiname$ = Input$()
   dateiname$ = ReadFile(Dateiname$+".txt")
   Dim Tile_matrix(Max_tiles_X,Max_tiles_Y)
      For i = 0 To Max_tiles_X
         For e = 0 To Max_tiles_Y
            Tile_matrix(i,e) = ReadInt (Dateiname$)
         Next
      Next
   CloseFile Dateiname$
EndIf






;Hauptschleife


Repeat
Cls


;Initialisierung


Mouse_X = MouseX()
Mouse_Y = MouseY()
Button  = GetMouse()
Mouse_tile_X = ((Mouse_x)/Tile_width)-Map_X
Mouse_tile_Y = (Mouse_y/Tile_height)-Map_Y


;Buttons


;tile zeichnen
If button = 1 Then
   DrawImage Tile_map_gfx,Mouse_tile_x*Tile_width,Mouse_tile_y*tile_height,t
   tile_matrix(mouse_tile_x,mouse_tile_y) = t
EndIf

;1 tile vor
If button = 2 And t<Max_tiles Then
   t= t+1
EndIf

;1 tile zurück
If button = 3 And t>0 Then
   t=t-1
EndIf

;Map speichern
If KeyDown(key_speichern) Then
   test = WriteFile(dateiname+".txt")
         For x_tile = 0 To Max_tiles_X
            For y_tile = 0 To Max_tiles_Y
               WriteInt test,tile_matrix(x_tile,y_tile)
            Next
         Next
   CloseFile test
EndIf

;Map laden
If KeyDown(key_laden) Then
   test = ReadFile(dateiname+".txt")
      For tile_x = 0 To Max_tiles_X
         For tile_y = 0 To Max_tiles_Y
            tile_matrix(tile_x,tile_y)=ReadInt(test)
         Next
      Next
   CloseFile test 
EndIf

; Mit hoch,runter,links,rechts oder mit der Maus scrollen

If Float(map_X) > Float(-Max_tiles_X+(Width/tile_Width)) Then
If KeyDown(key_right) Or Mouse_X>790 Then Map_X = Map_X-scroll_speed
EndIf
If map_X < 0  Then
If KeyDown(key_left) Or Mouse_X <10 Then Map_X = Map_X+scroll_speed
EndIf
If Map_Y < 0
If KeyDown(key_up) Or Mouse_y <10 Then Map_Y = Map_Y+scroll_speed
EndIf
If Float(map_Y) > Float(-Max_tiles_Y+(Height/tile_Height))
If KeyDown(key_down) Or Mouse_y >590 Then Map_Y = Map_Y-scroll_speed
EndIf



;Tile-matrix wird gezeichnet
For tile_x = 0 To Max_tiles_X
   For tile_Y = 0 To Max_tiles_Y
      DrawImage tile_map_gfx,(tile_X+Map_X)*Tile_width,(tile_y+Map_y)*Tile_height,tile_matrix(tile_x,tile_Y)
   Next
Next



Color 0,0,0
;Mouse_gfx$
DrawImage tile_map_gfx,0,0,t
DrawImage Mouse_gfx,Mouse_x,Mouse_y
Text 5,580,"Mouse_tile_X: "+Mouse_tile_X
Text 150,580,"Mouse_tile_Y: "+Mouse_tile_y
Text 295,580,"speichern: s"
Text 430,580,"laden: l"
Text 5,560,"Map_X: "+Map_X
Text 100,560,"Map_Y: "+Map_Y
;Tile_kasten
Rect 0,0,64,64,0

Flip
Until KeyDown(1)

rambo256

BeitragDo, Apr 08, 2004 15:55
Antworten mit Zitat
Benutzer-Profile anzeigen
Und hier der Betrachter:

Code: [AUSKLAPPEN]

; Test proggi zum öffnen von iso_maps und zeichnen

Graphics 800,600,32,2

SetBuffer BackBuffer()


Const Tile_width_gfx = 64
Const Tile_Height_gfx = 64
Const Tile_Map_Width_max = 12
Const Tile_Map_Height_max = 12
Const Max_tiles_X = 50
Const Max_tiles_Y = 50
Const Key_UP = 200
Const Key_Left = 203
Const Key_Right = 205
Const Key_Down = 208
Const Max_tiles = 0
Const scroll_speed = 1


Global Tile_Width = Tile_width_gfx
Global Tile_Height = Tile_height_gfx/2
Global Mouse_X = MouseX()
Global Mouse_Y = MouseY()
Global MouseX_tile
Global MouseY_tile
Global Schaf_X = 200
Global Schaf_Y = 100
Global SchafX_tile
Global SchafY_tile
Global OldMouse_X
Global OldMouse_Y
Global OldMouseX_tile
Global OldMouseY_tile
Global Button = GetMouse()
Global walk = True
Global Dateiname$
Global Tileset$ = "world_einfach_iso.bmp"
Global Mouse_gfx$ = "pointer.bmp"



; GFX laden
Tile_map_gfx = LoadAnimImage(Tileset$,Tile_width_gfx,Tile_height_gfx,0,6)
Mouse_gfx = LoadImage(Mouse_gfx$)
Schaf = LoadImage("Schaf.bmp")
MaskImage Schaf, 0,0,0
MidHandle Schaf
MaskImage Mouse_gfx,255,0,255
MaskImage Tile_map_gfx,0,0,0




Text 150,200,"Welche Map soll geladen werden: "
Locate 405,200
Dateiname$ = Input$()

;Dim-Array für die Map,mit den Werten von Test.txt

Dim Tile_matrix(Max_tiles_X,Max_tiles_Y)
   Dateiname$ = ReadFile(Dateiname$+".txt")
      For tile_x = 0 To Max_tiles_X
         For tile_y = 0 To Max_tiles_Y
            tile_matrix(tile_x,tile_y)= ReadInt (Dateiname$)
         Next
      Next
CloseFile Dateiname$


;Hauptschleife

Repeat

Cls


;Initialisierung

Mouse_X = MouseX()
Mouse_Y = MouseY()
MouseX_tile = (Mouse_X/Tile_width)-Map_X
MouseY_tile = (Mouse_Y/Tile_height)-Map_Y
SchafX_tile = (Schaf_X/Tile_width)-Map_X
SchafY_tile = (Schaf_Y/Tile_height)-Map_Y
button = GetMouse()

; Mit hoch,runter,links,rechts oder mit der Maus scrollen

If map_X > -Max_tiles_X-3000 Then
If KeyDown(key_right) Or Mouse_X>790 Then Map_X = Map_X-scroll_speed
EndIf
If map_X < 0  Then
If KeyDown(key_left) Or Mouse_X <10 Then Map_X = Map_X+scroll_speed
EndIf
If Map_Y < 0
If KeyDown(key_up) Or Mouse_y <10 Then Map_Y = Map_Y+scroll_speed
EndIf
If Map_Y > -Max_tiles_Y
If KeyDown(key_down) Or Mouse_y >590 Then Map_Y = Map_Y-scroll_speed
EndIf


;Tile Plotter

ig=True

For y=0 To Max_tiles_y
 ig=1-ig
 For x=1 To Max_tiles_X
  plotx = x*TILE_WIDTH+ig*Tile_Height 
  ploty = y*TILE_HEIGHT/2

  DrawImage Tile_map_gfx,(plotx+Map_X)-64,(ploty+Map_Y)-13,tile_matrix(x,y)
 Next
Next


;Schafbewegung

If button = True Then
   OldMouseX_tile = MouseX_tile
   OldMouseY_tile = MouseY_tile
   OldMouse_X = Mouse_X
   OldMouse_Y = Mouse_Y
EndIf

If SchafX_tile <> OldMouseX_tile Or SchafY_tile <> OldMouseY_tile And SchafX_tile > 0 And SchafX_tile < Max_tiles_X And SchafY_tile > 0 And SchafY_tile < Max_tiles And walk=True Then
   If SchafX_tile < OldMouseX_tile Then Schaf_X = Schaf_X +1
   If SchafY_tile < OldMouseY_tile Then Schaf_Y = Schaf_Y +1
   If SchafX_tile > OldMouseX_tile Then Schaf_X = Schaf_X -1
   If SchafY_tile > OldMouseY_tile Then Schaf_Y = Schaf_Y -1
EndIf

If SchafX_tile = OldMouseX_tile And SchafY_tile = OldMouseY_tile Then
   walk = False
   Else walk = True 
EndIf

;Daten

Color 255,255,255

Text 5,500,"Mouse_X: "+Mouse_X
Text 5,510,"Mouse_Y: "+Mouse_Y
Text 5,520,"MouseX_tile: "+MouseX_tile
Text 5,530,"MouseY_tile: "+MouseY_tile
Text 150,500,"OldMouse_X: "+OldMouse_X
Text 150,510,"OldMouse_Y: "+OldMouse_Y
Text 150,520,"OldMouseX_tile: "+OldMouseX_tile
Text 150,530,"OldMouseY_tile: "+OldMouseY_tile
Text 295,500,"Schaf_X: "+Schaf_X
Text 295,510,"Schaf_Y: "+Schaf_Y
Text 295,520,"SchafX_tile: "+SchafX_tile
Text 295,530,"SchafY_tile: "+SchafY_tile

DrawImage Schaf,schaf_X,Schaf_Y
DrawImage Mouse_gfx,Mouse_x,Mouse_y


Flip
Until KeyDown(1)
 



Falls du auch die tilesets haben möchtest,dann gib mir deine e-mail.
Das mit der Scahfbewegung klappt leider noch nict so ganz Crying or Very sad

TheShadow

Moderator

BeitragDo, Apr 08, 2004 15:59
Antworten mit Zitat
Benutzer-Profile anzeigen
1. Tile 64x32 ist NICHT Iso-konform - du wirst keine saubere Darstellung bekommen - die nächste Größe die dadran kommt ist 64x31

2. Habe ich sowas gecodet - kommt bald Beta
AMD64 3500+ | GeForce6600GT 128MB | 1GB DDR | WinXPsp2
 

ZAiMoN

BeitragDo, Apr 08, 2004 16:01
Antworten mit Zitat
Benutzer-Profile anzeigen
Meine email: HeroRuleZ@hotmail.com

Meinst du mit schaf das mapscrollen?
In Online Games Gilt:

Luck Beats Skill
Lag Beats Skill
Cheat Beats Skill

rambo256

BeitragDo, Apr 08, 2004 16:03
Antworten mit Zitat
Benutzer-Profile anzeigen
genau.....
Ich bekomm das imomen nicht hin....
ALso das Map-scrollen bekomm ich hin.
 

ZAiMoN

BeitragDo, Apr 08, 2004 16:06
Antworten mit Zitat
Benutzer-Profile anzeigen
TheShadow hat Folgendes geschrieben:
1. Tile 64x32 ist NICHT Iso-konform - du wirst keine saubere Darstellung bekommen - die nächste Größe die dadran kommt ist 64x31


was soll das den nun ?

Iso maps sind doch entweder 4/3 oder 2/1
und meine ist eben 2/1 bis jetzt sieht alles richtig aus.


Willst du meine funktion zum mapscrollen mit den pfeiltasten? Ich habe noch eine Zweite mit der Maus aber die Funktioniert noch nicht fehler frei.

Code: [AUSKLAPPEN]

Global PlotX, PlotY, RealX, RealY, Scrollx, Scrolly
Global movespeed = 2 ;geschwindigkeit fürsscrollen


Function Move_Map()
If KeyDown(203) Then scrollx = scrollx -movespeed
If KeyDown(205) Then scrollx = scrollx +movespeed
If KeyDown(200) Then scrolly = scrolly -movespeed
If KeyDown(208) Then scrolly = scrolly +movespeed
End Function

Function Draw_Map()
For y=0 To 20
 For x=0 To 20
  Tile_Plotter(x,y)
  DrawImage Tile,plotx +scrollx,ploty +scrolly
 Next
Next
END function

Function Tile_Plotter(WorldX,WorldY)
  PlotX = (WorldX-WorldY)*TILEWIDTH/2
  Ploty = (WorldX+WorldY)*TILEHEIGHT/2
End Function
In Online Games Gilt:

Luck Beats Skill
Lag Beats Skill
Cheat Beats Skill
  • Zuletzt bearbeitet von ZAiMoN am Do, Apr 08, 2004 16:11, insgesamt einmal bearbeitet

rambo256

BeitragDo, Apr 08, 2004 16:08
Antworten mit Zitat
Benutzer-Profile anzeigen
sry,kann dir die pics nicht schicken,weiol web.de zicken macht...
kann ich die nicht irgendwo kostenlos hochladen?

TheShadow

Moderator

BeitragDo, Apr 08, 2004 16:12
Antworten mit Zitat
Benutzer-Profile anzeigen
versuch mal so ein tile zu machen und mache ein Gitter auf so ein Tile (also einfach so ein Kreuz in Iso-perspektive)

und dann kachele es im Malprogramm. Das wird nicht klappen - du wirst dann so "Treppeneffekte" sehen

4:3??? wo hast du blos sowas her?
AMD64 3500+ | GeForce6600GT 128MB | 1GB DDR | WinXPsp2
 

ZAiMoN

BeitragDo, Apr 08, 2004 16:12
Antworten mit Zitat
Benutzer-Profile anzeigen
ehm keine Ahnung hab dir mal den code fürs mapscrollen reingepackt.

Kannst sie mir auch Heute abend zu schicken.

hmm ich probiers mal

das mit 4:3 hatte ich in einem englishen tut gelesen ist aber schon bissle älter
In Online Games Gilt:

Luck Beats Skill
Lag Beats Skill
Cheat Beats Skill

rambo256

BeitragDo, Apr 08, 2004 16:36
Antworten mit Zitat
Benutzer-Profile anzeigen
also ich habe keinen Treppeneffekt,ich hab da so als Testisogfx's
die 1.Form aus dem Iso-advanced Thread genommen,und die einfach farbig gemacht.
Hoffe ihr kennt den Thread noch,da waren so weiße Formen,die bilder waren auch 64*64 pixel groß
 

ZAiMoN

BeitragDo, Apr 08, 2004 21:12
Antworten mit Zitat
Benutzer-Profile anzeigen
ehm und hier habe ich es nochmal gefunden ... da wird auch 4:3 beschrieben ....

https://www.blitzforum.de/view...hlight=iso
In Online Games Gilt:

Luck Beats Skill
Lag Beats Skill
Cheat Beats Skill

TheShadow

Moderator

BeitragFr, Apr 09, 2004 12:48
Antworten mit Zitat
Benutzer-Profile anzeigen
also habe mir tas tut runtegeladen. Das 64x32 Bild ist in Wirklichkeit ein 62x32 Shape

Eine Seite bei einem 4:3 Tile würde so aussehen:

Code: [AUSKLAPPEN]

X
 X
  XX
    X
     X
      XX


Hier so ein 4:3 Tile aus dem Tutorial vergrößert:

user posted image

Isometrische-Ansicht ist nach DIN/ISO standardiesiert - es muss einen 30° Winkel haben
AMD64 3500+ | GeForce6600GT 128MB | 1GB DDR | WinXPsp2

EPS

BeitragFr, Apr 09, 2004 19:12
Antworten mit Zitat
Benutzer-Profile anzeigen
so ein Quatsch 64x31....

ich mache gerade ein ISO Map Spiel und meine Tiles sind 128x64 das ist exakt 2:1 und die passen prima aneinander. Meine Engine kann aber prinzipiell mit allen Tiles die 2:1 sind umgehen. Es kommt halt nur drauf an wie man die Tiles - also den sichbaren Bereich - zeichnet damit sie aneinander passen.

Lass dich nicht in die Irre führen. Exclamation

TheShadow

Moderator

BeitragFr, Apr 09, 2004 19:19
Antworten mit Zitat
Benutzer-Profile anzeigen
nein, du musst 128:63 oder 126:64 benutzen - erst dann hast du 100% saubere Tiles... Alles andere überlappt sich... oder du kannst keine sauberen "Gitterlinien" machen - ansonsten gib mir ein Tile ich gucke es mir an....
AMD64 3500+ | GeForce6600GT 128MB | 1GB DDR | WinXPsp2

EPS

BeitragFr, Apr 09, 2004 20:58
Antworten mit Zitat
Benutzer-Profile anzeigen
also ich weis nicht, ich finde das sieht ordentlich aus - oder?

user posted image

das Tile ist 128x64 und man kann es prima aneinandersetzen.

MVB

BeitragFr, Apr 09, 2004 21:28
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich hab mir deine Tiles mal genauer angeguckt. Das funzt zwar so prima, ist aber doch ein bisschen seltsam. Normale Isotiles müssen zwei Symetrieachsen haben. Deine haben keine einzige.

Hier der effekt, der herraus kommen würde, wenn deine Tiles zwei Symetrieachsen hätten: user posted image Wink
aquamonit.de|BlitzMax|MaxGUI

Gehe zu Seite 1, 2  Weiter

Neue Antwort erstellen


Übersicht BlitzBasic Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group