diff --git a/assets/default-avatar.png b/assets/default-avatar.png new file mode 100644 index 0000000..91ce43d Binary files /dev/null and b/assets/default-avatar.png differ diff --git a/assets/player-gui.png b/assets/player-gui.png new file mode 100644 index 0000000..efc6024 Binary files /dev/null and b/assets/player-gui.png differ diff --git a/src/game.go b/src/game.go index 4783dfc..96fbff1 100644 --- a/src/game.go +++ b/src/game.go @@ -1,33 +1,43 @@ package src import ( - "fmt" . "git.danitheskunk.com/squishy/blooblib" "git.danitheskunk.com/squishy/blooblib/color" ) type Game struct { - gobanRenderer *GobanRenderer - boardState *BoardState + 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) {