From 1a63808236b1ef34b5ee4ed18290fc12f44e1b77 Mon Sep 17 00:00:00 2001 From: squishy Date: Sat, 23 Mar 2024 14:07:10 +0000 Subject: [PATCH] player gui --- assets/default-avatar.png | Bin 0 -> 532 bytes assets/player-gui.png | Bin 0 -> 2034 bytes src/game.go | 20 +++++++++++++++----- 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 assets/default-avatar.png create mode 100644 assets/player-gui.png diff --git a/assets/default-avatar.png b/assets/default-avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..91ce43de32d4b354e2a6dab8dbb2ac618c0ab73d GIT binary patch literal 532 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H3?#oinD`S&F%}28J29*~C-V}>IS}9z;>yOx zAtE4bEv{NDuDeA+>%N`xuPm;gi>3cxb^QOw;o7H^Ik%l751NWB(37gNQwg#bQcw^v zNzsToqB8%U!nNbe{@nim|Np95WVYZy+n>-YXrWSGLZ_2HL=((McZtTj^W=5AGBxW;&+;_aquk^gF| z;@lVln716uo?fl3%&>-Oh9E<2L;4?)uKllVR|5suHrUVHo6his@t*hvjf8%N4N?hi z3?+=$Cwv#GzVXT5zmUB_?SYt-W5w~udT3%xFj`0Gk#33o!t#9%eW;KXR zbV^Gr-+zp81tSlHsm~O^{A9w+snZ!&Fx82}oDZc7EFN%9loQKXuzr^^NXXOG&t;uc GLK6Vivek?L literal 0 HcmV?d00001 diff --git a/assets/player-gui.png b/assets/player-gui.png new file mode 100644 index 0000000000000000000000000000000000000000..efc602487378a5e2ad99129b31def29b8318e9e3 GIT binary patch literal 2034 zcmeAS@N?(olHy`uVBq!ia0y~yU}|7sV9elP1Bx6s@(Kh}jKx9jP7LeL$-HD>U|-|u z;uumf=j~m?zAI@G4T;vXyqEZ05Su1e$l~=vp{e63Lr8Q`&{7}Iql^MVtW%~~IxC&6 zoRd|=aC_F(`QIy7W#-gQ()~I2XUbU+Fc z!62Z_z{rrqqQKzL!@$DOAqZ4p$Rxm^;5MpgGzhSzf-?38n{-|aHXDdtmt{CsYV}AZ ziGd+OChPz(;k5r@`tj!IZe_p24s|vEzg$peV32;xcOYH=p0ByToU9=?bLGERpG)e$ ze_ME*fx&D86B`{;T=A{yCi(mJzUSj>?UKaUia@rz18twRU2ccY>8d9RJ+Eu*^7r*K zG`zmOhiPAIUf-N%$DRBP2{yaK4#@oj=AfHfcU6D>wbZoW&h+*7*VLnC(Y|f3dC!%` z?q!uRKfif<17m{0Z25bS`nd%;7?N-PjX!W%g`um4k)fe5_n-C-?vK}>>|#E!ql{gF zfgyP`vyGNFWM_aGcNurAdtG%zq338Rdqd&eK8sEX1_p_CQ3D2tGm85e_Wl3xvE#DA z1pEIx>R$*lH1s}O%N}=a-+TL-IeGJJtn!rFKAc`}@9&>4?|<3E_p=Qo2W+NGmNd?{ zEr`AT_0!Mw_5bYBq}o1y`S!7X{`1OvHS&xM*ULQ^E~zmvCg{u#KTy8^f7ufmo>R5J zY-st`^2T9#aK0?hkK4b6t?&1zud~1EGY}67V*fMcY9&0F-feamq|4LQ&t;ucLK6V| C-MuIP literal 0 HcmV?d00001 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) {