Tilemap Tile erkennung?
Übersicht

![]() |
Raiden93Betreff: Tilemap Tile erkennung? |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hey,
ich wollte mal Fragen wie ich es hin kriegen könnte das wen mein Char auf 3 steht dann mein text kommt."Sie sind beim Händler" Code: [AUSKLAPPEN] AppTitle "Tileset mit Char"
Graphics 200,200,32,2 SetBuffer BackBuffer() Global FPS_Timer = CreateTimer(60) ;Laden Daten Global gfx_tileset = LoadAnimImage("gfx/tileset.bmp",32,32,0,4) Global gfx_spieler = LoadImage("gfx/char.bmp") ;Variablen Global SpielerX = 2 Global SpielerY = 2 ;Cache Variablen Global X Global Y Dim map(5,5) Data 2,2,2,2,2,2 Data 2,0,0,0,0,2 Data 2,0,0,0,0,2 Data 2,0,0,0,0,2 Data 2,1,2,2,3,2 Data 2,2,2,2,2,2 For Y=0 To 5 For X=0 To 5 Read map(X,Y) Next Next Repeat Cls Map_Function() Steuerung_Function() Spieler_Function() Flip 0 WaitTimer(FPS_Timer) Until KeyHit(1) Function Spieler_Function() X = SpielerX *32 Y = SpielerY *32 DrawImage gfx_spieler,X,Y End Function Function Steuerung_Function() If KeyHit(208) If map(SpielerX,SpielerY+1) < 2 SpielerY = SpielerY +1 End If End If If KeyHit(200) If map(SpielerX,SpielerY-1) < 2 SpielerY = SpielerY -1 End If End If If KeyHit(203) If map(SpielerX-1,SpielerY) < 2 SpielerX = SpielerX -1 End If End If If KeyHit(205) If map(SpielerX+1,SpielerY) < 2 SpielerX = SpielerX +1 End If End If End Function Function Map_Function() For Y=0 To 5 For X=0 To 5 DrawImage gfx_tileset,X*32,Y*32,map(X,Y) Next Next End Function |
||
![]() |
XeresModerator |
![]() Antworten mit Zitat ![]() |
---|---|---|
Wo liegt das Problem?
- Dein Spieler hat eine Position auf der Tilemap - Du kannst nachschlagen, auf welcher Position was ist. Der Rest ist - in der simpelsten Variante - If ![]() ![]() |
||
Win10 Prof.(x64)/Ubuntu 16.04|CPU 4x3Ghz (Intel i5-4590S)|RAM 8 GB|GeForce GTX 960
Wie man Fragen richtig stellt || "Es geht nicht" || Video-Tutorial: Sinus & Cosinus THERE IS NO FAIR. THERE IS NO JUSTICE. THERE IS JUST ME. (Death, Discworld) |
![]() |
TimBo |
![]() Antworten mit Zitat ![]() |
---|---|---|
If (x=3) and (y=3) then text 0,0,"hallo welt" ![]() |
||
mfg Tim Borowski // CPU: Ryzen 2700x GPU: Nvidia RTX 2070 OC (Gigabyte) Ram: 16GB DDR4 @ 3000MHz OS: Windows 10
Stolzer Gewinner des BCC 25 & BCC 31 hat einen ersten Preis in der 1. Runde beim BWInf 2010/2011 & 2011/12 mit BlitzBasic erreicht. |
![]() |
Raiden93 |
![]() Antworten mit Zitat ![]() |
---|---|---|
hab es herausgefunden da war ich wohl zu voreilig sry^^
Ich habe nach folgendem gesucht. Code: [AUSKLAPPEN] If map(SpielerX,SpielerY) = 3
Text 10,10,"TEST End If |
||
![]() |
Raiden93 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hmm jetzt habe ich noch ein kleines Prob und zwar will ich nicht nur 0 passieren sondern auch 1
0 or 1 geht nicht und 0 And 1 auch nicht.Was könnte ich den sonst noch versuchen? Code: [AUSKLAPPEN] If KeyHit(208)
If map(SpielerX,SpielerY+1) = 0 And 1 SpielerY = SpielerY +1 End If End If If KeyHit(200) If map(SpielerX,SpielerY-1) = 0 And 1 SpielerY = SpielerY -1 End If End If If KeyHit(203) If map(SpielerX-1,SpielerY) = 0 And 1 SpielerX = SpielerX -1 End If End If If KeyHit(205) If map(SpielerX+1,SpielerY) = 0 And 1 SpielerX = SpielerX +1 End If End If |
||
![]() |
TimBo |
![]() Antworten mit Zitat ![]() |
---|---|---|
da brauchste or
If ( Map(x,y)=0 ) or ( Map(x,y)=1 ) then ... |
||
mfg Tim Borowski // CPU: Ryzen 2700x GPU: Nvidia RTX 2070 OC (Gigabyte) Ram: 16GB DDR4 @ 3000MHz OS: Windows 10
Stolzer Gewinner des BCC 25 & BCC 31 hat einen ersten Preis in der 1. Runde beim BWInf 2010/2011 & 2011/12 mit BlitzBasic erreicht. |
![]() |
Raiden93 |
![]() Antworten mit Zitat ![]() |
---|---|---|
ahh okay ![]() |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group