engine

package
v0.0.0-...-d9812b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	// contains filtered or unexported fields
}

Game represents the game state.

func NewGame

func NewGame(populationSize int, maxGenerations int, showTrails bool) *Game

NewGame Creates a new game.

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image)

Draw Draws the game state.

func (*Game) Layout

func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int)

Layout Layout the game.

func (*Game) SelectLevel

func (g *Game) SelectLevel(currentLevel int) (int, []utils.Obstacle)

SelectLevel selects the level based on the currentLevel parameter and returns the move limit and walls for that level. The move limit determines the maximum number of moves allowed in the level. The walls represent the utils.Obstacles in the level that the player needs to navigate through.

func (*Game) Update

func (g *Game) Update() error

Update Updates the game state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL