game

package
v0.0.0-...-47a16e8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: GPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BigPortrait = 52

BigPortrait is the dimensions of the big portraits in the game.

View Source
var PortraitBGBig = []Sprite{
	Sprite{
		Texture: "portrait-backgrounds.png", X: 0, Y: 0, W: BigPortrait, H: BigPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: BigPortrait, Y: 0, W: BigPortrait, H: BigPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: BigPortrait * 2, Y: 0, W: BigPortrait, H: BigPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: BigPortrait * 3, Y: 0, W: BigPortrait, H: BigPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: 0, Y: BigPortrait, W: BigPortrait, H: BigPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: BigPortrait, Y: BigPortrait, W: BigPortrait, H: BigPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: BigPortrait * 2, Y: BigPortrait, W: BigPortrait, H: BigPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: BigPortrait * 3, Y: BigPortrait, W: BigPortrait, H: BigPortrait,
	},
}

PortraitBGBig stores a list of portrait backgrounds for large icons.

View Source
var PortraitBGSmall = []Sprite{
	Sprite{
		Texture: "portrait-backgrounds.png", X: 0, Y: 208, W: SmallPortrait, H: SmallPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: SmallPortrait, Y: 208, W: SmallPortrait, H: SmallPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: SmallPortrait * 2, Y: 208, W: SmallPortrait, H: SmallPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: SmallPortrait * 3, Y: 208, W: SmallPortrait, H: SmallPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: 208, Y: 0, W: SmallPortrait, H: SmallPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: 208, Y: SmallPortrait, W: SmallPortrait, H: SmallPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: 208, Y: SmallPortrait * 2, W: SmallPortrait, H: SmallPortrait,
	},
	Sprite{
		Texture: "portrait-backgrounds.png", X: 208, Y: SmallPortrait * 3, W: SmallPortrait, H: SmallPortrait,
	},
}

PortraitBGSmall stores a list of portrait backgrounds for small icons.

View Source
var PortraitFrameBig = []Sprite{
	Sprite{
		Texture: "portrait-frames.png", X: 0, Y: 0, W: BigPortrait, H: BigPortrait,
	},
}

PortraitFrameBig stores a list of portrait frames for large icons.

View Source
var PortraitFrameSmall = []Sprite{
	Sprite{
		Texture: "portrait-frames.png", X: 0, Y: 208, W: SmallPortrait, H: SmallPortrait,
	},
}

PortraitFrameSmall stores a list of portrait frames for small icons.

View Source
var SmallPortrait = BigPortrait / 2

SmallPortrait is the dimensions of the small portraits in the game.

Functions

func CharacterPerformanceStrings

func CharacterPerformanceStrings() []string

CharacterPerformanceStrings returns a slice of all String values of the enum

func CharacterSexStrings

func CharacterSexStrings() []string

CharacterSexStrings returns a slice of all String values of the enum

func CombatResultStrings

func CombatResultStrings() []string

CombatResultStrings returns a slice of all String values of the enum

func DamageTypeStrings

func DamageTypeStrings() []string

DamageTypeStrings returns a slice of all String values of the enum

func MaxHealth

func MaxHealth(rawHealth, vitality int) int

func StatTypeStrings

func StatTypeStrings() []string

StatTypeStrings returns a slice of all String values of the enum

Types

type Alpha

type Alpha struct {
	Value float64 // Value should be between 0.0 and 1.0
}

Alpha is a component that controls how visible an Entity should be rendered.

func (*Alpha) Type

func (*Alpha) Type() string

Type of this Component.

type AnimationEndBehavior

type AnimationEndBehavior int

AnimationEndBehavior is an enum that describes what happens when a FrameAnimation Component finishes all of its frames.

const (
	// AnimationLoops means that the Animation will restart from the first frame
	// after the last frame expires.
	AnimationLoops AnimationEndBehavior = iota
	// HoldLastFrame means that the Animation will run through all frames, and
	// then stick on the last frame, removing the FrameAnimation Component.
	HoldLastFrame
	// DestroyEntity means that after the Animation is complete, the Entity that
	// owns it is destroyed.
	DestroyEntity
)

type AnimationSpeed

type AnimationSpeed struct {
	Speed float64
}

AnimationSpeed changes the rate at which Animtions are animated. A value of 1.0 is normal speed, and a value of 0.0 would mean that the animation never progresses from the first frame. 0.5 would animate at half speed.

func (*AnimationSpeed) Type

func (*AnimationSpeed) Type() string

Type of this Component.

type AnimationSystem

type AnimationSystem struct {
	// contains filtered or unexported fields
}

AnimationSystem animates the visual Components of Entities. It's not responsible for translating or mapping game concepts like "casting a spell" to the assignment of appropriate animation Components for that Entity.

func (*AnimationSystem) Update

func (as *AnimationSystem) Update(mgr *ecs.World, elapsed time.Duration)

Update all Animated Entities.

type Appearance

type Appearance struct {
	Participant Sprite `json:"participant"`
	FaceX       int    `json:"faceX"`
	FaceY       int    `json:"faceY"`
	FeetX       int    `json:"feetX"`
	FeetY       int    `json:"feetY"`
}

Appearance is how a Character appears in combat.

func (*Appearance) BigIcon

func (a *Appearance) BigIcon() Sprite

BigIcon creates a new Sprite to use as a 52 by 52 portrait.

func (*Appearance) SmallIcon

func (a *Appearance) SmallIcon() Sprite

SmallIcon creates a new Sprite to use as a 26 by 26 portrait.

type Camera

type Camera struct {
	// contains filtered or unexported fields
}

Camera is a class that stores focus and zoom values

func NewCamera

func NewCamera(width, height int, bus *event.Bus) *Camera

NewCamera creates a new camera for a view of the requested width and height

func (*Camera) Center

func (c *Camera) Center(x, y float64)

Center the view on a point.

func (*Camera) GetH

func (c *Camera) GetH() int

GetH returns the height of the game's window.

func (*Camera) GetW

func (c *Camera) GetW() int

GetW returns the width of the game's window.

func (*Camera) GetX

func (c *Camera) GetX() float64

GetX coordinate of the camera.

func (*Camera) GetY

func (c *Camera) GetY() float64

GetY coordinate of the camera.

func (*Camera) GetZoom

func (c *Camera) GetZoom() float64

GetZoom of the camera.

func (*Camera) Modulo

func (c *Camera) Modulo(x, y int) (int, int)

Modulo an x,y screen coordinate so that things that are beyond the limits of the screen are wrapped around. Use case is when you want to display something aligned to the bottom of the screen, you can set a negative y coordinate, and Modulo will convert that to screen height - y.

func (*Camera) ScreenToWorld

func (c *Camera) ScreenToWorld(sx, sy int) (wx, wy float64)

ScreenToWorld translates screen coordinates to world coordinates based on the current zoom and focus values.

func (*Camera) SetX

func (c *Camera) SetX(x float64)

SetX coordinate of the camera.

func (*Camera) SetY

func (c *Camera) SetY(y float64)

SetY coordinate of the camera.

func (*Camera) SetZoom

func (c *Camera) SetZoom(zoom float64)

SetZoom of the camera.

func (*Camera) Update

func (c *Camera) Update(elapsed time.Duration)

Update the camera so that interesting things can be panned to.

type Center

type Center struct {
	X, Y float64
}

Center defines the centre of something.

type Character

type Character struct {
	// Things that don't affect gameplay.
	Name          string
	Skin          string
	Hair          string
	PortraitBG    int
	PortraitFrame int

	// Intrinsic to the Character
	Profession string
	Sex        CharacterSex

	// InherantPreparation is the preparation value that this Character has as a
	// base, before values from their profession and equipped weapon are
	// applied.
	InherantPreparation int

	// InherantActionPoints is the base ActionPoints that this character has
	// before values from their profession and equipped weapon are applied.
	InherantActionPoints int

	CurrentHealth int
	BaseHealth    int

	Level                int
	StrengthPerLevel     float64
	AgilityPerLevel      float64
	IntelligencePerLevel float64
	VitalityPerLevel     float64

	Disambiguator float64 // random number to order Characters when their Preparation etc collide.

	// Masteries indexed by the enum value.
	Masteries map[Mastery]int
}

Character represents a character at the run level, and persists until the run is over.

func (*Character) Type

func (*Character) Type() string

Type of this Component.

type CharacterPerformance

type CharacterPerformance int
const (
	PerformIdle CharacterPerformance = iota
	PerformMove
	PerformSkill1
	PerformSkill2
	PerformSkill3
	PerformHurt
	PerformDying
	PerformVictory
)

func CharacterPerformanceString

func CharacterPerformanceString(s string) (CharacterPerformance, error)

CharacterPerformanceString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func CharacterPerformanceValues

func CharacterPerformanceValues() []CharacterPerformance

CharacterPerformanceValues returns all values of the enum

func (CharacterPerformance) IsACharacterPerformance

func (i CharacterPerformance) IsACharacterPerformance() bool

IsACharacterPerformance returns "true" if the value is listed in the enum definition. "false" otherwise

func (CharacterPerformance) MarshalJSON

func (i CharacterPerformance) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for CharacterPerformance

func (CharacterPerformance) String

func (i CharacterPerformance) String() string

func (*CharacterPerformance) UnmarshalJSON

func (i *CharacterPerformance) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CharacterPerformance

type CharacterSex

type CharacterSex int

CharacterSex is not CharacterGender, NB.

const (
	Male CharacterSex = iota
	Female
)

CharacterSexes only have two values. They represent XY and XX chromosomes.

func CharacterSexString

func CharacterSexString(s string) (CharacterSex, error)

CharacterSexString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func CharacterSexValues

func CharacterSexValues() []CharacterSex

CharacterSexValues returns all values of the enum

func (CharacterSex) IsACharacterSex

func (i CharacterSex) IsACharacterSex() bool

IsACharacterSex returns "true" if the value is listed in the enum definition. "false" otherwise

func (CharacterSex) MarshalJSON

func (i CharacterSex) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for CharacterSex

func (CharacterSex) String

func (i CharacterSex) String() string

func (*CharacterSex) UnmarshalJSON

func (i *CharacterSex) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for CharacterSex

type CombatBegan

type CombatBegan struct{}

CombatBegan occurs when a Combat has been initialised.

func (CombatBegan) Type

func (CombatBegan) Type() event.Type

Type of the Event.

type CombatConcluded

type CombatConcluded struct {
	Results map[ecs.Entity]CombatResult
}

CombatConcluded occurs when a Combat is over.

func (CombatConcluded) Type

func (CombatConcluded) Type() event.Type

Type of the Event.

type CombatMapRecipe

type CombatMapRecipe struct {
	Hexes        []CombatMapRecipeHex
	Starts       []geom.Key
	TileW, TileH int
}

type CombatMapRecipeHex

type CombatMapRecipeHex struct {
	Position geom.Key
	Obstacle ObstacleType
	Visuals  []CombatMapRecipeVisual
}

type CombatMapRecipeHexFrame

type CombatMapRecipeHexFrame struct {
	Texture  string
	X, Y     int
	W, H     int
	Duration time.Duration
}

type CombatMapRecipeVisual

type CombatMapRecipeVisual struct {
	Frames           []CombatMapRecipeHexFrame
	XOffset, YOffset int
	Layer            int
	Obscures         []geom.Key
}

type CombatResult

type CombatResult int
const (
	Victorious CombatResult = iota
	Defeated
	Escaped
)

func CombatResultString

func CombatResultString(s string) (CombatResult, error)

CombatResultString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func CombatResultValues

func CombatResultValues() []CombatResult

CombatResultValues returns all values of the enum

func (CombatResult) IsACombatResult

func (i CombatResult) IsACombatResult() bool

IsACombatResult returns "true" if the value is listed in the enum definition. "false" otherwise

func (CombatResult) String

func (i CombatResult) String() string

type DamageType

type DamageType int
const (
	PhysicalDamage DamageType = iota
	MagicalDamage
	FireDamage
)

func DamageTypeString

func DamageTypeString(s string) (DamageType, error)

DamageTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func DamageTypeValues

func DamageTypeValues() []DamageType

DamageTypeValues returns all values of the enum

func (DamageType) IsADamageType

func (i DamageType) IsADamageType() bool

IsADamageType returns "true" if the value is listed in the enum definition. "false" otherwise

func (DamageType) MarshalJSON

func (i DamageType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for DamageType

func (DamageType) String

func (i DamageType) String() string

func (*DamageType) UnmarshalJSON

func (i *DamageType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for DamageType

type DiagonalMatrixWipe

type DiagonalMatrixWipe struct {
	W, H          int
	Obscuring     bool
	OnComplete    func()
	OnInitialised func() // Useful for a !Obscuring to load stuff while the screen is hidden.
	// contains filtered or unexported fields
}

DiagonalMatrixWipe obscures the scene by animating in squares of curtain in a diagonal pattern.

func (*DiagonalMatrixWipe) Type

func (*DiagonalMatrixWipe) Type() string

Type of this Component.

type Facer

type Facer struct {
	Face geom.DirectionType
}

Facer is a Component that represents a direction to face in.

func (*Facer) Type

func (f *Facer) Type() string

Type of this Component.

type FadeIn

type FadeIn struct {
	Duration time.Duration
	// contains filtered or unexported fields
}

FadeIn is a Component that causes an Entity to appear over time.

func (*FadeIn) Type

func (*FadeIn) Type() string

Type of this Component.

type FadeOut

type FadeOut struct {
	Duration time.Duration
	// contains filtered or unexported fields
}

FadeOut is a Component that causes an Entity to disappear from view over time.

func (*FadeOut) Type

func (*FadeOut) Type() string

Type of this Component.

type FadeSystem

type FadeSystem struct{}

FadeSystem controls the Alpha Component of Entities by managing FadeOut and FadeIn Components.

func (*FadeSystem) Update

func (sys *FadeSystem) Update(mgr *ecs.World, elapsed time.Duration)

Update the system.

type FloatAwayAnimation

type FloatAwayAnimation struct {
	// Rate of floating away per second
	Rate float64
	// contains filtered or unexported fields
}

FloatAwayAnimation will offset the Entity upwards based on Rate as if it is a helium balloon floating away.

func (*FloatAwayAnimation) Type

func (*FloatAwayAnimation) Type() string

Type of this Component.

type Font

type Font struct {
	Text string
	Size string // Size should be (small|normal|large)

}

Font is renderable text.

func (*Font) Type

func (*Font) Type() string

Type of this Component.

type FontSystem

type FontSystem struct {
	// contains filtered or unexported fields
}

FontSystem manages the synchronization of Font Components to their composing child entities.

func NewFontSystem

func NewFontSystem(mgr *ecs.World) *FontSystem

NewFontSystem constructs a new FontSystem.

func (*FontSystem) Update

func (s *FontSystem) Update()

Update Fonts in the World.

type Frame

type Frame struct {
	DurationMs int    `json:"durationMs"`
	Sprite     Sprite `json:"sprite"`
}

type FrameAnimation

type FrameAnimation struct {
	Frames  []Sprite
	Timings []time.Duration
	Pointer time.Duration

	// by default, loops forever
	// on end - maybe another animation, maybe a single frame, maybe some behaviour like trigger event
	EndBehavior AnimationEndBehavior
}

FrameAnimation sets the Sprite of the Entity based on how far through the whole Animation is indicated by Pointer.

func NewFrameAnimationFromFrames

func NewFrameAnimationFromFrames(frames []Frame) *FrameAnimation

NewFrameAnimationFromFrames creates a new animation from a slice of Frames.

func (*FrameAnimation) Duration

func (fa *FrameAnimation) Duration() time.Duration

Duration of the entire Animation.

func (*FrameAnimation) Index

func (fa *FrameAnimation) Index() int

Index returns the index of the Sprite that Pointer is currently pointing at. It returns -1 if Pointer is negative or the index of one past the last element when Pointer is outside the range of Timings.

func (*FrameAnimation) Randomise

func (fa *FrameAnimation) Randomise() *FrameAnimation

Randomise the starting position of the Pointer.

func (*FrameAnimation) Type

func (*FrameAnimation) Type() string

Type of this Component.

type Hidden

type Hidden struct{}

Hidden is a Component that prevents the Entity from being rendered.

func (*Hidden) Type

func (f *Hidden) Type() string

Type of this Component.

type HoverAnimation

type HoverAnimation struct{}

HoverAnimation makes the entity float up and down.

func (*HoverAnimation) Type

func (*HoverAnimation) Type() string

Type of this Component.

type Leash

type Leash struct {
	Owner ecs.Entity

	LayerOffset int
}

Leash is a Component that makes the Entity Position follow another Entity's Position.

func (*Leash) Type

func (f *Leash) Type() string

Type of this Component.

type LeashSystem

type LeashSystem struct{}

LeashSystem synchronises the Position of Entities with a Leash Component to their Owner's Positions.

func (*LeashSystem) Update

func (sys *LeashSystem) Update(mgr *ecs.World, elapsed time.Duration)

Update the system.

type Mastery

type Mastery int

Mastery enumerates the types of Masteries or attunements that are available to Characters to learn on their journey.

const (
	// ShortRangeMeleeMastery (Daggers, Swords, Clubs, etc)
	ShortRangeMeleeMastery Mastery = iota
	// LongRangeMeleeMastery (Spears and Polearms)
	LongRangeMeleeMastery
	// RangedCombatMastery (Bows, Slingshots, Javelins, etc)
	RangedCombatMastery
	// CraftsmanshipMastery relates to non-magical utility skills
	CraftsmanshipMastery
	// FireMastery for fire spells
	FireMastery
	// WaterMastery for water spells
	WaterMastery
	// EarthMastery for earth spells
	EarthMastery
	// AirMastery for air spells
	AirMastery
	// LightningMastery for Lightning spells
	LightningMastery
	// DarkMastery for unholy spells
	DarkMastery
	// LightMastery for holy spells
	LightMastery
)

func (Mastery) String

func (i Mastery) String() string

type Obstacle

type Obstacle struct {
	M, N int

	ObstacleType ObstacleType
}

Obstacle is a Component that blocks a Hex.

func (*Obstacle) Type

func (o *Obstacle) Type() string

Type of the Component.

type ObstacleType

type ObstacleType int

ObstacleType is an enum.

const (
	NonObstacle ObstacleType = iota
	CharacterObstacle
	CrevasseObstacle
	TreeObstacle
	DeepWaterObstacle
	MudObstacle
)

ObstacleTypes represent the thing that is the obstacle. These might be static obstacle types, like a Tree or Rock, or another Character could be an Obstacle too.

func ParseObstacleType

func ParseObstacleType(s string) (ObstacleType, error)

ParseObstacleType parses an ObstacleType from a string.

func (ObstacleType) String

func (i ObstacleType) String() string

type Position

type Position struct {
	Center Center
	Layer  int

	// Absolute Positioned Components use screen coordinates, not world
	// coordinates.
	Absolute bool
}

Position is a Component that anything with a position in the world has.

func (*Position) Type

func (p *Position) Type() string

Type of this component.

type ProfessionDetails

type ProfessionDetails struct {
	ActionPoints int
	Preparation  int
}

type RenderOffset

type RenderOffset struct {
	X, Y int
}

RenderOffset is a value that offsets the position the Component should be rendered at. It can be used for visual effects or animations that should not affect the real Position of the Entity, just where it appears to be.

func (*RenderOffset) Type

func (s *RenderOffset) Type() string

Type of this Component.

type Scale

type Scale struct {
	X, Y float64
}

Scale defines a multiplier that is applied to the Entity's size.

func (*Scale) Type

func (*Scale) Type() string

Type of this Component.

type SceneWipeSystem

type SceneWipeSystem struct{}

SceneWipeSystem handles scene wipe Components that hide abrupt changes to the scene by fading in and out. Think of these as curtains that can be drawn to hide stage hands moving pieces of the set on and off the stage.

func NewSceneWipeSystem

func NewSceneWipeSystem() *SceneWipeSystem

NewSceneWipeSystem constructs a SceneWipeSystem.

func (*SceneWipeSystem) Update

func (cs *SceneWipeSystem) Update(mgr *ecs.World, elapsed time.Duration)

Update all scene wipe Components in the passed ecs.World.

type SomethingInteresting

type SomethingInteresting struct {
	X, Y float64
}

SomethingInteresting occurs when something interesting has occurred. The camera may want to focus on X,Y.

func (SomethingInteresting) Type

Type of the Event.

type Sprite

type Sprite struct {
	Texture string `json:"texture"`
	X       int    `json:"x"`
	Y       int    `json:"y"`
	W       int    `json:"w"`
	H       int    `json:"h"`

	// OffsetX and OffsetY exist as they can be applied to individual frames of
	// an animation. They do not duplicate the functionality of RenderOffset, as
	// that applies at the Entity level, and could effect the rendering position
	// of things that are not Sprites. (i.e shape primitives)
	OffsetX int `json:"offsetX"`
	OffsetY int `json:"offsetY"`
}

Sprite is a renderable slice of a texture.

func (Sprite) AsAnimation

func (s Sprite) AsAnimation() *FrameAnimation

AsAnimation wraps the Sprite in a FrameAnimation that only has a single frame. This is function is helpful when you have an interface that requires a FrameAnimation but you only want a single, static frame to be displayed.

func (*Sprite) Type

func (s *Sprite) Type() string

Type of this Component.

type SpriteRepeat

type SpriteRepeat struct {
	W, H int
}

SpriteRepeat is a component that repeats (or "tiles") a sprite across a width and height.

func (*SpriteRepeat) Type

func (*SpriteRepeat) Type() string

Type of this Component.

type Squad

type Squad struct {
	Members []ecs.Entity
}

Squad is a Component that marks a Squad of Characters

func (*Squad) Type

func (*Squad) Type() string

Type of this Component.

type StatType

type StatType int
const (
	HPStat StatType = iota
	EnergyStat
	ActionStat
	PrepStat
)

func StatTypeString

func StatTypeString(s string) (StatType, error)

StatTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func StatTypeValues

func StatTypeValues() []StatType

StatTypeValues returns all values of the enum

func (StatType) IsAStatType

func (i StatType) IsAStatType() bool

IsAStatType returns "true" if the value is listed in the enum definition. "false" otherwise

func (StatType) String

func (i StatType) String() string

type TakeDamageAnimation

type TakeDamageAnimation struct {
	// contains filtered or unexported fields
}

TakeDamageAnimation adds an offset that makes the Entity pendulum back and forth on the X axis as if they have been struck.

func (*TakeDamageAnimation) Type

func (*TakeDamageAnimation) Type() string

Type of this Component.

type Team

type Team struct {
	ID                 int64
	Control            TeamControl
	PedestalAppearance int
}

Team is a Component that represents a grouping of Characters that work together, and share a source of control.

func NewTeam

func NewTeam() *Team

NewTeam creates a new team.

func (*Team) Type

func (*Team) Type() string

Type of this Component.

type TeamControl

type TeamControl int

TeamControl marks the source of control.

const (
	// LocalControl means that the player is controlling this team.
	LocalControl TeamControl = iota

	// NoControl is for things that do not move
	NoControl

	// ComputerControl means that an AI script is controlling this team.
	ComputerControl
)

func (TeamControl) String

func (i TeamControl) String() string

type WindowSizeChanged

type WindowSizeChanged struct {
	OldW, OldH int
	NewW, NewH int
}

WindowSizeChanged occurs when the size of the window the game is running in changes.

func (WindowSizeChanged) Type

func (WindowSizeChanged) Type() event.Type

Type of the Event.

Directories

Path Synopsis
Package embark provides a Manager type to display a configuration mode to the player where they can design a squad to start a run with.
Package embark provides a Manager type to display a configuration mode to the player where they can design a squad to start a run with.
hbg

Jump to

Keyboard shortcuts

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