scenario

package
v0.0.0-...-55c2232 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

package play takes a map and turns it into a playable scenario

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CartPt

type CartPt struct {
	X float64
	Y float64
}

func (CartPt) ToISO

func (p CartPt) ToISO() IsoPt

type CellPoint

type CellPoint struct {
	IsoPt
	Z int
}

type IsoPt

type IsoPt struct {
	X float64
	Y float64
}

func (IsoPt) ToCart

func (p IsoPt) ToCart() CartPt

type Scenario

type Scenario struct {

	// All these must be modified by user actions somehow.
	// TODO: extract into the idea of a viewport passed to Update / Draw somehow?
	// Or have a separater Drawer for the Scenario?
	Viewpoint image.Point // Top-left of the screen
	ZIdx      int         // Currently-viewed Z index
	Zoom      float64     // Zoom level to set
	// contains filtered or unexported fields
}

func NewScenario

func NewScenario(assets *assetstore.AssetStore, name string) (*Scenario, error)

func (*Scenario) CellAtCursor

func (s *Scenario) CellAtCursor() (*maps.Cell, CellPoint)

func (*Scenario) ChangeZIdx

func (s *Scenario) ChangeZIdx(by int)

func (*Scenario) Draw

func (s *Scenario) Draw(screen *ebiten.Image) error

func (*Scenario) HighlightedCharacter

func (s *Scenario) HighlightedCharacter() *maps.Character

func (*Scenario) SelectHighlightedCharacter

func (s *Scenario) SelectHighlightedCharacter()

func (*Scenario) SelectedCharacter

func (s *Scenario) SelectedCharacter() *maps.Character

func (*Scenario) Update

func (s *Scenario) Update(screenX, screenY int) error

Jump to

Keyboard shortcuts

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