feat: initial commit with M1-M4 implementation

This commit is contained in:
Vladimir V Maksimov
2026-05-12 10:54:09 +03:00
commit aece34fe73
24 changed files with 1770 additions and 0 deletions

44
cmd/game/main.go Normal file
View File

@@ -0,0 +1,44 @@
package main
import (
"github.com/soer/football/internal/game"
"github.com/soer/football/internal/render"
"github.com/hajimehoshi/ebiten/v2"
"log"
)
type Game struct {
world *game.World
renderer *render.Renderer
}
func (g *Game) Update() error {
g.world.Update()
return nil
}
func (g *Game) Draw(screen *ebiten.Image) {
g.renderer.DrawWorld(screen, g.world)
}
func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {
return 1280, 720
}
func main() {
ebiten.SetWindowSize(1280, 720)
ebiten.SetWindowTitle("AI Hockey Simulation")
g := &Game{
world: game.NewWorld(),
renderer: render.NewRenderer(),
}
// Give the puck some initial velocity to see it move
g.world.Puck.Velocity.X = 2
g.world.Puck.Velocity.Y = 1.5
if err := ebiten.RunGame(g); err != nil {
log.Fatal(err)
}
}