tennis-game/internal/net.go

25 lines
470 B
Go

package internal
import (
"image/color"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/vector"
)
type net struct {
}
func (n *net) draw(img *ebiten.Image) {
bounds := img.Bounds()
dy := float32(bounds.Dy())
dx := float32(bounds.Dx())
height := dy / 29
width := 1 * dx / BaseWidth
for offset := float32(0); offset < dy; offset += height * 2 {
vector.DrawFilledRect(img, dx/2-width/2, offset, width, height, color.White, false)
}
}