Fertige Map einfügen
Übersicht

QuäinyBetreff: Fertige Map einfügen |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
so das ist mein bisheriger code, da die map mit data... sehr unübersichtlich ist und ich den überblick verloren hab, hab ich eine "fertige map" erstellt die nur noch anstelle von der "unübersichtlichen map" eingesetzt werden muss.Leider hab ich keinen plan wie das funktioniert, vielleicht habt ihr ja ne idee, wäre super von euch ![]() ![]() also da unten ist der code: |
||
- Zuletzt bearbeitet von Quäiny am Mo, Jul 07, 2008 18:20, insgesamt einmal bearbeitet
Quäiny |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
sry für doppel posting aber ich komm auf den editierbutton nicht mehr drauf
Code: [AUSKLAPPEN] Graphics 640,480,16,1 SetBuffer BackBuffer() ;tileset tileset = LoadAnimImage("tiless.png",16,25,0,36) ;figur Global ich = LoadImage("ichkleinformat5.png") Global ichhinten=LoadAnimImage("ichkleinformat.png",16,25,0,3) Global ichrechts=LoadAnimImage("ichkleinformat2.png",16,25,0,3) Global ichlinks=LoadAnimImage("ichkleinformat3.png",16,25,0,3) Global ichvorne=LoadAnimImage("ichkleinformat4.png",16,25,0,3) Global zimmer=LoadImage("meinzimmer.png") Global schrank=LoadImage("schrank.png") Global bett=LoadImage("bett.png") Global tisch=LoadImage("tisch.png") Global fenster=LoadImage("fenster.png") Global fenster2=CopyImage(fenster) Global fernseher=LoadImage("fernseher.png") Global computer=LoadImage("computer.png") Global sitzsaecke=LoadImage("sitzsäcke.png") Global buecherschrank=LoadImage("bücherschrank.png") Global sofa=LoadImage("sofa.png") Global ichhintene=LoadImage("ichkleinformat6.png") Global ichlinkse=LoadImage("ichkleinformat7.png") Global ichrechtse=LoadImage("ichkleinformat8.png") Global treppeoben=LoadImage("treppeoben.png") ;px Variable des Spielers px =20 ;py Variable des Spielers py = 9 ;Direckt move = 1 damit die Figur auch am Anfang sichbar ist move = 1 MaskImage ich,32,156,0 MaskImage ichhinten,32,156,0 MaskImage ichrechts,32,156,0 MaskImage ichlinks,32,156,0 MaskImage ichvorne,32,156,0 MaskImage schrank,255,255,255 MaskImage bett,255,255,255 MaskImage tisch,255,255,255 MaskImage fernseher,255,255,255 MaskImage computer,255,255,255 MaskImage sitzsaecke,255,255,255 MaskImage sofa,255,255,255 ;die map-array Dim map(48,29) ;die Karte ; 0 = tapette ; 1 = teppich Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,0 Data 26,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,8 Data 26,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,8 Data 26,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2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,27 Data 0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,0,26,2,2,2,2,27,0,0,0,0,0,0,0,0,0,0,0,26,3,3,3,3,3,3,3,3,3,27 Data 26,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,27,26,2,2,2,2,27,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,9,9,9,9,9,9,0 Data 26,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,27,26,2,2,2,2,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 26,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,27,26,2,2,2,2,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 26,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,27,26,2,2,2,2,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 26,9,9,9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,27,2,2,2,2,2,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 26,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,27,26,2,2,2,2,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 26,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,27,26,2,2,2,2,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 26,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,27,26,2,2,2,2,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 Data 0,28,28,28,28,28,28,28,28,28,28,28,28,0,0,28,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;einlesen und die zahlen der Tiles in der array speichern For y = 0 To 28 For x = 0 To 47 Read map(x,y) Next Next Repeat Cls If KeyDown(1) Then End If y>130-scrolly Then If x<290-scrollx Then For y = 18 To 29 For x = 0 To 19 DrawBlock tileset,x*16-scrollx,y*25-scrolly,map(x,y) DrawImage schrank,16-scrollx,510-scrolly DrawImage bett,16-scrollx,640-scrolly DrawImage tisch,16-scrollx,610-scrolly DrawImage fenster,85-scrollx,505-scrolly DrawImage fenster2, 220-scrollx,505-scrolly DrawImage fernseher, 140-scrollx,527-scrolly DrawImage computer,200-scrollx,527-scrolly DrawImage sitzsaecke,130-scrollx,570-scrolly DrawImage buecherschrank,250-scrollx,510-scrolly Next Next DrawImage sofa,120-scrollx,674-scrolly EndIf EndIf If x>290-scrollx Then For x =20 To 48 For y= 0 To 29 DrawBlock tileset,x*16-scrollx,y*25-scrolly,map(x,y) DrawImage treppeoben,345-scrollx,700-scrolly Next Next EndIf If y<270-scrolly Then For y=0 To 18 For x = 0 To 48 DrawBlock tileset,x*16-scrollx,y*25-scrolly,map(x,y) Next Next EndIf Color 128,128,64 Rect 400-scrollx, 250-scrolly, 5, 30 Rect 300-scrollx, 250-scrolly,32,4 ;malt die karte. Die auf der map gespeicherten zahlen einfach als framezahl des tilesets nehmen ;einfach wenn tastendruck dann If KeyDown(208) Then ;wenn die position des spielers (px,py+1) mit einem tile kollidiert, dass in der array einen höeren ;wert als 2 hat geht der if-satz nicht weiter und die figur bleibt stehen ;die 2 ist gleichzeitig das frame des tilesets If map(px,py+1) <4 Then py=py+1 ;die figur wird um ein tile bewegt scrolly = scrolly+25 ;überträgt die spielerkoordinaten auf die x und y variablen der map und malt unsere figur move = 1 End If End If If KeyDown(200) Then If map(px,py-1) <4 Then scrolly = scrolly -25 py=py-1 move =1 End If End If If KeyDown(203) Then If map(px-1,py) <4 Then px = px -1 scrollx = scrollx - 16 move = 1 End If End If If KeyDown(205) Then If map(px+1,py) < 4 Then px = px +1 scrollx = scrollx + 16 move =1 End If End If If KeyDown(208)=0 And KeyDown(200)=0 And KeyDown(203)=0 And KeyDown(205)=0 x = px * 15: y = py * 24 DrawImage ich,px+x-scrollx,py+y-scrolly:Delay 100 If KeyDown(205) n=(n+1) Mod 3 x = px * 15: y = py * 24 DrawImage ichrechts, px+x-scrollx, py+y-scrolly,n: Delay 200 If KeyDown(203) n=(n+1) Mod 3 x = px * 15: y = py * 24 DrawImage ichlinks, px+x-scrollx, py+y-scrolly ,n:Delay 200 If KeyDown(200) n=(n+1) Mod 3 x = px * 15: y = py * 24 DrawImage ichhinten, px+x-scrollx, py+y-scrolly,n:Delay 200 If KeyDown(208) n=(n+1) Mod 3 x = px * 15: y = py * 24 DrawImage ichvorne, x+px-scrollx, py+y-scrolly ,n:Delay 200 Flip 0 Forever |
||
![]() |
ProfJakeehemals "DTC" / "Fabian Niemann" |
![]() Antworten mit Zitat ![]() |
---|---|---|
Off Topic:
Habt ihr Darstellungsfehler bei Quäinys letztem Post? Benutze Firefox 3, gerade unter Windows XP SP3. Topic: Also als erstes mal die Frage was du willst. Denn das habe ich nicht ganz verstanden. Das einzige was ich beim überfliegen festgestellt habe, ist dass es mir schewr fällt zu glauben, dass das die ordentliche Map sein soll. Warum schreibst du so etwas nicht in Funktionen? Function ![]() |
||
- Zuletzt bearbeitet von ProfJake am Mo, Jul 07, 2008 18:25, insgesamt einmal bearbeitet
![]() |
hecticSieger des IS Talentwettbewerb 2006 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Ich verstehe überhaupt nicht was du willst. Zuerst solltest du mal dein Code einrücken. Falls du das noch nicht so gut kannst, dann installier dir mal eine vernünftige IDE (zum Beispiel IDEal). Bei IDEal musst du allerdings immer ein Then![]() Hier solltest du allerdings nochmal rüber schauen: Code: [AUSKLAPPEN] ...Mod 3: x = px...
Da fehlte am Ende wohl 4mal das '':'', oder? |
||
Download der Draw3D2 V.1.1 für schnelle Echtzeiteffekte über Blitz3D |
![]() |
Mr.HydeNewsposter |
![]() Antworten mit Zitat ![]() |
---|---|---|
@ pupil Liegt an seiner Datawucherei, wenn du zoomst kannst du es dir aber anständig anschauen.
Quäiny sollte seinen Data-Wust etwas durchlüften ![]() |
||
BBP News RSS | Chaos Interactive | Watanien 2 Screens, Infos und Download | Watanien 2 Worklog | PuzzleMasters
http://abgeordnetenwatch.de - http://www.regierungs-beratung.de - Der Regierung auf die Finger schauen |
![]() |
ProfJakeehemals "DTC" / "Fabian Niemann" |
![]() Antworten mit Zitat ![]() |
---|---|---|
Stimmt, jetzt ist die Schrift aber zu klein.
Also Quäiny, hopp, hopp besser formatieren. |
||
Quäiny |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
[quote="Mr.Hyde"]
@ Mr.Hyde ich will ja meinen data wurst ganicht mehr haben...deshalb muss mir mal jemand erklären wie man eine map mit include einsetzen kann;-) |
||
![]() |
hecticSieger des IS Talentwettbewerb 2006 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Wieso Include? Baue dir einen kleinen Mapeditor (dieser hätte kaum mehr Code als das was du bisher hast) und ermögliche per Knopfdruck das abspeichern und laden der einzelnen Maps als Datei. Das ganze dann gleich als Binary und gut ist. Dann hast du es ganz flexibel und lernst nebenbei noch ein wenig mit Dateioperationen umzugehen. | ||
Download der Draw3D2 V.1.1 für schnelle Echtzeiteffekte über Blitz3D |
![]() |
ProfJakeehemals "DTC" / "Fabian Niemann" |
![]() Antworten mit Zitat ![]() |
---|---|---|
Das hatten wir aber auch schon des öfteren.
Du brauchst die Datei Befehle, schau mal in der Hilfe nach. |
||
![]() |
ozzi789 |
![]() Antworten mit Zitat ![]() |
---|---|---|
@ pupil
FX 3 und XP Sp 2 = alles io ![]() |
||
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5 |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group