resources

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MoveUpAction is the action for moving up
	MoveUpAction = "MoveUp"

	// MoveDownAction is the action for moving down
	MoveDownAction = "MoveDown"

	// MoveLeftAction is the action for moving left
	MoveLeftAction = "MoveLeft"

	// MoveRightAction is the action for moving right
	MoveRightAction = "MoveRight"

	// PreviousLevelAction is the action for switching to the previous level
	PreviousLevelAction = "PreviousLevel"

	// NextLevelAction is the action for switching to the next level
	NextLevelAction = "NextLevel"

	// RestartAction is the action for restarting the level
	RestartAction = "Restart"

	// GoToLevelAction is the action for switching to a specific level
	GoToLevelAction = "GoToLevel"
)
View Source
const (
	StateEventNone       = StateEvent("NONE")
	StateEventWarpEscape = StateEvent("WARP_ESCAPE")
)
View Source
const (
	TileEmpty = gloader.TileEmpty
	TileWall  = gloader.TileWall
)

Tileはsystemなどでも使う。systemから直接gloaderを扱わせたくないので、ここでエクスポートする

Variables

This section is empty.

Functions

func UpdateGameLayout

func UpdateGameLayout(world w.World) (int, int)

UpdateGameLayoutはゲームウィンドウサイズを更新する

Types

type FieldPrefabs

type FieldPrefabs struct {
	LevelInfo   loader.EntityComponentList
	PackageInfo loader.EntityComponentList
}

type Game

type Game struct {
	StateEvent StateEvent
	Level      Level
}

type Level

type Level struct {
	// 階数
	Depth int
	// 横グリッド数
	Width int
	// 縦グリッド数
	Height int
}

現在の階層

func NewLevel added in v1.36.0

func NewLevel(world w.World, newDepth int, width int, height int) Level

func (*Level) XYIndex added in v1.36.0

func (l *Level) XYIndex(x int, y int) int

タイル座標から、タイルスライスのインデックスを求める

func (*Level) XYToTileXY added in v1.36.0

func (l *Level) XYToTileXY(x int, y int) (int, int)

xy座標をタイル座標に変換する

type Prefabs

type Prefabs struct {
	Intro loader.EntityComponentList
	Field FieldPrefabs
}

type StateEvent

type StateEvent string

フィールド上でのイベント

type Tile

type Tile = gloader.Tile

Jump to

Keyboard shortcuts

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