Last active
February 22, 2024 10:01
-
-
Save plutov/245f80a28630bd325f5e1453fecd2ddc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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