Documentation ¶
Index ¶
- Constants
- Variables
- func AddGamepadDefinition(g GamepadDefinition)
- func DrawArc(screen *ebiten.Image, posX, posY float64, radius float64, start, end float64, ...)
- func DrawTextOutline(text *etxt.Renderer, screen *ebiten.Image, str string, x, y int, scale int)
- func GetAxis(gamemap string, id int, which int) float64
- func GetBestGamemap(id int) string
- func GetButton(gamemap string, id int, which int) bool
- func GetFunctionalGamepads() (c []int)
- func ReadClipboard() string
- func WriteClipboard(text string)
- type ActorSpawn
- type Bullet
- type BulletGroup
- type ButtonItem
- type Cell
- type ConditionDef
- type ConditionType
- type Darkness
- type Enemy
- type Fade
- type GPT
- func (g *GPT) CheckKey() bool
- func (g *GPT) Fetch(method, url string, requestBody *[]byte) ([]byte, error)
- func (g *GPT) GetKey() string
- func (g *GPT) GetLocale(baseLocale *Locale, locale string) (*Locale, error)
- func (gpt *GPT) GetResponse(inputLocale *Locale, locale string) (Locale, error)
- func (g *GPT) SetKey(key string)
- type GPTRequestBody
- type GPTResponse
- type GamepadDefinition
- type GamepadMap
- type Hover
- type InputItem
- func (t *InputItem) Activate() bool
- func (t *InputItem) CheckState(x, y float64) bool
- func (t *InputItem) Deactivate()
- func (t *InputItem) Draw(ctx states.DrawContext)
- func (t *InputItem) Hidden() bool
- func (t *InputItem) Hovered() bool
- func (t *InputItem) IsActive() bool
- func (t *InputItem) SetHidden(h bool)
- func (t *InputItem) Update()
- type Interactive
- type Layer
- type Locale
- type Map
- type MenuItem
- type MessageBody
- type RuneDef
- type Song
- type Sound
- type Sprite
- func (s *Sprite) AddImage(image *ebiten.Image)
- func (s *Sprite) Draw(ctx states.DrawContext)
- func (s *Sprite) DrawWithOptions(ctx states.DrawContext, opts *ebiten.DrawImageOptions)
- func (s *Sprite) Frame() int
- func (s *Sprite) Height() float64
- func (s *Sprite) Hit(x, y float64) bool
- func (s *Sprite) Image() *ebiten.Image
- func (s *Sprite) Images() []*ebiten.Image
- func (s *Sprite) Reset()
- func (s *Sprite) SetFrame(frame int)
- func (s *Sprite) SetImage(image *ebiten.Image)
- func (s *Sprite) SetXY(x, y float64)
- func (s *Sprite) Update()
- func (s *Sprite) Width() float64
- type SpriteItem
- type Sprites
- type Text
- type TextItem
- type VFX
- type VFXDef
- type VFXList
- type VFXListMode
Constants ¶
View Source
const ( KilledEnemies ConditionType = "killedEnemies" Active = "active" Inactive = "inactive" )
View Source
const ( AxisLeftX = iota AxisLeftY AxisRightX AxisRightY // ButtonBumperLeft ButtonBumperRight // ButtonTriggerLeft ButtonTriggerRight ButtonBack ButtonStart ButtonA ButtonB ButtonX ButtonY )
Variables ¶
View Source
var GamepadDefinitions = []GamepadDefinition{ { Name: "standard", Match: []string{}, Map: GamepadMap{ AxisLeftX: int(ebiten.StandardGamepadAxisLeftStickHorizontal), AxisLeftY: int(ebiten.StandardGamepadAxisLeftStickVertical), AxisRightX: int(ebiten.StandardGamepadAxisRightStickHorizontal), AxisRightY: int(ebiten.StandardGamepadAxisRightStickVertical), ButtonBumperLeft: int(ebiten.StandardGamepadButtonFrontBottomLeft), ButtonBumperRight: int(ebiten.StandardGamepadButtonFrontBottomRight), ButtonTriggerLeft: int(ebiten.StandardGamepadButtonFrontTopLeft), ButtonTriggerRight: int(ebiten.StandardGamepadButtonFrontTopRight), ButtonBack: int(ebiten.StandardGamepadButtonCenterLeft), ButtonStart: int(ebiten.StandardGamepadButtonCenterRight), ButtonA: int(ebiten.StandardGamepadButtonRightBottom), ButtonB: int(ebiten.StandardGamepadButtonRightRight), ButtonX: int(ebiten.StandardGamepadButtonRightTop), ButtonY: int(ebiten.StandardGamepadButtonRightLeft), }, }, }
View Source
var Volume float64 = 1.0
Functions ¶
func AddGamepadDefinition ¶
func AddGamepadDefinition(g GamepadDefinition)
func DrawArc ¶
func DrawArc(screen *ebiten.Image, posX, posY float64, radius float64, start, end float64, color color.Color)
DrawArc is an inefficient pixel-based arc drawererer
func DrawTextOutline ¶
func GetBestGamemap ¶
func GetFunctionalGamepads ¶
func GetFunctionalGamepads() (c []int)
func ReadClipboard ¶
func ReadClipboard() string
func WriteClipboard ¶
func WriteClipboard(text string)
Types ¶
type ActorSpawn ¶
type ActorSpawn struct { ID string `yaml:"id"` Spawn [3]int `yaml:"spawn,omitempty"` Type string `yaml:"type"` Sprite string `yaml:"sprite"` BulletGroups []*BulletGroup `yaml:"bullets,omitempty"` Interactive *Interactive `yaml:"interactive,omitempty"` }
type Bullet ¶
type Bullet struct { BulletType *string `yaml:"bulletType,omitempty"` Color *[]int `yaml:"color,omitempty"` Radius *int `yaml:"radius,omitempty"` Speed *float64 `yaml:"speed,omitempty"` Acceleration *float64 `yaml:"acceleration,omitempty"` AccelAccel *float64 `yaml:"accelAccel,omitempty"` MinSpeed *float64 `yaml:"minSpeed,omitempty"` MaxSpeed *float64 `yaml:"maxSpeed,omitempty"` AngularVelocity *float64 `yaml:"angularVelocity,omitempty"` AimTime *int `yaml:"aimTime,omitempty"` AimDelay *int `yaml:"aimDelay,omitempty"` Damage *int `yaml:"damage,omitempty"` }
Omits empty to allow for overriding from enemy definition
type BulletGroup ¶
type BulletGroup struct { Alias *string `yaml:"alias,omitempty"` Angle *string `yaml:"angle,omitempty"` FixedAngle *int `yaml:"fixedAngle,omitempty"` BulletCount *int `yaml:"bulletCount,omitempty"` LastSpawnedAt *int `yaml:"lastSpawnedAt,omitempty"` SpawnRate *int `yaml:"spawnRate,omitempty"` LoopCount *int `yaml:"loopCount,omitempty"` Bullet *Bullet `yaml:"bullet,omitempty"` }
func (*BulletGroup) UnmarshalYAML ¶
func (m *BulletGroup) UnmarshalYAML(unmarshal func(interface{}) error) error
type ButtonItem ¶
type ButtonItem struct {
X, Y float64
Text string
Callback func() bool
// contains filtered or unexported fields
}
func (*ButtonItem) Activate ¶
func (t *ButtonItem) Activate() bool
func (*ButtonItem) CheckState ¶
func (t *ButtonItem) CheckState(x, y float64) bool
func (*ButtonItem) Draw ¶
func (t *ButtonItem) Draw(ctx states.DrawContext)
func (*ButtonItem) Hidden ¶
func (t *ButtonItem) Hidden() bool
func (*ButtonItem) Hovered ¶
func (t *ButtonItem) Hovered() bool
func (*ButtonItem) SetHidden ¶
func (t *ButtonItem) SetHidden(h bool)
type ConditionDef ¶
type ConditionDef struct { Type ConditionType `yaml:"type"` Args []string `yaml:"args"` }
type ConditionType ¶
type ConditionType string
type Darkness ¶
type Darkness struct { Fade bool Duration time.Duration Fin bool // contains filtered or unexported fields }
func (*Darkness) Process ¶
func (d *Darkness) Process(ctx states.DrawContext, opts *ebiten.DrawImageOptions)
type Enemy ¶
type Enemy struct { Sprite string `yaml:"sprite"` Framerate int `yaml:"framerate"` Health int `yaml:"health"` Speed int `yaml:"speed"` Behavior string `yaml:"behavior"` Wander bool `yaml:"wander"` AlwaysShoot bool `yaml:"alwaysShoot"` Friendly bool `yaml:"friendly"` Bullets []*BulletGroup `yaml:"bullets"` NextPhase string `yaml:"nextPhase"` SpawnOnDeath []string `yaml:"spawnOnDeath"` }
func (*Enemy) UnmarshalYAML ¶
type Fade ¶
type Fade struct { Out bool Alpha float64 Duration time.Duration ApplyToImage bool // contains filtered or unexported fields }
func (*Fade) Process ¶
func (f *Fade) Process(ctx states.DrawContext, opts *ebiten.DrawImageOptions)
type GPT ¶
type GPT struct { Key string IsInitKey bool // If true, the key was from initialization SystemPrompt string // The prompt to use for the system MaxTokens int // 1-8192 Model string // "gpt-3.5-turbo-16k", "gpt-3.5-turbo" or "gpt-4" Style string // the style of the translation }
func InitGPT ¶
func InitGPT(fs multipath.FS) *GPT
Does some set up for GPT
- uses the gptKey variable that is set during release builds
- or finds the api key from "assets/key.txt"
- sets default values
func (*GPT) GetResponse ¶
type GPTRequestBody ¶
type GPTRequestBody struct { Model string `json:"model"` Messages []MessageBody `json:"messages"` }
type GPTResponse ¶
type GPTResponse struct { Choices []struct { Message struct { Content string `yaml:"content"` } `yaml:"message"` } `yaml:"choices"` }
type GamepadDefinition ¶
type GamepadDefinition struct { Name string `yaml:"Name"` Match []string `yaml:"Match"` Map GamepadMap `yaml:"Map"` }
type GamepadMap ¶
func GetGamemap ¶
func GetGamemap(name string) GamepadMap
func (*GamepadMap) UnmarshalYAML ¶
func (g *GamepadMap) UnmarshalYAML(unmarshal func(interface{}) error) error
type Hover ¶
func (*Hover) Process ¶
func (h *Hover) Process(ctx states.DrawContext, opts *ebiten.DrawImageOptions)
type InputItem ¶
type InputItem struct {
X, Y float64
Width float64
Placeholder string
Text string
Callback func() bool
// contains filtered or unexported fields
}
func (*InputItem) CheckState ¶
func (*InputItem) Deactivate ¶
func (t *InputItem) Deactivate()
func (*InputItem) Draw ¶
func (t *InputItem) Draw(ctx states.DrawContext)
type Interactive ¶
type Interactive struct { Map *string `yaml:"map,omitempty"` Conditions []*ConditionDef `yaml:"conditions,omitempty"` Linked []string `yaml:"linked,omitempty"` Collidable bool `yaml:"collidable,omitempty"` Reversable bool `yaml:"reversable"` Degrade bool `yaml:"degrade"` Active bool `yaml:"active"` Touchable bool `yaml:"touchable"` Health int `yaml:"health"` NPC bool `yaml:"npc"` Text string `yaml:"text"` RemoveVFX []string `yaml:"removeVFX,omitempty"` AddVFX []string `yaml:"addVFX,omitempty"` }
type Map ¶
type Map struct { Title string Music string `yaml:"music"` Conditions []*ConditionDef `yaml:"conditions"` RuneMap map[string]RuneDef `yaml:"runes"` Layers []Layer `yaml:"-"` Width int `yaml:"width"` Height int `yaml:"height"` SourceLayers []string `yaml:"layers"` Actors []ActorSpawn `yaml:"actors"` VFX []VFXDef `yaml:"vfx"` Hints []string `yaml:"hints"` End bool `yaml:"end"` }
func (*Map) UnmarshalYAML ¶
type MessageBody ¶
type Sprite ¶
type Sprite struct { Framerate int Loop bool Reverse bool X, Y float64 Scale float64 Flipped bool Interpolate bool Centered bool Hidden bool Options ebiten.DrawImageOptions VFX VFXList // contains filtered or unexported fields }
func NewAnimatedSprite ¶
func NewAnimatedSprite(images []*ebiten.Image) *Sprite
func (*Sprite) Draw ¶
func (s *Sprite) Draw(ctx states.DrawContext)
func (*Sprite) DrawWithOptions ¶
func (s *Sprite) DrawWithOptions(ctx states.DrawContext, opts *ebiten.DrawImageOptions)
type SpriteItem ¶
type SpriteItem struct {
X, Y float64
Sprite *Sprite
Callback func() bool
// contains filtered or unexported fields
}
func (*SpriteItem) Activate ¶
func (s *SpriteItem) Activate() bool
func (*SpriteItem) CheckState ¶
func (s *SpriteItem) CheckState(x, y float64) bool
func (*SpriteItem) Draw ¶
func (s *SpriteItem) Draw(ctx states.DrawContext)
func (*SpriteItem) Hidden ¶
func (s *SpriteItem) Hidden() bool
func (*SpriteItem) Hovered ¶
func (s *SpriteItem) Hovered() bool
func (*SpriteItem) SetHidden ¶
func (s *SpriteItem) SetHidden(h bool)
type Text ¶
type Text struct { Text string X, Y float64 Scale float64 Outline bool OutlineColor color.NRGBA Color color.NRGBA Delay time.Duration InDuration time.Duration HoldDuration time.Duration OutDuration time.Duration // contains filtered or unexported fields }
func (*Text) Process ¶
func (v *Text) Process(ctx states.DrawContext, opts *ebiten.DrawImageOptions)
type TextItem ¶
type TextItem struct {
X, Y float64
Text string
Underline bool
Callback func() bool
SelfRefCallback *func(*TextItem) bool
// contains filtered or unexported fields
}
func (*TextItem) CheckState ¶
func (*TextItem) Draw ¶
func (t *TextItem) Draw(ctx states.DrawContext)
type VFX ¶
type VFX interface { Process(ctx states.DrawContext, opts *ebiten.DrawImageOptions) Done() bool ID() string }
type VFXList ¶
type VFXList struct {
// contains filtered or unexported fields
}
func (*VFXList) Process ¶
func (v *VFXList) Process(ctx states.DrawContext, opts *ebiten.DrawImageOptions)
func (*VFXList) RemoveByID ¶
func (*VFXList) SetMode ¶
func (v *VFXList) SetMode(mode VFXListMode)
Click to show internal directories.
Click to hide internal directories.