tiledraw works!

This commit is contained in:
Ruben Müller 2011-08-20 21:43:17 +02:00
parent 71f2ea055e
commit f2821000cf
3 changed files with 57 additions and 11 deletions

View file

@ -35,10 +35,6 @@ EndProcedure
Procedure DrawRunningGame()
StartDrawing(ScreenOutput())
Box(0, 0, 200, 200, RGB(0, 255, 0))
StopDrawing()
DisplaySprite(GFXTileset, 20, 20)
DrawGui()
DrawMap()
EndProcedure

View file

@ -5,24 +5,73 @@
; * Tileset
Procedure InitGraphics()
GFXLogo = LoadSprite(#PB_Any, "../data/gfx/logo.bmp")
GFXTileset = LoadSprite(#PB_Any, "../data/gfx/tileset01.bmp")
GFXTileset = LoadSprite(#PB_Any, "../data/gfx/tileset01.bmp")
EndProcedure
Procedure InitTileset()
ClipSprite(GFXTileset, 0, 0, 16, 16)
Tileset(0) = CopySprite(GFXTileset, #PB_Any)
ClipSprite(Tileset(0), 0, 0, 16, 16)
Tileset(1) = CopySprite(GFXTileset, #PB_Any)
ClipSprite(Tileset(1), 16, 0, 16, 16)
Tileset(2) = CopySprite(GFXTileset, #PB_Any)
ClipSprite(Tileset(2), 32, 0, 16, 16)
EndProcedure
Procedure DrawTile(number.i, x.i, y.i)
Debug number.i
Debug x.i
Debug y.i
DisplaySprite(Tileset(number), x, y)
;Debug number.i
;Debug x.i
;Debug y.i
EndProcedure
Procedure DrawMap()
DrawTile(0, 0, 0);
DrawTile(0, 16, 0);
DrawTile(0, 32, 0);
DrawTile(0, 48, 0);
DrawTile(0, 64, 0);
DrawTile(0, 80, 0);
DrawTile(0, 96, 0);
DrawTile(0, 0, 16);
DrawTile(0, 16, 16);
DrawTile(0, 32, 16);
DrawTile(0, 48, 16);
DrawTile(0, 64, 16);
DrawTile(0, 80, 16);
DrawTile(0, 96, 16);
DrawTile(1, 0, 32);
DrawTile(1, 16, 32);
DrawTile(1, 32, 32);
DrawTile(0, 48, 32);
DrawTile(1, 64, 32);
DrawTile(1, 80, 32);
DrawTile(1, 96, 32);
DrawTile(0, 0, 48);
DrawTile(0, 16, 48);
DrawTile(0, 32, 48);
DrawTile(0, 48, 48);
DrawTile(0, 64, 48);
DrawTile(0, 80, 48);
DrawTile(0, 96, 48);
DrawTile(2, 0, 64);
DrawTile(2, 16, 64);
DrawTile(2, 32, 64);
DrawTile(2, 48, 64);
DrawTile(2, 64, 64);
DrawTile(2, 80, 64);
DrawTile(2, 96, 64);
EndProcedure
Procedure DrawGui()
Debug "This is an awesome Gui"
EndProcedure
; *****************************************************************************
; * Menu

View file

@ -26,6 +26,7 @@ Global Font_H2 = LoadFont(2, "Verdana", 18)
; Graphics
Global GFXLogo.i
Global GFXTileset.i
Global Dim Tileset.i(2)
; Sounds
LoadSound(0, #DATA_PATH + "sound/menu_change.wav")