world

package
v0.0.0-...-39a46bb Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MapSize = 128
View Source
const TPS = 144
View Source
const TileSize = 4
View Source
const TileSizeEnvironment = 16

Variables

View Source
var (
	ScreenWidth  float64 = 800
	ScreenHeight float64 = 600

	CamX float64
	CamY float64

	CamScale    float64 = 1
	MinCamScale float64 = 1

	CursorX float64
	CursorY float64

	Map []Tile

	MapPath [][2]float64

	SelectX float64 = -1
	SelectY float64 = -1

	Debug int

	StartMuted bool

	ShownIntro bool

	DisableEsc bool
)

Functions

func LevelCoordinatesToScreen

func LevelCoordinatesToScreen(x, y float64) (float64, float64)

func PathTileIndex

func PathTileIndex(x, y float64) int

func PathTilesAtMapTile

func PathTilesAtMapTile(tx, ty float64) []int

func PixelCoordinatesOffScreen

func PixelCoordinatesOffScreen(x, y float64) bool

func ScreenCoordinatesToLevel

func ScreenCoordinatesToLevel(x, y float64) (float64, float64)

func TileIndex

func TileIndex(x, y float64) int

func ValidXY

func ValidXY(x, y int) bool

Types

type Tile

type Tile struct {
	X        float64
	Y        float64
	Walkable bool

	Sprite *ebiten.Image
}

func NewGameMap

func NewGameMap(seed int64) []Tile

func (Tile) Down

func (t Tile) Down() int

func (Tile) Left

func (t Tile) Left() int

func (Tile) PathEstimatedCost

func (t Tile) PathEstimatedCost(to astar.Pather) float64

func (Tile) PathNeighborCost

func (t Tile) PathNeighborCost(to astar.Pather) float64

func (Tile) PathNeighbors

func (t Tile) PathNeighbors() []astar.Pather

func (Tile) Right

func (t Tile) Right() int

func (Tile) Up

func (t Tile) Up() int

Jump to

Keyboard shortcuts

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