commit f82ddece025bd3273a8d54d5d03650e84ebe89d3 Author: squishy Date: Sat Mar 23 06:27:31 2024 +0000 render goban diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..00f6589 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.fleet +.idea \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..4cf5237 --- /dev/null +++ b/build.bat @@ -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" \ No newline at end of file diff --git a/go.aseprite b/go.aseprite new file mode 100644 index 0000000..57c616e Binary files /dev/null and b/go.aseprite differ diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a179dce --- /dev/null +++ b/go.mod @@ -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 +) diff --git a/go.png b/go.png new file mode 100644 index 0000000..0808bf5 Binary files /dev/null and b/go.png differ diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..663b411 --- /dev/null +++ b/go.sum @@ -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= diff --git a/main.go b/main.go new file mode 100644 index 0000000..7dc067e --- /dev/null +++ b/main.go @@ -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{}) +}