player gui
This commit is contained in:
parent
2a063ebcd5
commit
1a63808236
Binary file not shown.
After Width: | Height: | Size: 532 B |
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
16
src/game.go
16
src/game.go
|
@ -1,7 +1,6 @@
|
|||
package src
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
. "git.danitheskunk.com/squishy/blooblib"
|
||||
"git.danitheskunk.com/squishy/blooblib/color"
|
||||
)
|
||||
|
@ -9,25 +8,36 @@ import (
|
|||
type Game struct {
|
||||
gobanRenderer *GobanRenderer
|
||||
boardState *BoardState
|
||||
imgPlayerGui *Image
|
||||
imgDefaultAvatar *Image
|
||||
}
|
||||
|
||||
func (g *Game) Init(bloob *Bloob, settings *Settings) {
|
||||
settings.Title = "Goo v0.0"
|
||||
settings.TargetFps = 240
|
||||
|
||||
g.imgPlayerGui = LoadImage("assets/player-gui.png")
|
||||
g.imgDefaultAvatar = LoadImage("assets/default-avatar.png")
|
||||
|
||||
g.boardState = NewBoardState()
|
||||
g.gobanRenderer = NewGobanRenderer(g.boardState)
|
||||
|
||||
g.boardState.Set(Vec2i{X: 3, Y: 3}, Black)
|
||||
}
|
||||
|
||||
func (g *Game) Render(bloob *Bloob, screen *Image) {
|
||||
mouseTilePos := DivScalar(bloob.MousePos, 16)
|
||||
g.gobanRenderer.Render(screen)
|
||||
screen.Draw(g.imgDefaultAvatar, Vec2i{X: 16, Y: 18})
|
||||
screen.Draw(g.imgDefaultAvatar, Vec2i{X: 16, Y: 184})
|
||||
screen.Draw(g.imgPlayerGui, Vec2i{})
|
||||
screen.DrawTextOutline("Squishy Bloob", DefaultFontThin, Vec2i{X: 19, Y: 151}, color.White, color.Black)
|
||||
screen.DrawTextOutline("P:10 T:23:24 B:3", DefaultFontThin, Vec2i{X: 19, Y: 162}, color.White, color.Black)
|
||||
screen.DrawTextOutline("Tomato Kigu", DefaultFontThin, Vec2i{X: 19, Y: 317}, color.White, color.Black)
|
||||
screen.DrawTextOutline("P:3 T: 3:24 B:2", DefaultFontThin, Vec2i{X: 19, Y: 328}, color.White, color.Black)
|
||||
if mouseTilePos.X >= 10 && mouseTilePos.Y >= 1 && mouseTilePos.X < 29 && mouseTilePos.Y < 20 {
|
||||
tilePos := Sub(mouseTilePos, Vec2i{X: 10, Y: 1})
|
||||
g.boardState.DrawHover(screen, tilePos, Black)
|
||||
}
|
||||
screen.DrawText(fmt.Sprintf("%3d x %3d", bloob.MousePos.X, bloob.MousePos.Y), DefaultFont, Vec2i{10, 10}, color.White)
|
||||
}
|
||||
|
||||
func (g *Game) Update(bloob *Bloob) {
|
||||
|
|
Loading…
Reference in New Issue