world

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FireTileA = 13
	FireTileB = 14
	FireTileC = 15
)

Fire tile IDs.

Variables

View Source
var World = &GameWorld{
	StartedAt: time.Now(),
	DuckStart: -1,
	DuckEnd:   -1,
}

Functions

func LoadMap

func LoadMap(filePath string)

func ObjectToRect

func ObjectToRect(o *tiled.Object) image.Rectangle

func TileToGameCoords

func TileToGameCoords(x, y int) (float64, float64)

Types

type GameWorld

type GameWorld struct {
	Map              *tiled.Map
	SpawnX, SpawnY   float64
	ObjectGroups     []*tiled.ObjectGroup
	StartedAt        time.Time
	GameStarted      bool
	GameOver         bool
	Player           gohan.Entity
	ScreenW, ScreenH int
	NoClip           bool
	Debug            int

	GameStartedTicks int

	FadingIn    bool
	FadeInTicks int

	OffsetX, OffsetY float64

	DuckStart float64
	DuckEnd   float64

	// Abilities
	CanDoubleJump bool
	CanDash       bool
	CanLevitate   bool

	// Items
	Keys int

	Jumps      int
	Dashes     int
	Levitating bool

	Rewinding bool

	MessageVisible bool
	MessageUpdated bool
	MessageTitle   string
	MessageText    string

	TriggerEntities []gohan.Entity
	TriggerRects    []image.Rectangle
	TriggerNames    []string

	DestructibleEntities []gohan.Entity
	DestructibleRects    []image.Rectangle

	DisableEsc bool
}

func (*GameWorld) SetMessage

func (w *GameWorld) SetMessage(message string)

Jump to

Keyboard shortcuts

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