hexempire

package
v0.0.0-...-08c08b7 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	MapNumber       int
	XMax            int
	YMax            int
	HexWidth        int
	HexHeight       int
	Fields          map[string]*Field
	LandCount       int
	LandGroups      [][]*Field
	Towns           []*Field
	PartiesCapitals []*Field
	TownNames       []string
}

func NewBoard

func NewBoard() *Board

type Field

type Field struct {
	FX        int
	FY        int
	X         int
	Y         int
	LandId    int
	Type      string
	Capital   int
	Neighbors [6]*Point2D
	IsLand    bool
	Estate    string
	TownName  string
}

type Game

type Game struct {
	ScreenWidth  int
	ScreenHeight int
	// contains filtered or unexported fields
}

func NewGame

func NewGame(textFont font.Face) *Game

func (*Game) Draw

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

func (*Game) Layout

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

func (*Game) Update

func (game *Game) Update() error

type HexMap

type HexMap struct {
	RandomSeed             int
	Background             *ebiten.Image
	BackgroundDirt         *ebiten.Image
	BackgroundGrass        *ebiten.Image
	BackgroundSea          *ebiten.Image
	BackgroundTiles        *ebiten.Image
	UI                     *ebiten.Image
	Board                  *Board
	Pathfinder             *Pathfinder
	TextFont               font.Face
	BackgroundImageOptions map[string]*LandImageOptions
	WaterImageOptions      map[string]*WaterImageOptions
	TownImageOptions       map[string]*LandImageOptions
}

func NewHexMap

func NewHexMap(mapNumber int, textFont font.Face) *HexMap

type LandImageOptions

type LandImageOptions struct {
	BgDirtImgIndex  int
	BgGrassImgIndex int
	FlipH           int
	FlipV           int
	RotateDegrees   int
}

type Pathfinder

type Pathfinder struct {
}

func NewPathfinder

func NewPathfinder() *Pathfinder

type Point2D

type Point2D struct {
	X int
	Y int
}

type Tile

type Tile struct {
	Field     *Field
	Parent    *Tile
	DistCost  float64
	TotalCost float64
}

type WaterImageOptions

type WaterImageOptions struct {
	WaterBgImgIndex int
	FlipH           int
	FlipV           int
	RotateDegrees   int
}

Jump to

Keyboard shortcuts

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