Documentation ¶
Index ¶
- Constants
- func JumpJetSFXForMech(m *model.Mech) (string, error)
- func NewUIResources(fonts *fonts) (*uiResources, error)
- func StompSFXForMech(m *model.Mech) (string, error)
- type AudioHandler
- func (a *AudioHandler) EngineAmbience() _sfxTypeHint
- func (a *AudioHandler) IsButtonAudioPlaying() bool
- func (a *AudioHandler) IsMusicPlaying() bool
- func (a *AudioHandler) PauseMusic()
- func (a *AudioHandler) PauseSFX()
- func (a *AudioHandler) PlayButtonAudio(buttonResource AudioInterfaceResource)
- func (a *AudioHandler) PlayEffectAudio(g *Game, p *render.EffectSprite)
- func (a *AudioHandler) PlayEntityAudioLoop(g *Game, sfxFile string, entity model.Entity, intensityDist, maxVolume float64)
- func (a *AudioHandler) PlayExternalAudio(g *Game, sfxFile string, ...)
- func (a *AudioHandler) PlayExternalWeaponFireAudio(g *Game, weapon model.Weapon, extUnit model.Unit)
- func (a *AudioHandler) PlayLocalWeaponFireAudio(weapon model.Weapon)
- func (a *AudioHandler) PlayLoopEntitySFX(sfxFile string, entity model.Entity, sourceVolume, panPercent float64)
- func (a *AudioHandler) PlayPowerOffSequence()
- func (a *AudioHandler) PlayPowerOnSequence()
- func (a *AudioHandler) PlayProjectileImpactAudio(g *Game, p *render.ProjectileSprite)
- func (a *AudioHandler) PlaySFX(sfxFile string, sourceVolume, panPercent float64)
- func (a *AudioHandler) ResumeMusic()
- func (a *AudioHandler) ResumeSFX()
- func (a *AudioHandler) SetMusicVolume(strength float64)
- func (a *AudioHandler) SetSFXChannels(numChannels int)
- func (a *AudioHandler) SetSFXVolume(strength float64)
- func (a *AudioHandler) SetStompSFX(sfxFile string)
- func (a *AudioHandler) StartEngineAmbience()
- func (a *AudioHandler) StartMenuMusic()
- func (a *AudioHandler) StartMusicFromFile(path string)
- func (a *AudioHandler) StopEngineAmbience()
- func (a *AudioHandler) StopEntityAudioLoop(g *Game, sfxFile string, entity model.Entity)
- func (a *AudioHandler) StopLoopEntitySFX(sfxFile string, entity model.Entity)
- func (a *AudioHandler) StopMusic()
- func (a *AudioHandler) StopSFX()
- type AudioInterfaceResource
- type AudioMainSource
- type BGMHandler
- type ClutterHandler
- type DelayedProjectileSpawn
- type EntityCollision
- type FloorTexture
- type Game
- func (g *Game) Draw(screen *ebiten.Image)
- func (g *Game) GetHUDElement(t HUDElementType) HUDElement
- func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int)
- func (g *Game) Move(mSpeed float64)
- func (g *Game) Pitch(pSpeed float64)
- func (g *Game) Rotate(rSpeed float64)
- func (g *Game) RotateTurret(rSpeed float64)
- func (g *Game) Run()
- func (g *Game) SetPlayerUnit(unit model.Unit)
- func (g *Game) Strafe(sSpeed float64)
- func (g *Game) Update() error
- func (g *Game) VerticalMove(vSpeed float64)
- type GameMenu
- type HUDElement
- type HUDElementType
- type InstantActionScene
- type IntroScene
- type LaunchMenu
- type LogFormat
- type MainMenu
- type Menu
- type MenuAspectRatio
- type MenuModel
- 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
- type MenuScene
- type MissionCard
- type MissionCardStyle
- type MissionMenu
- type MissionScene
- type MouseMode
- type Player
- type SFXHandler
- type SFXSource
- func (s *SFXSource) Close()
- func (s *SFXSource) IsPlaying() bool
- func (s *SFXSource) LoadLoopSFX(a *AudioHandler, sfxFile string) error
- func (s *SFXSource) LoadSFX(a *AudioHandler, sfxFile string) error
- func (s *SFXSource) Pause()
- func (s *SFXSource) Play()
- func (s *SFXSource) Resume()
- func (s *SFXSource) SetPan(panPercent float64)
- func (s *SFXSource) SetSourceVolume(sourceVolume float64)
- func (s *SFXSource) UpdateVolume()
- type Scene
- type SceneEffect
- type SceneTransition
- type SettingsMenu
- type SplashScreen
- type SpriteHandler
- type SpriteType
- type StrideDirection
- type TargetCycleType
- type TextureHandler
- type UnitCard
- type UnitCardStyle
- type UnitMenu
Constants ¶
const ( CONFIG_KEY_DEBUG = "debug" CONFIG_KEY_SHOWFPS = "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_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_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" )
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 ActionTargetCrosshairs ActionTargetNearest ActionTargetNext ActionTargetPrevious ActionZoomToggle ActionLightAmpToggle ActionPowerToggle )
const ( StrideStompLeft = -1 StrideStompRight = 1 StrideStompBoth = 0 )
const (
SPLASH_TIMEOUT = 5.0
)
Variables ¶
This section is empty.
Functions ¶
func NewUIResources ¶
func NewUIResources(fonts *fonts) (*uiResources, error)
Types ¶
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 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 DelayedProjectileSpawn ¶
type DelayedProjectileSpawn struct {
// contains filtered or unexported fields
}
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) 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) Layout ¶
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) RotateTurret ¶
Rotate player turret angle, relative to body heading, by rotation speed
func (*Game) SetPlayerUnit ¶
func (*Game) Update ¶
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) VerticalMove ¶
Move player by vertical speed in the up/down direction
type HUDElement ¶
type HUDElementType ¶
type HUDElementType int
const ( HUD_FPS HUDElementType = iota HUD_ALTIMETER HUD_ARMAMENT HUD_COMPASS HUD_CROSSHAIRS HUD_HEAT HUD_JETS HUD_NAV_RETICLE HUD_NAV_STATUS HUD_PLAYER_STATUS HUD_RADAR 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 Menu ¶
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 ¶
type MenuAspectRatio struct {
// contains filtered or unexported fields
}
type MenuModel ¶
type MenuModel struct {
// contains filtered or unexported fields
}
func (*MenuModel) CloseWindow ¶
func (*MenuModel) Resolutions ¶
func (m *MenuModel) Resolutions() []MenuResolution
type MenuResolution ¶
type MenuResolution struct {
// contains filtered or unexported fields
}
func (MenuResolution) String ¶
func (r MenuResolution) String() string
type MenuScene ¶
type MenuScene struct { Game *Game // contains filtered or unexported fields }
func NewMenuScene ¶
type MissionCard ¶
type MissionCardStyle ¶
type MissionCardStyle int
const ( MissionCardSelect MissionCardStyle = iota MissionCardLaunch )
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 MissionScene ¶
type MissionScene struct {
Game *Game
}
func NewMissionScene ¶
func NewMissionScene(g *Game) *MissionScene
func (*MissionScene) Draw ¶
func (s *MissionScene) Draw(screen *ebiten.Image)
func (*MissionScene) Update ¶
func (s *MissionScene) Update() error
type SFXHandler ¶
type SFXHandler struct {
// contains filtered or unexported fields
}
type SFXSource ¶
type SFXSource struct {
// contains filtered or unexported fields
}
func NewSoundEffectSource ¶
NewSoundEffectSource creates a new sound effect channel
func (*SFXSource) Close ¶
func (s *SFXSource) Close()
Close stops and closes the sound effect player
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) 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) SetSourceVolume ¶
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 SceneEffect ¶
type SceneEffect interface { Update() error Draw(*ebiten.Image) }
type SceneTransition ¶
type SceneTransition interface { Update() error Draw(*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 SplashScreen ¶
type SplashScreen struct { *ebiten.Image // contains filtered or unexported fields }
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 UnitCardStyle ¶
type UnitCardStyle int
const ( UnitCardSelect UnitCardStyle = iota UnitCardLaunch UnitCardMission )
Source Files ¶
- audio.go
- clutter.go
- collision.go
- combat.go
- config.go
- content.go
- effects.go
- game.go
- hud.go
- input.go
- logging.go
- menu.go
- menu_elements.go
- menu_game.go
- menu_launch.go
- menu_main.go
- menu_mission.go
- menu_resources.go
- menu_settings.go
- menu_settings_pages.go
- menu_unit.go
- player.go
- scene.go
- scene_instant_action.go
- scene_intro.go
- scene_menu.go
- scene_mission.go
- sprites.go
- texture.go