From 2a063ebcd5301deecfa8c66056615f2c31936968 Mon Sep 17 00:00:00 2001 From: squishy Date: Sat, 23 Mar 2024 12:54:00 +0000 Subject: [PATCH] drawing hover stone --- assets/stones.png | Bin 334 -> 324 bytes go.mod | 2 +- go.sum | 4 ++-- src/boardstate.go | 13 +++++++++++++ src/game.go | 22 ++++++++++++++-------- src/gobanrenderer.go | 8 ++++---- 6 files changed, 34 insertions(+), 15 deletions(-) diff --git a/assets/stones.png b/assets/stones.png index 9a7ba488f2af88a81705629c8615f20f368f55bc..2cc256548171bd8fd1fd486b1d8871b7ca3724d7 100644 GIT binary patch delta 285 zcmV+&0pkA70>lE4Fn<94Nkl}P$pQwl>m|Hq*00000NkvXXu0mjfr9OgP delta 295 zcmV+?0oeY;0?q=EFn<9ENkl96p^mm z0~ETktDzx|ablA=1>bT=od17Di2w%&dy>U^a8)*wT^q)p-S2jP%=Xts&fcG@f0O_z z@d(ERB_8n!F$KZJV0gOIpjt()afOKCUCvhk0C>Hhvo)>|Q-Ajl8sM6Evrd_?#RGf| z*oLG`VlWY$leaNLbcJWu&6*kFUj2gy=!44u_3GG2n8MTE0&F%TvYCAQ4`Uzh8;ByfYpIFhnn3ZM@}dy!9_Yelel5hc t@KW~|`6seuLLk!QA!7f9|9$@flMj!W&8= 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() { +func (g *Game) Update(bloob *Bloob) { } diff --git a/src/gobanrenderer.go b/src/gobanrenderer.go index 0fb01b6..d963ada 100644 --- a/src/gobanrenderer.go +++ b/src/gobanrenderer.go @@ -24,10 +24,10 @@ const ( tileRightOfBoard = 13 tileBottomLeftOfBoard = 14 tileTopRightOfBoard = 15 - tileStoneBlack = 0 - tileStoneWhite = 1 - tileStoneBlackHalf = 2 - tileStoneWhiteHalf = 3 + tileStoneBlack = 1 + tileStoneWhite = 2 + tileStoneBlackHalf = 3 + tileStoneWhiteHalf = 4 ) var tilesGoban []*Image