game

package
v0.0.0-...-48e963b Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const CellSize int = 10
View Source
const MaxGridSize = 2500

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Alive       bool
	JustChanged bool
	X           int
	XS          int
	Y           int
	YS          int
}

type Game

type Game struct {
	Width          int
	Height         int
	Grid           Grid
	BrushSize      int
	Camera         rl.Camera2D
	ShowGrid       bool
	Speed_IPSecond int
	Paused         bool
	EnormousGrid   bool
}

func (*Game) Draw

func (game *Game) Draw()

func (*Game) DrawGUI

func (g *Game) DrawGUI()

func (*Game) HandleControls

func (game *Game) HandleControls()

func (*Game) HandleInput

func (game *Game) HandleInput()

type Grid

type Grid struct {
	Width int
	Cells []*Cell
}

func InitGrid

func InitGrid(Width int) Grid

func (*Grid) GetCell

func (g *Grid) GetCell(x, y int) *Cell

func (*Grid) GetNumberAliveNeighbors

func (g *Grid) GetNumberAliveNeighbors(c Cell) int

func (*Grid) Next

func (g *Grid) Next(c Cell) bool

func (*Grid) Update

func (g *Grid) Update()

type Vec2

type Vec2 struct {
	X int
	Y int
}

Jump to

Keyboard shortcuts

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