diff --git a/data/gfx/tileset01.bmp b/data/gfx/tileset01.bmp index 9ce510b..0ee909e 100644 Binary files a/data/gfx/tileset01.bmp and b/data/gfx/tileset01.bmp differ diff --git a/data/gfx/tileset01.jpg b/data/gfx/tileset01.jpg deleted file mode 100644 index 595773c..0000000 Binary files a/data/gfx/tileset01.jpg and /dev/null differ diff --git a/data/gfx/tileset01.png b/data/gfx/tileset01.png deleted file mode 100644 index 277c924..0000000 Binary files a/data/gfx/tileset01.png and /dev/null differ diff --git a/escape.pbp b/escape.pbp index 05a6110..6adccfc 100644 --- a/escape.pbp +++ b/escape.pbp @@ -10,28 +10,28 @@
- +
- - - - - + - + - - + + - + + + + + @@ -42,8 +42,10 @@ + - + +
diff --git a/spritetest.pbp b/spritetest.pbp new file mode 100644 index 0000000..46f2a13 --- /dev/null +++ b/spritetest.pbp @@ -0,0 +1,20 @@ + + + +
+ +
+
+ + + +
+
+
+ + + + + +
+ diff --git a/src/Draw.pbi b/src/Draw.pbi index 3cb557b..a29e62f 100644 --- a/src/Draw.pbi +++ b/src/Draw.pbi @@ -7,33 +7,38 @@ ; the dispatcher. The events are controlled by the ; HandleEventMenu() function. Procedure DrawMenu() - Define Black = RGB(0, 0, 0) - Define White = RGB(255, 255, 255) - Define ActiveMenuItemColor = RGB(255, 0, 0) - - DrawingFont(Font_H1) - DrawText(50, 50, *ActiveMenu\Title, white, black) - - Define Offset = 0 - Define FontColor = White - ForEach *ActiveMenu\Entries() - If *ActiveMenu\Entries()\Selected - FontColor = ActiveMenuItemColor - Else - FontColor = White - EndIf + StartDrawing(ScreenOutput()) + Define Black = RGB(0, 0, 0) + Define White = RGB(255, 255, 255) + Define ActiveMenuItemColor = RGB(255, 0, 0) - DrawingFont(Font_H2) - DrawText(50, 300+(Offset*30), *ActiveMenu\Entries()\Label, FontColor, Black) - Offset = Offset+1 - Next + DrawingFont(Font_H1) + DrawText(50, 50, *ActiveMenu\Title, white, black) + + Define Offset = 0 + Define FontColor = White + ForEach *ActiveMenu\Entries() + If *ActiveMenu\Entries()\Selected + FontColor = ActiveMenuItemColor + Else + FontColor = White + EndIf + + DrawingFont(Font_H2) + DrawText(50, 300+(Offset*30), *ActiveMenu\Entries()\Label, FontColor, Black) + Offset = Offset+1 + Next + StopDrawing() EndProcedure Procedure DrawRunningGame() - ;Box(0, 0, 200, 200, RGB(0, 255, 0)) + StartDrawing(ScreenOutput()) + Box(0, 0, 200, 200, RGB(0, 255, 0)) + StopDrawing() DrawImage(ImageID(#Tile01), 20, 20) DrawMap() + DisplaySprite(Tile01, 20, 20) EndProcedure diff --git a/src/Events.pbi b/src/Events.pbi index 6027240..83fe572 100644 --- a/src/Events.pbi +++ b/src/Events.pbi @@ -41,7 +41,7 @@ Procedure HandleEventMenu() EndProcedure Procedure HandleEventRunningGame() - If KeyboardReleased(#PB_Key_F10) + If KeyboardReleased(#PB_Key_Q) CurrentState = "MAIN_MENU" *ActiveMenu.GameMenu = Menus(CurrentState) EndIf diff --git a/src/Functions.pbi b/src/Functions.pbi index 263c4f0..93077cb 100644 --- a/src/Functions.pbi +++ b/src/Functions.pbi @@ -4,6 +4,7 @@ ; ***************************************************************************** ; * Tileset Procedure InitTileset() + Tile01 = LoadSprite(#PB_Any, "../data/gfx/tileset01.bmp") ;ClipSprite(#Tile01, 0, 0, 16, 16) EndProcedure diff --git a/src/Globals.pbi b/src/Globals.pbi index 329d7a6..6900a09 100644 --- a/src/Globals.pbi +++ b/src/Globals.pbi @@ -24,6 +24,8 @@ Global Font_H1 = LoadFont(1, "Arial", 40, #PB_Font_Bold) Global Font_H2 = LoadFont(2, "Verdana", 18) ; Graphics +Global Tile01.i + Enumeration 500 #Tile01 #Tile02 diff --git a/src/Main.pb b/src/Main.pb index fc45d1c..606f666 100644 --- a/src/Main.pb +++ b/src/Main.pb @@ -103,9 +103,9 @@ If OpenWindow(0, 0, 0, Screen\Width, Screen\Height, title, #PB_Window_ScreenCent ; Draw the stuff on the screen FlipBuffers() ClearScreen(RGB(0, 0, 0)) - If StartDrawing(ScreenOutput()) And CurrentState <> "QUIT" + + If CurrentState <> "QUIT" GameStates(CurrentState)\DrawFun() - StopDrawing() EndIf Delay(1)