render goban

This commit is contained in:
Squishy Bloob 2024-03-23 06:27:31 +00:00
commit f82ddece02
7 changed files with 94 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.fleet
.idea

5
build.bat Normal file
View File

@ -0,0 +1,5 @@
set CGO_ENABLED=1
set CC=x86_64-w64-mingw32-gcc
set GOOS=windows
set GOARCH=amd64
go build -tags static -ldflags "-s -w"

BIN
go.aseprite Normal file

Binary file not shown.

13
go.mod Normal file
View File

@ -0,0 +1,13 @@
module git.danitheskunk.com/squishy/goo
go 1.22.1
replace git.danitheskunk.com/squishy/blooblib => ../blooblib
require git.danitheskunk.com/squishy/blooblib v0.0.0-00010101000000-000000000000
require (
github.com/askeladdk/aseprite v0.0.4 // indirect
github.com/veandco/go-sdl2 v0.4.38 // indirect
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 // indirect
)

BIN
go.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

9
go.sum Normal file
View File

@ -0,0 +1,9 @@
github.com/askeladdk/aseprite v0.0.4 h1:/k1VTiDkPORnrzonUUV5oXWwdHBoYjIIYJ1K/PupNMU=
github.com/askeladdk/aseprite v0.0.4/go.mod h1:lVW4EwZ7lgQjeHp7MhYj1NII5a/yLYyvAo7COPIn3WY=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/veandco/go-sdl2 v0.4.38 h1:lx8syOA2ccXlgViYkQe2Kn/4xt+p9mdd1Qc/yYMrmSo=
github.com/veandco/go-sdl2 v0.4.38/go.mod h1:OROqMhHD43nT4/i9crJukyVecjPNYYuCofep6SNiAjY=
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc=
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ=
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc=

65
main.go Normal file
View File

@ -0,0 +1,65 @@
package main
import . "git.danitheskunk.com/squishy/blooblib"
type Game struct {
tilemap *Tilemap
}
func (g *Game) Init(settings *Settings) {
settings.Title = "Goo v0.0"
tiles := LoadImage("go.png").MakeTileset(Vec2i{X: 16, Y: 16})
g.tilemap = NewTilemap(Vec2i{X: 40, Y: 23}, tiles)
g.tilemap.Clear(16)
for y := 0; y < 19; y += 1 {
for x := 0; x < 19; x += 1 {
g.tilemap.Set(Vec2i{X: 10 + x, Y: 1 + y}, 3)
}
g.tilemap.Set(Vec2i{X: 10, Y: 1 + y}, 11)
g.tilemap.Set(Vec2i{X: 28, Y: 1 + y}, 12)
}
for x := 0; x < 19; x += 1 {
g.tilemap.Set(Vec2i{X: 10 + x, Y: 1}, 9)
g.tilemap.Set(Vec2i{X: 10 + x, Y: 19}, 10)
g.tilemap.Set(Vec2i{X: 10 + x, Y: 20}, 17)
g.tilemap.Set(Vec2i{X: 10 + x, Y: 21}, 18)
}
for y := 0; y < 21; y += 1 {
g.tilemap.Set(Vec2i{X: 29, Y: 1 + y}, 19)
}
g.tilemap.Set(Vec2i{X: 10, Y: 21}, 20)
g.tilemap.Set(Vec2i{X: 29, Y: 1}, 21)
g.tilemap.Set(Vec2i{X: 10, Y: 1}, 5)
g.tilemap.Set(Vec2i{X: 28, Y: 1}, 6)
g.tilemap.Set(Vec2i{X: 10, Y: 19}, 7)
g.tilemap.Set(Vec2i{X: 28, Y: 19}, 8)
g.tilemap.Set(Vec2i{X: 13, Y: 4}, 4)
g.tilemap.Set(Vec2i{X: 25, Y: 4}, 4)
g.tilemap.Set(Vec2i{X: 13, Y: 16}, 4)
g.tilemap.Set(Vec2i{X: 25, Y: 16}, 4)
g.tilemap.Set(Vec2i{X: 13, Y: 10}, 4)
g.tilemap.Set(Vec2i{X: 13, Y: 16}, 4)
g.tilemap.Set(Vec2i{X: 25, Y: 10}, 4)
g.tilemap.Set(Vec2i{X: 25, Y: 16}, 4)
g.tilemap.Set(Vec2i{X: 19, Y: 4}, 4)
g.tilemap.Set(Vec2i{X: 19, Y: 10}, 4)
g.tilemap.Set(Vec2i{X: 19, Y: 16}, 4)
}
func (g *Game) Render(screen *Image) {
screen.DrawTilemap(g.tilemap, Vec2i{})
screen.Draw(g.tilemap.Tileset[2], Vec2i{X: 16 * 25, Y: 16 * 4})
screen.Draw(g.tilemap.Tileset[1], Vec2i{X: 16 * 13, Y: 16 * 16})
}
func (g *Game) Update() {
}
func main() {
Run(&Game{})
}