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

View File

@@ -0,0 +1,47 @@
package render
import (
"image/color"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/vector"
"github.com/soer/football/internal/entities"
"github.com/soer/football/internal/game"
)
type Renderer struct{}
func NewRenderer() *Renderer {
return &Renderer{}
}
func (r *Renderer) DrawWorld(screen *ebiten.Image, world *game.World) {
// Draw Puck
vector.DrawFilledCircle(
screen,
float32(world.Puck.Position.X),
float32(world.Puck.Position.Y),
float32(world.Puck.Radius),
color.White,
true,
)
// Draw Players
for _, p := range world.Players {
var c color.Color
if p.Team == entities.TeamRed {
c = color.RGBA{R: 255, G: 0, B: 0, A: 255}
} else {
c = color.RGBA{R: 0, G: 0, B: 255, A: 255}
}
vector.DrawFilledCircle(
screen,
float32(p.Position.X),
float32(p.Position.Y),
float32(p.Radius),
c,
true,
)
}
}