From 09f9728e1d3333ac89644392e717a1a8bb4bbec0 Mon Sep 17 00:00:00 2001 From: LimePotato Date: Sun, 29 Oct 2023 02:54:35 -0600 Subject: [PATCH] Tweak Values --- .../group/ouroboros/potrogue/GameConfig.kt | 2 +- .../potrogue/builders/GameTileRepository.kt | 2 +- .../ouroboros/potrogue/view/PauseView.kt | 54 +++++++++++++++++++ .../group/ouroboros/potrogue/world/World.kt | 3 +- 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 src/main/kotlin/group/ouroboros/potrogue/view/PauseView.kt diff --git a/src/main/kotlin/group/ouroboros/potrogue/GameConfig.kt b/src/main/kotlin/group/ouroboros/potrogue/GameConfig.kt index 247db01..0158241 100644 --- a/src/main/kotlin/group/ouroboros/potrogue/GameConfig.kt +++ b/src/main/kotlin/group/ouroboros/potrogue/GameConfig.kt @@ -22,7 +22,7 @@ object GameConfig { const val WINDOW_WIDTH = 80 const val WINDOW_HEIGHT = 50 - val WORLD_SIZE = Size3D.create(WINDOW_WIDTH * 2, WINDOW_HEIGHT * 2 , DUNGEON_LEVELS) + val WORLD_SIZE = Size3D.create(WINDOW_WIDTH * 3, WINDOW_HEIGHT * 3 , DUNGEON_LEVELS) val GAME_AREA_SIZE = Size3D.create( xLength = WINDOW_WIDTH - SIDEBAR_WIDTH, yLength = WINDOW_HEIGHT - LOG_AREA_HEIGHT, diff --git a/src/main/kotlin/group/ouroboros/potrogue/builders/GameTileRepository.kt b/src/main/kotlin/group/ouroboros/potrogue/builders/GameTileRepository.kt index f9ff0c1..d43385d 100644 --- a/src/main/kotlin/group/ouroboros/potrogue/builders/GameTileRepository.kt +++ b/src/main/kotlin/group/ouroboros/potrogue/builders/GameTileRepository.kt @@ -24,7 +24,7 @@ object GameTileRepository { //Wall Tile val WALL: CharacterTile = Tile.newBuilder() - .withCharacter('#') + .withCharacter('▒') .withForegroundColor(WALL_FOREGROUND) .withBackgroundColor(WALL_BACKGROUND) .buildCharacterTile() diff --git a/src/main/kotlin/group/ouroboros/potrogue/view/PauseView.kt b/src/main/kotlin/group/ouroboros/potrogue/view/PauseView.kt new file mode 100644 index 0000000..fc719ad --- /dev/null +++ b/src/main/kotlin/group/ouroboros/potrogue/view/PauseView.kt @@ -0,0 +1,54 @@ +package group.ouroboros.potrogue.view + +import group.ouroboros.potrogue.GameConfig +import org.hexworks.zircon.api.ComponentDecorations +import org.hexworks.zircon.api.Components +import org.hexworks.zircon.api.component.ColorTheme +import org.hexworks.zircon.api.component.ComponentAlignment +import org.hexworks.zircon.api.grid.TileGrid +import org.hexworks.zircon.api.view.base.BaseView + +class PauseView (private val grid: TileGrid, theme: ColorTheme = GameConfig.THEME) : BaseView(grid, theme) { + init { + val msg = "Pre-Game Configuration" + + // a text box can hold headers, paragraphs and list items + // `contentWidth = ` here is a so-called keyword parameter + // using them you can pass parameters not by their order + // but by their name. + // this might be familiar for Python programmers + val header = Components.textBox(contentWidth = msg.length) + // we add a header + .addHeader(msg) + // and a new line + .addNewLine() + // and align it to center + .withAlignmentWithin(screen, ComponentAlignment.TOP_CENTER) + .build() // finally we build the component + + val backButton = Components.button() + .withAlignmentWithin(screen, ComponentAlignment.BOTTOM_CENTER) + .withText("RESUME") + .withDecorations(ComponentDecorations.box(), ComponentDecorations.shadow()) + .build() + + val resumeButton = Components.button() + .withAlignmentWithin(screen, ComponentAlignment.BOTTOM_CENTER) + .withText("RESUME") + .withDecorations(ComponentDecorations.box(), ComponentDecorations.shadow()) + .build() + + //Once the back button is activated go back to startView + backButton.onActivated { + replaceWith(StartView(grid)) + } + + resumeButton.onActivated { + replaceWith(PlayView(grid)) + } + + // We can add multiple components at once + //Bake The Cake + screen.addComponents(header,backButton) + } +} \ No newline at end of file diff --git a/src/main/kotlin/group/ouroboros/potrogue/world/World.kt b/src/main/kotlin/group/ouroboros/potrogue/world/World.kt index aa6cc36..0b3ccde 100644 --- a/src/main/kotlin/group/ouroboros/potrogue/world/World.kt +++ b/src/main/kotlin/group/ouroboros/potrogue/world/World.kt @@ -25,7 +25,8 @@ class World ( ) : GameArea by GameAreaBuilder.newBuilder() // We set its visibleSize. This is the size of the area which will be visible on our screen .withVisibleSize(visibleSize) - // We set the actualSize. This is the size of the whole world which can be multiple times bigger than the visible part. GameArea supports scrolling so we’ll be able to scroll through our caves soon + // We set the actualSize. This is the size of the whole world which can be multiple times bigger than the visible part. + // GameArea supports scrolling so we’ll be able to scroll through our caves soon .withActualSize(actualSize) .build() {