loader

package
v0.0.0-...-e9d204a Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const MaxGridSize = 50

MaxGridSize is the maximum grid size

Variables

This section is empty.

Functions

func LoadLevel

func LoadLevel(packageData PackageData, levelNum, layoutWidth, layoutHeight int, gameSpriteSheet *ec.SpriteSheet) (gutils.Vec2d[Tile], loader.EntityComponentList, error)

LoadLevel loads a level

func PreloadEntities

func PreloadEntities(entityMetadataPath string, world w.World) loader.EntityComponentList

PreloadEntities preloads entities with components

Types

type PackageData

type PackageData struct {
	Name   string
	Levels []gutils.Vec2d[byte]
}

PackageData contains level package data

func LoadPackage

func LoadPackage(packageName string) (packageData PackageData, packageErr error)

LoadPackage loads level package from a text file

type Tile

type Tile uint8

Tile is a game tile

const (
	TilePlayer Tile = 1 << iota
	TileBox
	TileGoal
	TileWall
	TileEmpty Tile = 0
)

List of game tiles

func (*Tile) Contains

func (t *Tile) Contains(other Tile) bool

Contains checks if a game tile contains the provided tile

func (*Tile) ContainsAny

func (t *Tile) ContainsAny(other Tile) bool

ContainsAny checks if a game tile contains any of the provided tiles

func (*Tile) Remove

func (t *Tile) Remove(other Tile)

Remove removes the provided tile to a game tile

func (*Tile) Set

func (t *Tile) Set(other Tile)

Set adds the provided tile to a game tile

Jump to

Keyboard shortcuts

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