Documentation ¶
Index ¶
- func RandomRange(min int, max int) int
- type BaseEntity
- type CountdownTimer
- type Entity
- type EntityID
- type Event
- type EventBus
- type PivotType
- type Point
- type Rect
- type Sprite
- func NewBlankSprite(width int, height int) Sprite
- func NewBlankSpriteWithPivot(width int, height int, pivot Vector) Sprite
- func NewFilledSprite(width int, height int, c color.Color) Sprite
- func NewSpriteFromImage(image *ebiten.Image) Sprite
- func NewSpriteFromImageWithPivot(image *ebiten.Image, pivot Vector) Sprite
- func NewSpriteFromImageWithPivotType(image *ebiten.Image, pivotType PivotType) Sprite
- func NewSpriteFromSprite(s Sprite) Sprite
- func (s Sprite) Draw(source Sprite)
- func (s Sprite) DrawAtPoint(source Sprite, p Point)
- func (s Sprite) DrawAtPosition(source Sprite, x int, y int)
- func (s Sprite) DrawAtVector(source Sprite, v Vector)
- func (s Sprite) DrawInSection(source Sprite, rect Rect)
- func (s Sprite) Height() int
- func (s Sprite) Image() *ebiten.Image
- func (s Sprite) IsZero() bool
- func (s Sprite) Pivot() Vector
- func (s *Sprite) Scale(scale Vector)
- func (s *Sprite) SetPivot(p Vector)
- func (s Sprite) Size() (width int, height int)
- func (s Sprite) Width() int
- type Sprites
- type Subscriber
- type Vector
- func (v Vector) Add(other Vector) Vector
- func (v Vector) Distance(other Vector) float64
- func (v Vector) IsZero() bool
- func (v Vector) Length() float64
- func (v Vector) Mul(factor float64) Vector
- func (v Vector) Normalized() Vector
- func (v *Vector) Set(x float64, y float64)
- func (v Vector) Sub(other Vector) Vector
- func (v *Vector) Translate(dx float64, dy float64)
- func (v Vector) Unpack() (x float64, y float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RandomRange ¶
RandomRange returns a pseudo-random number in [min,max]
Types ¶
type BaseEntity ¶
type BaseEntity struct {
// contains filtered or unexported fields
}
func NewBaseEntity ¶
func NewBaseEntity() *BaseEntity
func (BaseEntity) Equals ¶
func (e BaseEntity) Equals(other Entity) bool
func (BaseEntity) ID ¶
func (e BaseEntity) ID() EntityID
func (*BaseEntity) String ¶
func (e *BaseEntity) String() string
type CountdownTimer ¶
type CountdownTimer struct {
// contains filtered or unexported fields
}
func NewCountdownTimer ¶
func NewCountdownTimer(duration time.Duration, action func()) *CountdownTimer
func (CountdownTimer) Done ¶
func (t CountdownTimer) Done() bool
func (CountdownTimer) PercentDone ¶
func (t CountdownTimer) PercentDone() float64
func (*CountdownTimer) Update ¶
func (t *CountdownTimer) Update(dt float64)
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
func NewEventBus ¶
func NewEventBus() *EventBus
func (*EventBus) Flush ¶
func (e *EventBus) Flush()
Flush should be called between game ticks to ensure systems don't conflict with each other.
func (*EventBus) Subscribe ¶
func (e *EventBus) Subscribe(event Event, subscriber Subscriber)
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
func NewBlankSprite ¶
func NewBlankSpriteWithPivot ¶
func NewSpriteFromImage ¶
func NewSpriteFromImage(image *ebiten.Image) Sprite
func NewSpriteFromSprite ¶
func (Sprite) DrawAtPoint ¶
DrawAtVector draws source sprite on the sprite at given point.
func (Sprite) DrawAtPosition ¶
DrawAtPosition draws source sprite on the sprite at given position.
func (Sprite) DrawAtVector ¶
DrawAtVector draws source sprite on the sprite at given vector.
func (Sprite) DrawInSection ¶
type Subscriber ¶
type Subscriber interface {
HandleEvent(event Event)
}
Click to show internal directories.
Click to hide internal directories.