From ce00b27eae0391f1ea364025f65a8402917b916d Mon Sep 17 00:00:00 2001 From: Aaron Date: Sat, 20 Aug 2011 20:15:44 +0200 Subject: [PATCH] Start with teh drawing --- src/Draw.pbi | 2 ++ src/Functions.pbi | 14 +++++++++++++- src/Globals.pbi | 13 ++++++++++--- src/Main.pb | 2 +- src/Structs.pbi | 7 ++++++- 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/Draw.pbi b/src/Draw.pbi index 33ba040..3cb557b 100644 --- a/src/Draw.pbi +++ b/src/Draw.pbi @@ -34,4 +34,6 @@ Procedure DrawRunningGame() ;Box(0, 0, 200, 200, RGB(0, 255, 0)) DrawImage(ImageID(#Tile01), 20, 20) + + DrawMap() EndProcedure diff --git a/src/Functions.pbi b/src/Functions.pbi index 2f2e9d3..263c4f0 100644 --- a/src/Functions.pbi +++ b/src/Functions.pbi @@ -4,10 +4,20 @@ ; ***************************************************************************** ; * Tileset Procedure InitTileset() - ;ClipSprite(#Tile01, 0, 0, 16, 16) EndProcedure +Procedure DrawTile(number.i, x.i, y.i) + Debug number.i + Debug x.i + Debug y.i +EndProcedure + +Procedure DrawMap() + +EndProcedure + + ; ***************************************************************************** ; * Menu @@ -23,3 +33,5 @@ Procedure Menu_GotoCurrent() Next EndIf EndProcedure + + diff --git a/src/Globals.pbi b/src/Globals.pbi index fd6e8bd..329d7a6 100644 --- a/src/Globals.pbi +++ b/src/Globals.pbi @@ -7,13 +7,20 @@ Global Title.s = "ESCape - Build " + Str(#PB_Editor_BuildCount) Global Screen.ScreenDimension\width = 800 Screen.ScreenDimension\height = 600 +; Player +Global Player.MapPoint\X = 10 +Player.MapPoint\Y = 10 + +; Them map +Global Dim GameField(50, 50) + NewMap GameStates.GameState() Global NewMap Menus.GameMenu() Global CurrentState.s = "MAIN_MENU" Global *ActiveMenu.GameMenu ; Fonts -Global Font_H1 = LoadFont(1, "Courier", 40, #PB_Font_Bold) +Global Font_H1 = LoadFont(1, "Arial", 40, #PB_Font_Bold) Global Font_H2 = LoadFont(2, "Verdana", 18) ; Graphics @@ -30,7 +37,7 @@ EndEnumeration LoadSound(0, #DATA_PATH + "sound/menu_change.wav") LoadSound(1, #DATA_PATH + "sound/menu_select.wav") -: Images +; Images UseJPEGImageDecoder() -Debug LoadImage(#Tile01, #DATA_PATH+"gfx/tileset01.jp") +Debug LoadImage(#Tile01, #DATA_PATH+"gfx/tileset01.jpg") diff --git a/src/Main.pb b/src/Main.pb index 7d192a7..fc45d1c 100644 --- a/src/Main.pb +++ b/src/Main.pb @@ -13,8 +13,8 @@ EndIf XIncludeFile "Structs.pbi" XIncludeFile "Globals.pbi" -XIncludeFile "Draw.pbi" XIncludeFile "Functions.pbi" +XIncludeFile "Draw.pbi" XIncludeFile "Events.pbi" diff --git a/src/Structs.pbi b/src/Structs.pbi index 0968576..4ef460f 100644 --- a/src/Structs.pbi +++ b/src/Structs.pbi @@ -30,4 +30,9 @@ EndStructure Structure GameMenu Title.s List Entries.GameMenuItem() -EndStructure \ No newline at end of file +EndStructure + +Structure MapPoint + X.i + Y.i +EndStructure