Skip to content

Instantly share code, notes, and snippets.

@plutov
Last active February 22, 2024 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plutov/245f80a28630bd325f5e1453fecd2ddc to your computer and use it in GitHub Desktop.
Save plutov/245f80a28630bd325f5e1453fecd2ddc to your computer and use it in GitHub Desktop.
package snake
import (
"fmt"
"image/color"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
)
const (
ScreenWidth = 600
ScreenHeight = 600
boardRows = 20
boardCols = 20
)
var (
backgroundColor = color.RGBA{50, 100, 50, 50}
)
type Game struct {}
func NewGame() *Game {
return &Game{}
}
func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) {
return ScreenWidth, ScreenHeight
}
func (g *Game) Update() error {
// todo
return nil
}
func (g *Game) Draw(screen *ebiten.Image) {
screen.Fill(backgroundColor)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment