diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-07-04 23:09:29 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-07-04 23:09:29 +0200 |
| commit | 283de094979cd8ca3df7e45632977ce35886729c (patch) | |
| tree | e21d8135dcef7dd46b61874e0b264d5009c647a0 /main.go | |
| parent | 5224fdc80913597287a5f67efec5d0be3254ce59 (diff) | |
Upgrade go
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -12,6 +12,7 @@ import ( "github.com/hajimehoshi/ebiten/v2" "github.com/hajimehoshi/ebiten/v2/inpututil" "github.com/hajimehoshi/ebiten/v2/vector" + "github.com/martinlehoux/kagamigo/kcore" "golang.org/x/exp/slog" ) @@ -33,6 +34,7 @@ type Game struct { Entities []*Entity CurrentAction Action Selection GlobalSelection + ResourceAmount int } func DrawMove(screen *ebiten.Image, e *Entity) { @@ -181,14 +183,10 @@ func main() { ebiten.SetWindowSize(640, 480) ebiten.SetWindowTitle("Age of Empire") icon, err := os.Open("icon-crop.jpg") - if err != nil { - panic(err) - } + kcore.Expect(err, "failed to open icon") defer icon.Close() iconImg, _, err := image.Decode(icon) - if err != nil { - panic(err) - } + kcore.Expect(err, "failed to decode icon") ebiten.SetWindowIcon([]image.Image{iconImg}) game := &Game{} ironImage := NewFilledRectangleImage(physics.Point{X: 100, Y: 100}, color.RGBA{0x80, 0x80, 0x80, 0xff}) |
