Re-organized module structure

This commit is contained in:
2023-03-30 23:19:04 -04:00
parent 719b7b99ac
commit 53bfc8df68
62 changed files with 458 additions and 532 deletions

View File

@@ -5,8 +5,8 @@ import _ "embed"
import _ "image/png"
import "git.tebibyte.media/sashakoshka/tomo"
import "git.tebibyte.media/sashakoshka/tomo/popups"
import "git.tebibyte.media/sashakoshka/tomo/layouts/basic"
import "git.tebibyte.media/sashakoshka/tomo/elements/basic"
import "git.tebibyte.media/sashakoshka/tomo/layouts"
import "git.tebibyte.media/sashakoshka/tomo/elements"
import _ "git.tebibyte.media/sashakoshka/tomo/backends/all"
import "git.tebibyte.media/sashakoshka/tomo/elements/containers"
@@ -21,7 +21,7 @@ func run () {
window, _ := tomo.NewWindow(640, 480)
window.SetTitle("Raycaster")
container := containers.NewContainer(basicLayouts.Vertical { false, false })
container := containers.NewContainer(layouts.Vertical { false, false })
window.Adopt(container)
wallTexture, _ := TextureFrom(bytes.NewReader(wallTextureBytes))
@@ -48,13 +48,13 @@ func run () {
wallTexture,
})
topBar := containers.NewContainer(basicLayouts.Horizontal { true, true })
staminaBar := basicElements.NewProgressBar(game.Stamina())
healthBar := basicElements.NewProgressBar(game.Health())
topBar := containers.NewContainer(layouts.Horizontal { true, true })
staminaBar := elements.NewProgressBar(game.Stamina())
healthBar := elements.NewProgressBar(game.Health())
topBar.Adopt(basicElements.NewLabel("Stamina:", false), false)
topBar.Adopt(elements.NewLabel("Stamina:", false), false)
topBar.Adopt(staminaBar, true)
topBar.Adopt(basicElements.NewLabel("Health:", false), false)
topBar.Adopt(elements.NewLabel("Health:", false), false)
topBar.Adopt(healthBar, true)
container.Adopt(topBar, false)
container.Adopt(game, true)
@@ -69,6 +69,7 @@ func run () {
popups.NewDialog (
popups.DialogKindInfo,
window,
"Welcome to the backrooms",
"You've no-clipped into the backrooms!\n" +
"Move with WASD, and look with the arrow keys.\n" +