engine

package
v0.0.0-...-dcead42 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Draw

func Draw(screen tcell.Screen, lvl *Level, viewPoint h.Vector)

Types

type Actor

type Actor interface {
	GetHealth() int
	SetHealth(value int)

	GetMaxHealth() int
	SetMaxHealth(value int)

	GetPosition() h.Vector
	SetPosition(value h.Vector)

	GetCell() Cell

	TakeTurn()
}

type Cell

type Cell struct {
	Style  tcell.Style
	Symbol rune
}

type GameObject

type GameObject interface {
	GetPosition() h.Vector
	SetPosition(value h.Vector)
}

type Item

type Item interface {
	GetName() string
	GetDescription() []string
}

type Level

type Level struct {
	Size       h.Vector
	Collisions h.Field[bool]
	Visuals    h.Field[Cell]
	Actors     Pool[Actor]
	Rooms      []gen.Area
	RoomsMap   h.Field[int]
	DepthMap   h.Field[int]
	MaxDepth   int
}

func GenLevel

func GenLevel(size h.Vector) *Level

func (*Level) IsCollision

func (lvl *Level) IsCollision(coord h.Vector) bool

type Pool

type Pool[T GameObject] struct {
	List []T
}

func (*Pool[T]) Add

func (p *Pool[T]) Add(actor T)

func (*Pool[T]) Find

func (p *Pool[T]) Find(position h.Vector) *T

func (*Pool[T]) Remove

func (p *Pool[T]) Remove(actor *T) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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