game

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: GPL-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AI_INITIATIVE_SLOTS represents the limited number of initiative time slots an AI can be updated (every N ticks)
	AI_INITIATIVE_SLOTS = 4

	// AI_INITIATIVE_TIMER is how many ticks between rerolling initiative slots
	AI_INITIATIVE_TIMER = 300
)
View Source
const (
	PARAM_KEY_DEBUG = "debug"

	CONFIG_KEY_SHOW_FPS         = "show_fps"
	CONFIG_KEY_SCREEN_WIDTH     = "screen.width"
	CONFIG_KEY_SCREEN_HEIGHT    = "screen.height"
	CONFIG_KEY_RENDER_SCALE     = "screen.render_scale"
	CONFIG_KEY_FOV_DEGREES      = "screen.fov_degrees"
	CONFIG_KEY_FULLSCREEN       = "screen.fullscreen"
	CONFIG_KEY_VSYNC            = "screen.vsync"
	CONFIG_KEY_RENDER_FLOOR     = "screen.render_floor"
	CONFIG_KEY_RENDER_DISTANCE  = "screen.render_distance"
	CONFIG_KEY_CLUTTER_DISTANCE = "screen.clutter_distance"
	CONFIG_KEY_OPENGL           = "screen.opengl"

	CONFIG_KEY_CRT_SHADER = "screen.crt_shader"

	CONFIG_KEY_HUD_ENABLED      = "hud.enabled"
	CONFIG_KEY_HUD_SCALE        = "hud.scale"
	CONFIG_KEY_HUD_FONT         = "hud.font"
	CONFIG_KEY_HUD_COLOR_CUSTOM = "hud.color.use_custom"
	CONFIG_KEY_HUD_COLOR_R      = "hud.color.red"
	CONFIG_KEY_HUD_COLOR_G      = "hud.color.green"
	CONFIG_KEY_HUD_COLOR_B      = "hud.color.blue"
	CONFIG_KEY_HUD_COLOR_A      = "hud.color.alpha"

	CONFIG_KEY_HUD_CROSSHAIR_INDEX = "hud.crosshair.index"

	CONFIG_KEY_AUDIO_BGM_VOL      = "audio.bgm_volume"
	CONFIG_KEY_AUDIO_SFX_VOL      = "audio.sfx_volume"
	CONFIG_KEY_AUDIO_SFX_CHANNELS = "audio.sfx_channels"

	CONFIG_KEY_CONTROL_DECAY = "controls.throttle_decay"
)
View Source
const (
	ActionUnknown input.Action = iota
	ActionUp
	ActionDown
	ActionLeft
	ActionRight
	ActionMoveAxes
	ActionTurretUp
	ActionTurretDown
	ActionTurretLeft
	ActionTurretRight
	ActionTurretAxes
	ActionMenu
	ActionBack
	ActionThrottleReverse
	ActionThrottle0
	ActionJumpJet
	ActionDescend
	ActionWeaponFire
	ActionWeaponCycle
	ActionWeaponGroupFireToggle
	ActionWeaponGroupSetModifier
	ActionWeaponGroup1
	ActionWeaponGroup2
	ActionWeaponGroup3
	ActionWeaponGroup4
	ActionWeaponGroup5
	ActionWeaponFireGroup1
	ActionWeaponFireGroup2
	ActionWeaponFireGroup3
	ActionWeaponFireGroup4
	ActionWeaponFireGroup5
	ActionNavCycle
	ActionRadarRangeCycle
	ActionTargetCrosshairs
	ActionTargetNearest
	ActionTargetNext
	ActionTargetPrevious
	ActionZoomToggle
	ActionLightAmpToggle
	ActionPowerToggle
	ActionCameraCycle
)
View Source
const (
	StrideStompLeft  = -1
	StrideStompRight = 1
	StrideStompBoth  = 0
)
View Source
const (
	SPLASH_TIMEOUT = 5.0
)

Variables

This section is empty.

Functions

func JumpJetSFXForMech

func JumpJetSFXForMech(m *model.Mech) (string, error)

func NewUIResources

func NewUIResources(fonts *fonts) (*uiResources, error)

func StompSFXForMech

func StompSFXForMech(m *model.Mech) (string, error)

Types

type AIBehavior added in v0.0.6

type AIBehavior struct {
	bt.Node
	// contains filtered or unexported fields
}

func (*AIBehavior) DetermineForcedWithdrawal added in v0.0.6

func (a *AIBehavior) DetermineForcedWithdrawal() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) FireWeapons added in v0.0.6

func (a *AIBehavior) FireWeapons() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) GuardArea added in v0.0.6

func (a *AIBehavior) GuardArea() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) GuardUnit added in v0.0.6

func (a *AIBehavior) GuardUnit() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) HasTarget added in v0.0.6

func (a *AIBehavior) HasTarget() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) HuntLastTargetArea added in v0.0.6

func (a *AIBehavior) HuntLastTargetArea() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) InWithdrawArea added in v0.0.6

func (a *AIBehavior) InWithdrawArea() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) LoadBehaviorTree added in v0.0.6

func (a *AIBehavior) LoadBehaviorTree(ai string, aiRes AIResources) bt.Node

func (*AIBehavior) PatrolPath added in v0.0.6

func (a *AIBehavior) PatrolPath() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) TargetIsAlive added in v0.0.6

func (a *AIBehavior) TargetIsAlive() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) Tick added in v0.0.6

func (a *AIBehavior) Tick() (bt.Status, error)

func (*AIBehavior) TurnToTarget added in v0.0.6

func (a *AIBehavior) TurnToTarget() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) TurnToWithdraw added in v0.0.6

func (a *AIBehavior) TurnToWithdraw() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) TurretToTarget added in v0.0.6

func (a *AIBehavior) TurretToTarget() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) VelocityToMax added in v0.0.6

func (a *AIBehavior) VelocityToMax() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) Wander added in v0.0.6

func (a *AIBehavior) Wander() func([]bt.Node) (bt.Status, error)

func (*AIBehavior) Withdraw added in v0.0.6

func (a *AIBehavior) Withdraw() func([]bt.Node) (bt.Status, error)

type AIDecoratorType added in v0.0.6

type AIDecoratorType int
const (
	AI_DECORATOR_NONE AIDecoratorType = iota
	AI_DECORATOR_NEGATE
)

func (AIDecoratorType) String added in v0.0.6

func (t AIDecoratorType) String() string

type AIFormation added in v0.0.6

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

func (*AIFormation) AddUnit added in v0.0.6

func (f *AIFormation) AddUnit(u model.Unit)

func (*AIFormation) SetLeader added in v0.0.6

func (f *AIFormation) SetLeader(u model.Unit)

type AIGunnery added in v0.0.6

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

func (*AIGunnery) Reset added in v0.0.6

func (n *AIGunnery) Reset()

type AIHandler added in v0.0.6

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

func NewAIHandler added in v0.0.6

func NewAIHandler(g *Game) *AIHandler

func (*AIHandler) LoadFormations added in v0.0.6

func (h *AIHandler) LoadFormations()

func (*AIHandler) NewAI added in v0.0.6

func (h *AIHandler) NewAI(u model.Unit, ai string, aiRes AIResources) *AIBehavior

func (*AIHandler) UnitAI added in v0.0.6

func (h *AIHandler) UnitAI(u model.Unit) *AIBehavior

func (*AIHandler) Update added in v0.0.6

func (h *AIHandler) Update()

type AIInitiative added in v0.0.6

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

func NewAIInitiative added in v0.0.6

func NewAIInitiative(aiList []*AIBehavior) *AIInitiative

func (*AIInitiative) Next added in v0.0.6

func (n *AIInitiative) Next() []*AIBehavior

type AINodeID added in v0.0.6

type AINodeID string

type AINodeType added in v0.0.6

type AINodeType int
const (
	AI_NODE_DEFAULT AINodeType = iota
	AI_NODE_TREE
)

func (AINodeType) String added in v0.0.6

func (t AINodeType) String() string

func (*AINodeType) UnmarshalText added in v0.0.6

func (t *AINodeType) UnmarshalText(b []byte) error

Unmarshals into AINodeType

type AIPathing added in v0.0.6

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

func (*AIPathing) Len added in v0.0.6

func (p *AIPathing) Len() int

func (*AIPathing) Next added in v0.0.6

func (p *AIPathing) Next() *geom.Vector2

func (*AIPathing) Pop added in v0.0.6

func (p *AIPathing) Pop()

func (*AIPathing) SetDestination added in v0.0.6

func (p *AIPathing) SetDestination(destPos *geom.Vector2, destPath []*geom.Vector2)

type AIPiloting added in v0.0.6

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

func (*AIPiloting) Reset added in v0.0.6

func (p *AIPiloting) Reset()

type AIResourceNode added in v0.0.6

type AIResourceNode struct {
	ID         AINodeID             `json:"id" validate:"required"`
	Name       string               `json:"name" validate:"required"`
	Title      string               `json:"title" validate:"required"`
	Child      AINodeID             `json:"child"`
	Children   []AINodeID           `json:"children"`
	Properties AIResourceProperties `json:"properties"`
}

type AIResourceProperties added in v0.0.6

type AIResourceProperties struct {
	Type AINodeType
}

type AIResourceTree added in v0.0.6

type AIResourceTree struct {
	Title string                      `json:"title" validate:"required"`
	Root  AINodeID                    `json:"root" validate:"required"`
	Nodes map[AINodeID]AIResourceNode `json:"nodes" validate:"required"`
}

type AIResources added in v0.0.6

type AIResources struct {
	Trees map[string]AIResourceTree
}

type AudioHandler

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

func NewAudioHandler

func NewAudioHandler() *AudioHandler

NewAudioHandler creates a new audio handler instance

func (*AudioHandler) EngineAmbience

func (a *AudioHandler) EngineAmbience() _sfxTypeHint

IsEngineAmbience indicates whether the current engine audio is the ambience loop

func (*AudioHandler) IsButtonAudioPlaying

func (a *AudioHandler) IsButtonAudioPlaying() bool

IsButtonAudioPlaying returns true if the button audio channel is still playing

func (*AudioHandler) IsMusicPlaying

func (a *AudioHandler) IsMusicPlaying() bool

IsMusicPlaying return true if background music is currently playing

func (*AudioHandler) PauseMusic

func (a *AudioHandler) PauseMusic()

PauseMusic pauses play of background music

func (*AudioHandler) PauseSFX

func (a *AudioHandler) PauseSFX()

PauseSFX pauses all sound effect sources

func (*AudioHandler) PlayButtonAudio

func (a *AudioHandler) PlayButtonAudio(buttonResource AudioInterfaceResource)

PlayButtonAudio plays the indicated button audio channel resource

func (*AudioHandler) PlayEffectAudio

func (a *AudioHandler) PlayEffectAudio(g *Game, p *render.EffectSprite)

PlayEffectAudio plays effect audio near the player

func (*AudioHandler) PlayEntityAudioLoop

func (a *AudioHandler) PlayEntityAudioLoop(g *Game, sfxFile string, entity model.Entity, intensityDist, maxVolume float64)

PlayEntityAudioLoop plays audio that may be near the player emitted from an Entity object intensityDist - distance of 100% sound intensity before volume begins to dropoff at a rate of 1/d^2 maxVolume - the maximum volume percent to be perceived by the player

func (*AudioHandler) PlayExternalAudio

func (a *AudioHandler) PlayExternalAudio(g *Game, sfxFile string, extPosX, extPosY, extPosZ, intensityDist, maxVolume float64)

PlayExternalAudio plays audio that may be near the player taking into account distance/direction for volume/panning intensityDist - distance of 100% sound intensity before volume begins to dropoff at a rate of 1/d^2 maxVolume - the maximum volume percent to be perceived by the player

func (*AudioHandler) PlayExternalWeaponFireAudio

func (a *AudioHandler) PlayExternalWeaponFireAudio(g *Game, weapon model.Weapon, extUnit model.Unit)

PlayExternalWeaponFireAudio plays weapon fire audio fired by units other than the player

func (*AudioHandler) PlayLocalWeaponFireAudio

func (a *AudioHandler) PlayLocalWeaponFireAudio(weapon model.Weapon)

PlayLocalWeaponFireAudio plays weapon fire audio intended only if fired by the player unit

func (*AudioHandler) PlayLoopEntitySFX

func (a *AudioHandler) PlayLoopEntitySFX(sfxFile string, entity model.Entity, sourceVolume, panPercent float64)

PlayLoopEntitySFX plays given looping sound effect as emitted from an Entity object, if not already playing

func (*AudioHandler) PlayPowerOffSequence

func (a *AudioHandler) PlayPowerOffSequence()

PlayPowerOffSequence plays the power down sound using the engine audio source

func (*AudioHandler) PlayPowerOnSequence

func (a *AudioHandler) PlayPowerOnSequence()

PlayPowerOnSequence plays the power on sound using the engine audio source

func (*AudioHandler) PlayProjectileImpactAudio

func (a *AudioHandler) PlayProjectileImpactAudio(g *Game, p *render.ProjectileSprite)

PlayProjectileImpactAudio plays projectile impact audio near the player

func (*AudioHandler) PlaySFX

func (a *AudioHandler) PlaySFX(sfxFile string, sourceVolume, panPercent float64)

PlaySFX plays given external sound effect file

func (*AudioHandler) ResumeMusic

func (a *AudioHandler) ResumeMusic()

ResumeMusic resumes play of background music

func (*AudioHandler) ResumeSFX

func (a *AudioHandler) ResumeSFX()

ResumeSFX resumes play of all sound effect sources

func (*AudioHandler) SetMusicVolume

func (a *AudioHandler) SetMusicVolume(strength float64)

SetMusicVolume sets volume of background music

func (*AudioHandler) SetSFXChannels

func (a *AudioHandler) SetSFXChannels(numChannels int)

SetSFXChannels sets max number of external sound effect channels

func (*AudioHandler) SetSFXVolume

func (a *AudioHandler) SetSFXVolume(strength float64)

SetSFXVolume sets volume of all sound effect sources

func (*AudioHandler) SetStompSFX

func (a *AudioHandler) SetStompSFX(sfxFile string)

func (*AudioHandler) StartEngineAmbience

func (a *AudioHandler) StartEngineAmbience()

StartEngineAmbience starts the ambient engine audio loop

func (*AudioHandler) StartMenuMusic

func (a *AudioHandler) StartMenuMusic()

StartMenuMusic starts main menu background music audio loop

func (*AudioHandler) StartMusicFromFile

func (a *AudioHandler) StartMusicFromFile(path string)

StartMusicFromFile starts background music audio loop

func (*AudioHandler) StopEngineAmbience

func (a *AudioHandler) StopEngineAmbience()

StopEngineAmbience stop the ambient engine audio loop

func (*AudioHandler) StopEntityAudioLoop

func (a *AudioHandler) StopEntityAudioLoop(g *Game, sfxFile string, entity model.Entity)

StopEntityAudioLoop stops audio emitted from an Entity object that may have been playing

func (*AudioHandler) StopLoopEntitySFX

func (a *AudioHandler) StopLoopEntitySFX(sfxFile string, entity model.Entity)

StopLoopEntitySFX stops given looping sound effect as emitted from an Entity object

func (*AudioHandler) StopMusic

func (a *AudioHandler) StopMusic()

StopMusic stops and closes the background music source

func (*AudioHandler) StopSFX

func (a *AudioHandler) StopSFX()

StopSFX stops and closes all sound effect sources

type AudioInterfaceResource

type AudioInterfaceResource string
const (
	AUDIO_BUTTON_AFF    AudioInterfaceResource = "audio/sfx/button-aff.ogg"
	AUDIO_BUTTON_NEG    AudioInterfaceResource = "audio/sfx/button-neg.ogg"
	AUDIO_BUTTON_OVER   AudioInterfaceResource = "audio/sfx/button-over.ogg"
	AUDIO_CLICK_AFF     AudioInterfaceResource = "audio/sfx/click-aff.ogg"
	AUDIO_CLICK_NEG     AudioInterfaceResource = "audio/sfx/click-neg.ogg"
	AUDIO_SELECT_TARGET AudioInterfaceResource = "audio/sfx/select-target.ogg"
)

type AudioMainSource

type AudioMainSource int
const (
	AUDIO_INTERFACE AudioMainSource = iota
	AUDIO_ENGINE
	AUDIO_STOMP_LEFT
	AUDIO_STOMP_RIGHT
	AUDIO_JUMP_JET
)

type BGMHandler

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

type BasicObjective added in v0.0.1

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

func (*BasicObjective) Completed added in v0.0.1

func (o *BasicObjective) Completed() bool

func (*BasicObjective) Current added in v0.0.1

func (o *BasicObjective) Current() bool

func (*BasicObjective) Failed added in v0.0.1

func (o *BasicObjective) Failed() bool

type ClutterHandler

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

func NewClutterHandler

func NewClutterHandler() *ClutterHandler

func (*ClutterHandler) Update

func (c *ClutterHandler) Update(g *Game, forceUpdate bool)

type DebriefMenu added in v0.0.1

type DebriefMenu struct {
	*MenuModel
	// contains filtered or unexported fields
}

func (*DebriefMenu) Draw added in v0.0.1

func (m *DebriefMenu) Draw(screen *ebiten.Image)

func (*DebriefMenu) Update added in v0.0.1

func (m *DebriefMenu) Update()

type DestroyObjective added in v0.0.1

type DestroyObjective struct {
	*BasicObjective
	// contains filtered or unexported fields
}

func (*DestroyObjective) Text added in v0.0.1

func (o *DestroyObjective) Text() string

func (*DestroyObjective) Update added in v0.0.1

func (o *DestroyObjective) Update(g *Game)

type DustoffObjective added in v0.0.1

type DustoffObjective struct {
	*BasicObjective
	// contains filtered or unexported fields
}

func (*DustoffObjective) Text added in v0.0.1

func (o *DustoffObjective) Text() string

func (*DustoffObjective) Update added in v0.0.1

func (o *DustoffObjective) Update(g *Game)

type EntityCollision

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

type FloorTexture

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

type Game

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

Game - This is the main type for your game.

func NewGame

func NewGame() *Game

NewGame - Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.

func (*Game) CameraLine3dTo added in v0.0.1

func (g *Game) CameraLine3dTo(posX, posY, posZ float64) *geom3d.Line3d

CameraLine3dTo returns a 3D Line of the current camera position to the given position

func (*Game) CameraLineTo added in v0.0.1

func (g *Game) CameraLineTo(posX, posY float64) *geom.Line

CameraLineTo returns a 2D Line of the current camera position to the given position

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image)

Draw draws the game screen. Draw is called every frame (typically 1/60[s] for 60Hz display).

func (*Game) GetHUDElement

func (g *Game) GetHUDElement(t HUDElementType) HUDElement

func (*Game) InProgress added in v0.0.1

func (g *Game) InProgress() bool

func (*Game) IsFriendly added in v0.0.6

func (g *Game) IsFriendly(e1, e2 model.Entity) bool

func (*Game) Layout

func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int)

Layout takes the outside size (e.g., the window size) and returns the (logical) screen size. If you don't have to adjust the screen size with the outside size, just return a fixed size.

func (*Game) LeaveGame added in v0.0.1

func (g *Game) LeaveGame()

func (*Game) LoadMission added in v0.0.4

func (g *Game) LoadMission(missionFile string) (*model.Mission, error)

func (*Game) LoadUnit added in v0.0.4

func (g *Game) LoadUnit(unitResourceType, unitFile string) model.Unit

func (*Game) RandomUnit added in v0.0.4

func (g *Game) RandomUnit(unitResourceType string) model.Unit

func (*Game) Resources added in v0.0.4

func (g *Game) Resources() *model.ModelResources

func (*Game) Run

func (g *Game) Run()

Run is the Ebiten Run loop caller

func (*Game) SetPlayerUnit

func (g *Game) SetPlayerUnit(unit model.Unit)

func (*Game) SetScene added in v0.0.4

func (g *Game) SetScene(scene Scene)

func (*Game) Update

func (g *Game) Update() error

Update - Allows the game to run logic such as updating the world, gathering input, and playing audio. Update is called every tick (1/60 [s] by default).

func (*Game) UpdateSprites added in v0.0.6

func (g *Game) UpdateSprites()

type GameMenu

type GameMenu struct {
	*MenuModel
	// contains filtered or unexported fields
}

func (*GameMenu) Draw

func (m *GameMenu) Draw(screen *ebiten.Image)

func (*GameMenu) Update

func (m *GameMenu) Update()

type GameScene added in v0.0.1

type GameScene struct {
	Game *Game
	// contains filtered or unexported fields
}

func NewGameScene added in v0.0.1

func NewGameScene(g *Game) *GameScene

func (*GameScene) Draw added in v0.0.1

func (s *GameScene) Draw(screen *ebiten.Image)

func (*GameScene) Update added in v0.0.1

func (s *GameScene) Update() error

type HUDElement

type HUDElement interface {
	Draw(bounds image.Rectangle, hudOpts *render.DrawHudOptions)
	Width() int
	Height() int
	Scale() float64
	SetScale(float64)
}

type HUDElementType

type HUDElementType int
const (
	HUD_FPS HUDElementType = iota
	HUD_BANNER
	HUD_ALTIMETER
	HUD_ARMAMENT
	HUD_COMPASS
	HUD_CROSSHAIRS
	HUD_HEAT
	HUD_JETS
	HUD_NAV_RETICLE
	HUD_NAV_STATUS
	HUD_PLAYER_STATUS
	HUD_RADAR
	HUD_FRIENDLY_RETICLE
	HUD_TARGET_RETICLE
	HUD_TARGET_STATUS
	HUD_THROTTLE
	TOTAL_HUD_ELEMENT_TYPES
)

type InstantActionScene

type InstantActionScene struct {
	Game *Game
	// contains filtered or unexported fields
}

func NewInstantActionScene

func NewInstantActionScene(g *Game) *InstantActionScene

func (*InstantActionScene) Draw

func (s *InstantActionScene) Draw(screen *ebiten.Image)

func (*InstantActionScene) SetMenu

func (s *InstantActionScene) SetMenu(m Menu)

func (*InstantActionScene) Update

func (s *InstantActionScene) Update() error

type IntroScene

type IntroScene struct {
	Game *Game
	// contains filtered or unexported fields
}

func NewIntroScene

func NewIntroScene(g *Game) *IntroScene

func (*IntroScene) Draw

func (s *IntroScene) Draw(screen *ebiten.Image)

func (*IntroScene) Update

func (s *IntroScene) Update() error

type LaunchMenu

type LaunchMenu struct {
	*MenuModel
	// contains filtered or unexported fields
}

func (*LaunchMenu) Draw

func (m *LaunchMenu) Draw(screen *ebiten.Image)

func (*LaunchMenu) Update

func (m *LaunchMenu) Update()

type LogFormat

type LogFormat struct {
	TimestampFormat string
}

func (*LogFormat) Format

func (f *LogFormat) Format(entry *logrus.Entry) ([]byte, error)
type MainMenu struct {
	*MenuModel
}
func (m *MainMenu) Draw(screen *ebiten.Image)
func (m *MainMenu) Update()
type Menu interface {
	Active() bool
	Closing() bool
	UI() *ebitenui.UI
	Root() *widget.Container
	SetWindow(*widget.Window)
	CloseWindow() *widget.Window
	Resources() *uiResources
	Game() *Game
	FontScale() float64
	MarginX() int
	MarginY() int
	Padding() int
	Spacing() int
	Resolutions() []MenuResolution
	Update()
	Draw(screen *ebiten.Image)
}
type MenuAspectRatio struct {
	// contains filtered or unexported fields
}
type MenuModel struct {
	// contains filtered or unexported fields
}
func (m *MenuModel) Active() bool
func (m *MenuModel) CloseWindow() *widget.Window
func (m *MenuModel) Closing() bool
func (m *MenuModel) FontScale() float64
func (m *MenuModel) Game() *Game
func (m *MenuModel) MarginX() int
func (m *MenuModel) MarginY() int
func (m *MenuModel) Padding() int
func (m *MenuModel) Resolutions() []MenuResolution
func (m *MenuModel) Resources() *uiResources
func (m *MenuModel) Root() *widget.Container
func (m *MenuModel) SetWindow(window *widget.Window)
func (m *MenuModel) Spacing() int
func (m *MenuModel) UI() *ebitenui.UI
type MenuResolution struct {
	// contains filtered or unexported fields
}
func (r MenuResolution) String() string
type MenuScene struct {
	Game *Game
	// contains filtered or unexported fields
}

func NewMenuScene

func NewMenuScene(g *Game) *MenuScene
func (s *MenuScene) Draw(screen *ebiten.Image)
func (s *MenuScene) SetMenu(m Menu)
func (s *MenuScene) Update() error

type MissionCard

type MissionCard struct {
	*widget.Container
	// contains filtered or unexported fields
}

type MissionCardStyle

type MissionCardStyle int
const (
	MissionCardSelect MissionCardStyle = iota
	MissionCardLaunch
	MissionCardGame
	MissionCardDebrief
)

type MissionDebriefScene added in v0.0.1

type MissionDebriefScene struct {
	Game *Game
	// contains filtered or unexported fields
}

func NewMissionDebriefScene added in v0.0.1

func NewMissionDebriefScene(g *Game) *MissionDebriefScene

func (*MissionDebriefScene) Draw added in v0.0.1

func (s *MissionDebriefScene) Draw(screen *ebiten.Image)

func (*MissionDebriefScene) SetMenu added in v0.0.1

func (s *MissionDebriefScene) SetMenu(m Menu)

func (*MissionDebriefScene) Update added in v0.0.1

func (s *MissionDebriefScene) Update() error

type MissionMenu

type MissionMenu struct {
	*MenuModel
	// contains filtered or unexported fields
}

func (*MissionMenu) Draw

func (m *MissionMenu) Draw(screen *ebiten.Image)

func (*MissionMenu) Update

func (m *MissionMenu) Update()

type MouseMode

type MouseMode int
const (
	MouseModeTurret MouseMode = iota
	MouseModeBody
	MouseModeCursor
)

type Objective added in v0.0.1

type Objective interface {
	Update(*Game)
	Current() bool
	Completed() bool
	Failed() bool
	Text() string
}

type ObjectivesHandler added in v0.0.1

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

func NewObjectivesHandler added in v0.0.1

func NewObjectivesHandler(g *Game, objectives *model.MissionObjectives) *ObjectivesHandler

func (*ObjectivesHandler) Status added in v0.0.1

func (o *ObjectivesHandler) Status() ObjectivesStatus

func (*ObjectivesHandler) Text added in v0.0.1

func (o *ObjectivesHandler) Text() string

func (*ObjectivesHandler) Update added in v0.0.1

func (o *ObjectivesHandler) Update(g *Game)

type ObjectivesStatus added in v0.0.1

type ObjectivesStatus int
const (
	OBJECTIVES_IN_PROGRESS ObjectivesStatus = iota
	OBJECTIVES_COMPLETED
	OBJECTIVES_FAILED
)

type Player

type Player struct {
	model.Unit
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(unit model.Unit, sprite *render.Sprite, x, y, z, angle, pitch float64) *Player

func (*Player) CameraPosXY added in v0.0.6

func (p *Player) CameraPosXY() (pos *geom.Vector2)

func (*Player) CameraPosition

func (p *Player) CameraPosition() (pos *geom.Vector2, posZ, angle, pitch float64)

func (*Player) DebugCameraTarget added in v0.0.6

func (p *Player) DebugCameraTarget() (t model.Unit)

func (*Player) Eject added in v0.0.1

func (p *Player) Eject(g *Game) bool

func (*Player) HasTurret added in v0.0.1

func (p *Player) HasTurret() bool

func (*Player) Heading added in v0.0.1

func (p *Player) Heading() float64

func (*Player) NavPoint added in v0.0.1

func (p *Player) NavPoint() *model.NavPoint

func (*Player) PitchCamera added in v0.0.1

func (p *Player) PitchCamera(pSpeed float64)

Pitch camera, relative to current pitch, by rotation speed

func (*Player) PosZ added in v0.0.1

func (p *Player) PosZ() float64

func (*Player) RotateCamera added in v0.0.1

func (p *Player) RotateCamera(rSpeed float64)

Rotate camera, relative to current angle, by rotation speed

func (*Player) SetDebugCameraTarget added in v0.0.6

func (p *Player) SetDebugCameraTarget(t model.Unit)

func (*Player) SetHeading added in v0.0.1

func (p *Player) SetHeading(angle float64)

func (*Player) SetPosZ

func (p *Player) SetPosZ(z float64)

func (*Player) SetTargetRelativeHeading added in v0.0.1

func (p *Player) SetTargetRelativeHeading(rHeading float64)

func (*Player) TurretAngle added in v0.0.1

func (p *Player) TurretAngle() float64

func (*Player) Update

func (p *Player) Update() bool

type PlayerAliveObjective added in v0.0.1

type PlayerAliveObjective struct {
	*BasicObjective
}

func (*PlayerAliveObjective) Text added in v0.0.1

func (o *PlayerAliveObjective) Text() string

func (*PlayerAliveObjective) Update added in v0.0.1

func (o *PlayerAliveObjective) Update(g *Game)

type ProjectileSpawn added in v0.0.6

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

func NewDelayedProjectileSpawn added in v0.0.6

func NewDelayedProjectileSpawn(delay, spread float64, weapon model.Weapon, parent model.Entity, sfxEnabled bool) *ProjectileSpawn

func NewProjectileSpawn added in v0.0.6

func NewProjectileSpawn(weapon model.Weapon, parent model.Entity) *ProjectileSpawn

type ProtectObjective added in v0.0.1

type ProtectObjective struct {
	*BasicObjective
	// contains filtered or unexported fields
}

func (*ProtectObjective) Text added in v0.0.1

func (o *ProtectObjective) Text() string

func (*ProtectObjective) Update added in v0.0.1

func (o *ProtectObjective) Update(g *Game)

type SFXHandler

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

type SFXSource

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

func NewSoundEffectSource

func NewSoundEffectSource(sourceVolume float64) *SFXSource

NewSoundEffectSource creates a new sound effect channel

func (*SFXSource) Close

func (s *SFXSource) Close()

Close stops and closes the sound effect player

func (*SFXSource) IsPlaying

func (s *SFXSource) IsPlaying() bool

IsPlaying returns true if the sound effect is currently playing

func (*SFXSource) LoadLoopSFX

func (s *SFXSource) LoadLoopSFX(a *AudioHandler, sfxFile string) error

LoadLoopSFX loads a new looping sound effect player into the sound effect channel

func (*SFXSource) LoadSFX

func (s *SFXSource) LoadSFX(a *AudioHandler, sfxFile string) error

LoadSFX loads a new sound effect player into the sound effect channel

func (*SFXSource) Pause

func (s *SFXSource) Pause()

Pause pauses the sound effect player

func (*SFXSource) Play

func (s *SFXSource) Play()

Play starts playing the sound effect player from the beginning of the effect

func (*SFXSource) Resume

func (s *SFXSource) Resume()

Resume resumes the sound effect player without rewinding

func (*SFXSource) SetPan

func (s *SFXSource) SetPan(panPercent float64)

SetPan sets the left/right panning percent of the sound channel

func (*SFXSource) SetSourceVolume

func (s *SFXSource) SetSourceVolume(sourceVolume float64)

SetSourceVolume sets the relative volume modifier of the sound channel

func (*SFXSource) UpdateVolume

func (s *SFXSource) UpdateVolume()

UpdateVolume updates the volume of the sound channel taking into account relative volume modifier

type Scene

type Scene interface {
	Update() error
	Draw(screen *ebiten.Image)
}

type SceneEffect

type SceneEffect interface {
	Update() error
	Draw(screen *ebiten.Image)
}

type SceneShader added in v0.0.1

type SceneShader interface {
	Update() error
	Draw(screen, img *ebiten.Image)
}

type SceneTransition

type SceneTransition interface {
	Completed() bool
	SetImage(img *ebiten.Image)
	Update() error
	Draw(screen *ebiten.Image)
}

type SettingsMenu

type SettingsMenu struct {
	*MenuModel
	// contains filtered or unexported fields
}

func (*SettingsMenu) Draw

func (m *SettingsMenu) Draw(screen *ebiten.Image)

func (*SettingsMenu) Update

func (m *SettingsMenu) Update()

type SplashScene added in v0.0.3

type SplashScene struct {
	Game *Game
	// contains filtered or unexported fields
}

func NewSplashScene added in v0.0.3

func NewSplashScene(g *Game) *SplashScene

func (*SplashScene) Draw added in v0.0.3

func (s *SplashScene) Draw(screen *ebiten.Image)

func (*SplashScene) Update added in v0.0.3

func (s *SplashScene) Update() error

type SplashScreen

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

func NewSplashScreen added in v0.0.1

func NewSplashScreen(g *Game) *SplashScreen

type SpriteHandler

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

func NewSpriteHandler

func NewSpriteHandler() *SpriteHandler

type SpriteType

type SpriteType int
const (
	MapSpriteType SpriteType = iota
	MechSpriteType
	VehicleSpriteType
	VTOLSpriteType
	InfantrySpriteType
	EmplacementSpriteType
	ProjectileSpriteType
	EffectSpriteType
	TotalSpriteTypes
)

type StrideDirection

type StrideDirection uint
const (
	StrideUp StrideDirection = iota
	StrideDown
)

type TargetCycleType

type TargetCycleType int
const (
	TARGET_NEXT TargetCycleType = iota
	TARGET_PREVIOUS
	TARGET_NEAREST
)

type TextureHandler

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

func NewTextureHandler

func NewTextureHandler(mapObj *model.Map) *TextureHandler

func (*TextureHandler) FloorTextureAt

func (t *TextureHandler) FloorTextureAt(x, y int) *image.RGBA

func (*TextureHandler) TextureAt

func (t *TextureHandler) TextureAt(x, y, levelNum, side int) *ebiten.Image

type UnitCard

type UnitCard struct {
	*widget.Container
	// contains filtered or unexported fields
}

type UnitCardStyle

type UnitCardStyle int
const (
	UnitCardSelect UnitCardStyle = iota
	UnitCardLaunch
	UnitCardGame
	UnitCardDebrief
)

type UnitMenu

type UnitMenu struct {
	*MenuModel
	// contains filtered or unexported fields
}

func (*UnitMenu) Draw

func (m *UnitMenu) Draw(screen *ebiten.Image)

func (*UnitMenu) Update

func (m *UnitMenu) Update()

type VisitObjective added in v0.0.1

type VisitObjective struct {
	*BasicObjective
	// contains filtered or unexported fields
}

func (*VisitObjective) Text added in v0.0.1

func (o *VisitObjective) Text() string

func (*VisitObjective) Update added in v0.0.1

func (o *VisitObjective) Update(g *Game)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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