Documentation
¶
Index ¶
- Constants
- Variables
- type Assets
- type ButtonClicked
- type Character
- type CharacterPosition
- type CharacterSpeedChanged
- type ColliderLayer
- type Condition
- type ConditionType
- type Direction
- type Entrypoint
- type InventoryItem
- type InventoryUpdated
- type Item
- type ItemLost
- type ItemReceived
- type JustCollided
- type JustOutOfCollision
- type LayerID
- type Level
- type LevelCharacter
- type Link
- type Macro
- type MacroType
- type MoneyReceived
- type MoneySpent
- type MusicChanged
- type Object
- type POI
- type Paragraph
- type ParagraphAlign
- type ParagraphEffect
- type ParagraphType
- type Passage
- type RawLink
- type RawPassage
- type RawStory
- type Sounds
- type Story
- func (s *Story) AddItem(item string)
- func (s *Story) AddMoney(amount int)
- func (s *Story) Fact(fact string) bool
- func (s *Story) PassageByTitle(title string) *Passage
- func (s *Story) PassageForLevel(level TargetLevel) (*Passage, bool)
- func (s *Story) SetFact(fact string)
- func (s *Story) SetFactTo(fact string, value bool)
- func (s *Story) TakeItem(item string)
- func (s *Story) TestCondition(c Condition) bool
- type StoryFactSet
- type TargetLevel
Constants ¶
View Source
const ( SpriteUILayerUI = 200 + iota*10 SpriteUILayerBackground SpriteUILayerText SpriteUILayerButtons SpriteUILayerTop )
View Source
const (
CreditsPassage = "credits"
)
Variables ¶
View Source
var ButtonClickedEvent = events.NewEventType[ButtonClicked]()
View Source
var CharacterSpeedChangedEvent = events.NewEventType[CharacterSpeedChanged]()
View Source
var InventoryUpdatedEvent = events.NewEventType[InventoryUpdated]()
View Source
var ItemLostEvent = events.NewEventType[ItemLost]()
View Source
var ItemReceivedEvent = events.NewEventType[ItemReceived]()
View Source
var JustCollidedEvent = events.NewEventType[JustCollided]()
View Source
var JustOutOfCollisionEvent = events.NewEventType[JustOutOfCollision]()
View Source
var MoneyReceivedEvent = events.NewEventType[MoneyReceived]()
View Source
var MoneySpentEvent = events.NewEventType[MoneySpent]()
View Source
var MusicChangedEvent = events.NewEventType[MusicChanged]()
View Source
var StoryFactSetEvent = events.NewEventType[StoryFactSet]()
Functions ¶
This section is empty.
Types ¶
type ButtonClicked ¶
type ButtonClicked struct{}
type CharacterPosition ¶
type CharacterSpeedChanged ¶
type CharacterSpeedChanged struct {
SpeedChange float64
}
type ColliderLayer ¶
type ColliderLayer int
const ( CollisionLayerNone ColliderLayer = iota CollisionLayerButton ColliderLayer = iota CollisionLayerCharacter ColliderLayer = iota CollisionLayerPOI ColliderLayer = iota )
type Condition ¶
type Condition struct {
Positive bool
Type ConditionType
Value string
}
type ConditionType ¶
type ConditionType string
const ( ConditionTypeHasItem ConditionType = "hasItem" ConditionTypeFact ConditionType = "fact" ConditionTypeHasMoney ConditionType = "hasMoney" )
type Entrypoint ¶
type Entrypoint struct {
Index int
CharacterPosition CharacterPosition
}
type InventoryItem ¶
type InventoryUpdated ¶
type InventoryUpdated struct {
Money int
Items []InventoryItem
}
type ItemLost ¶
type ItemLost struct {
Item InventoryItem
}
type ItemReceived ¶
type ItemReceived struct {
Item InventoryItem
}
type JustCollided ¶
type JustCollided struct {
Entry *donburi.Entry
Layer ColliderLayer
Other *donburi.Entry
OtherLayer ColliderLayer
}
type JustOutOfCollision ¶
type JustOutOfCollision struct {
Entry *donburi.Entry
Layer ColliderLayer
Other *donburi.Entry
OtherLayer ColliderLayer
}
type Level ¶
type Level struct {
Name string
Background func() *ebiten.Image
POIs []POI
Objects []Object
Entrypoints []Entrypoint
CameraZoom float64
Character LevelCharacter
Limits *engine.FloatRange
Fadepoint *math.Vec2
Outdoor bool
}
type LevelCharacter ¶
type Link ¶
type Link struct {
Text string
Target *Passage
Level *TargetLevel
Conditions []Condition
Visited bool
Tags []string
// contains filtered or unexported fields
}
func (*Link) AllVisited ¶
type MacroType ¶
type MacroType string
const ( MacroTypeAddItem MacroType = "addItem" MacroTypeTakeItem MacroType = "takeItem" MacroTypeSetFact MacroType = "setFact" MacroTypeAddMoney MacroType = "addMoney" MacroTypeTakeMoney MacroType = "takeMoney" MacroTypePlayMusic MacroType = "playMusic" MacroTypeChangeCharacterSpeed MacroType = "changeCharacterSpeed" )
type MoneyReceived ¶
type MoneyReceived struct {
Amount int
}
type MoneySpent ¶
type MoneySpent struct {
Amount int
}
type MusicChanged ¶
type MusicChanged struct {
Track string
}
type Paragraph ¶
type Paragraph struct {
Text string
Align ParagraphAlign
Type ParagraphType
Conditions []Condition
Delay time.Duration
Effect ParagraphEffect
EffectDuration time.Duration
}
type ParagraphAlign ¶
type ParagraphAlign int
const ( ParagraphAlignLeft ParagraphAlign = iota ParagraphAlignCenter )
type ParagraphEffect ¶
type ParagraphEffect int
const ( ParagraphEffectDefault ParagraphEffect = iota ParagraphEffectTyping ParagraphEffectFadeIn ParagraphEffectNone )
type ParagraphType ¶
type ParagraphType int
const ( ParagraphTypeStandard ParagraphType = iota ParagraphTypeHeader ParagraphTypeHint ParagraphTypeFear ParagraphTypeReceived ParagraphTypeLost ParagraphTypeRead )
type Passage ¶
type Passage struct {
Title string
Paragraphs []Paragraph
Conditions []Condition
Macros []Macro
AllLinks []*Link
IsOneTime bool
Visited bool
// contains filtered or unexported fields
}
func (*Passage) AvailableParagraphs ¶
func (*Passage) ConditionsMet ¶
type RawLink ¶
type RawLink struct {
Text string
Target string
Level *TargetLevel
Conditions []Condition
Tags []string
}
type RawPassage ¶
type RawStory ¶
type RawStory struct {
Title string
Passages []RawPassage
StartLevel TargetLevel
}
type Story ¶
type Story struct {
Title string
Passages map[string]*Passage
StartLevel TargetLevel
Money int
Items []Item
Facts map[string]bool
// contains filtered or unexported fields
}
func (*Story) PassageByTitle ¶
func (*Story) PassageForLevel ¶
func (s *Story) PassageForLevel(level TargetLevel) (*Passage, bool)
func (*Story) TestCondition ¶
type StoryFactSet ¶
type StoryFactSet struct {
Fact string
}
type TargetLevel ¶
type TargetLevel struct {
Name string
Entrypoint *int
CharacterPosition *CharacterPosition
}
Click to show internal directories.
Click to hide internal directories.