gamemap

package
v0.0.0-...-ac81ae4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NORTH = iota
	EAST
	SOUTH
	WEST
)
View Source
const (
	UNKNOWN = iota
	SAFE
	WALL
	DANGEROUS
	TELEPORT
	HOLE
	EMPTY
	GOLD
	POWERUP
)
View Source
const (
	BREEZE    = 1 << iota
	FLASH     = 1 << iota
	REDLIGHT  = 1 << iota
	BLUELIGHT = 1 << iota
	WEAKLIGHT = 1 << iota
	STEPS     = 1 << iota
	HIT       = 1 << iota
	DAMAGE    = 1 << iota
	BLOCKED   = 1 << iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Status      int
	Senses      uint
	DangerLevel float64
	Visited     bool
	Stacked     bool
}

type CellC

type CellC struct {
	X, Y int
}

type Collectable

type Collectable struct {
	IsCollectable bool
	TicksToSpawn  int
}

type Coord

type Coord struct {
	X, Y, D int
}

type Map

type Map struct {
	Cells         [][]Cell
	Height, Width int

	ExploreStack []Coord

	GoldCells    map[CellC]*int
	PowerupCells map[CellC]*int
	DangerCells  map[CellC]*Cell
}

func NewMap

func NewMap(h, w int) *Map

func (*Map) AddDanger

func (m *Map) AddDanger(c Coord)

func (*Map) GetAdjacentCells

func (m *Map) GetAdjacentCells(c Coord) (adjs []Coord)

func (*Map) GetAdjacentPositions

func (m *Map) GetAdjacentPositions(pos Coord) (adjs []Coord)

func (*Map) GetBackwardPosition

func (m *Map) GetBackwardPosition(pos Coord) (f Coord)

func (*Map) GetForwardPosition

func (m *Map) GetForwardPosition(pos Coord) (f Coord)

func (*Map) MarkWall

func (m *Map) MarkWall(c Coord, forward bool) bool

func (*Map) Print

func (m *Map) Print(pos Coord)

func (*Map) StackPop

func (m *Map) StackPop() (c Coord, success bool)

func (*Map) StackPush

func (m *Map) StackPush(c Coord)

func (*Map) StackRandomPop

func (m *Map) StackRandomPop() (c Coord, success bool)

func (*Map) StackRemove

func (m *Map) StackRemove(c Coord)

func (*Map) Tick

func (m *Map) Tick() bool

func (*Map) VisitCell

func (m *Map) VisitCell(c Coord, senses uint) bool

Jump to

Keyboard shortcuts

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