From f82ddece025bd3273a8d54d5d03650e84ebe89d3 Mon Sep 17 00:00:00 2001 From: squishy Date: Sat, 23 Mar 2024 06:27:31 +0000 Subject: [PATCH] render goban --- .gitignore | 2 ++ build.bat | 5 ++++ go.aseprite | Bin 0 -> 1327 bytes go.mod | 13 +++++++++++ go.png | Bin 0 -> 986 bytes go.sum | 9 ++++++++ main.go | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 94 insertions(+) create mode 100644 .gitignore create mode 100644 build.bat create mode 100644 go.aseprite create mode 100644 go.mod create mode 100644 go.png create mode 100644 go.sum create mode 100644 main.go 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 0000000000000000000000000000000000000000..57c616e0ce2fa00428938bb012429753db7d4a6c GIT binary patch literal 1327 zcmdr~ZA@Eb6u#ZqYWQKN;xMSJ8C^n#wK7o0NNE{MP&%0@>l`rY7$8Ce=t>nv+Dqal z##x&1VfTS+6X=*TO--QI!r*SfS&n1O&kY2^+34i0q6NmA+xQ z$?oSEPKa;E-M;;aq#e)XChrj^Gl%JW?RjZONaR>8)3j)Gw!; z$z$+ypQh83va8ci{J>Bx(JiK{Q5%F1tlh*d-><8cu6pr}qRXuZ+PPUJjNRG0Ur5=P zk^W(R?x>{DHc%Bb_buF888ZHIzFXHIkry33m6el!kdalMxxbUoACc6%_5F?q(1;Od zFE1aLj~7bMrPUViJ6rv(PTsXRG9CVN*?isf?RoX5r&?u9^w@djYZ-0<@==QTN z;}+)|DGWwp*_oYBO?K7HdjiGpp%pV(=Cp**yQgchA#`}kVI}6O&L#h$|A_GUDvpsd zkqMG(><1I0h9jtD5djH7Zi?^1Xs2r3GSy7pW;FVvRno!sWzh;W1{`q zgv@tFuwmoHJ9?~!c0q*J(XM$7p%yYcW+pXnIWwEVn$hS|$3E$PJl>!~C(lw)Xj?x|Blxhf(b{P!*s0}OgIJ0~lw{n&TbSPO+{O@qMgovz(&?VVkGC~9+pY(Kj zun_oIPM|-{V!*8g>qoGl4#hPnImaSBD%&w4643iGi_kk`<(%-%DVqdW98i5N031#M zvkCP^%}&+0TL^|2Ah$Dj9q0eb$T-d#;x{2T7Z BEY<)3 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..0808bf57fbfac0a8948c70ff5a9c28182f3c036e GIT binary patch literal 986 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSjKx9jP7LeL$-HD>V4mXX;uumf z=k4A7*}{o3$3H$-5wWtmve0?L59Wp0|C{EizHvatd%=KAv%<=nLj}KhA!4^=y zl=Z{Q*WYK(KeO9B|A}4nop(9sa_r~vXxrX4xwzG6o=NVHZMT;%<-K2K-Nh~EVDsea zRMXA7HchLnpH^{V`FsDh-<5k7FsiiM>q@$Wv7CHZzI~VR_v3*Ajur=*Jf!~}eY*4W zN5ktMdJV(#;$2vzcdLj0%Uu*?$1GuN{ipkMakjw5H4pV~eYr4O%JD-!V`ZC6(7b~! zQgOFF|M`^|&(5(ie|{;?bwi!MRt>L@YVH!4@@HSc9TQ~he)>6Lb; zzi>bQ9UKvUkV(S7E%4sLGN2>6tv>60(n$)`kgE!A&-Z!2-&m>SAzfGWd(Uspf(j48 zKhX`kOt(KwzWw`7|IaC(6hG9nv|j&od~)KEtqn&t-bOdP-yl(D$9~&A?zT1ahT7g& z{BF-#tvnMLKcNSh9g^R^v(4iiL2)PE{N?f&t1PR^qEtu;lKJBf=*MfKYrb}9jZ>S z!GcNPI?%SMat-hQ^_MfrcC2`Da`W}L>!0`Ut&(~b!S!?R&0@P{ci*MldtUwL^D>gTe~DWM4fD%Ydr literal 0 HcmV?d00001 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{}) +}