path

package
v0.0.0-...-4ede3f3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Act

type Act struct {
	ID   ids.Act `json:"id"`
	Lvl  ids.Lvl `json:"lvl"`
	Subj ids.Obj `json:"subj"`
	Verb Verb    `json:"verb,omitempty"`
	Obj  ids.Obj `json:"obj,omitempty"`

	Start Tick         `json:"start,omitempty"`
	Total Tick         `json:"total,omitempty"`
	Path  []pfind.Node `json:"path,omitempty"`
}

Act represents a action of a game object that may relate to another object at a given tick for a duration and can specifically also represent a path.

func (*Act) Make

func (*Act) Make(id uint32) Act

func (*Act) MarshalBinary

func (a *Act) MarshalBinary() ([]byte, error)

func (*Act) UID

func (a *Act) UID() uint32

func (*Act) UnmarshalBinary

func (a *Act) UnmarshalBinary(raw []byte) error

type ActTable

type ActTable = ids.HashTable[ids.Act, Act, *Act]

type Sys

type Sys struct {
	Act ActTable
}

Sys is the action, trigger and path system of a world.

type Tick

type Tick uint64

Tick represents our game time, that might be paused. Due to browser interop limited to 53 bit. We can cover 285616 years in millisecond precision.

type Verb

type Verb uint32

Verb is the kind of action to be done.

const (
	Go    Verb // Go to a level position
	Look       // Look at an object from afar
	Focus      // Focus an object to inspect it closely
	Use        // Use an object
	Loot       // Loot an objects inventory

)

Some common verbs are:

Jump to

Keyboard shortcuts

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