object

package
v0.0.0-...-26d206b Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: GPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Animation types.
	AvatarIdle      AvatarAnimType = AvatarAnimType("idle")
	AvatarMove                     = AvatarAnimType("move")
	AvatarSpellCast                = AvatarAnimType("spell")
	AvatarCraftCast                = AvatarAnimType("craft")
	AvatarMelee                    = AvatarAnimType("melee")
	AvatarShoot                    = AvatarAnimType("shoot")
	AvatarKneel                    = AvatarAnimType("kneel")
	AvatarLie                      = AvatarAnimType("lie")
)

Variables

This section is empty.

Functions

func DefaultEffectGraphic

func DefaultEffectGraphic(eff *effect.Effect) *res.EffectGraphicData

DefaultEffectGraphic returns default graphic for specified effect.

func DefaultItemGraphic

func DefaultItemGraphic(it item.Item) *res.ItemGraphicData

DefaultItemGraphic returns default graphic for specified item.

func DefaultSkillGraphic

func DefaultSkillGraphic(skill *skill.Skill) *res.SkillGraphicData

DefaultSkillGraphic returns default graphic for specified skill.

Types

type Area

type Area struct {
	*area.Area
	// contains filtered or unexported fields
}

Graphical wrapper for area.

func NewArea

func NewArea(game *game.Game, area *area.Area, areaMap *stone.Map) *Area

NewArea returns new graphical wrapper for specified area.

func (*Area) Avatars

func (a *Area) Avatars() (avatars []*Avatar)

Avatars returns all avatars from current area.

func (*Area) Draw

func (a *Area) Draw(win *mtk.Window, matrix pixel.Matrix, size pixel.Vec)

Draw draws area.

func (*Area) Map

func (a *Area) Map() *stone.Map

Map returns area map.

func (*Area) PassablePosition

func (a *Area) PassablePosition(pos pixel.Vec) bool

PassablePosition checks if specified position is 'passable', i.e. map there is visible layer on this position where player is allowed to move(like 'ground' layer').

func (*Area) Update

func (a *Area) Update(win *mtk.Window)

Update updates area.

type Avatar

type Avatar struct {
	*game.Character
	// contains filtered or unexported fields
}

Avatar struct for graphical representation of game objects with multiple directional animations(idle, move, cast, meele, etc.).

func NewAvatar

func NewAvatar(char *game.Character, data *res.AvatarData) (*Avatar, error)

NewAvatar creates new avatar for specified game character from specified avatar resources. Returns error if spritesheets from data object(torso/head or full body) were not found in res/graphic avatar spritesheet map.

func (*Avatar) Data

func (av *Avatar) Data() res.AvatarData

Data returns avatar graphical data.

func (*Avatar) DestPoint

func (av *Avatar) DestPoint() pixel.Vec

DestPoint returns current destination point of avatar.

func (*Avatar) Draw

func (av *Avatar) Draw(win *mtk.Window, matrix pixel.Matrix)

Draw draws avatar.

func (*Avatar) DrawArea

func (av *Avatar) DrawArea() pixel.Rect

DrawArea returns current draw area.

func (*Avatar) Effects

func (av *Avatar) Effects() (effects []*EffectGraphic)

Effects returns all visible effects active on avatar character.

func (*Avatar) Hovered

func (av *Avatar) Hovered() bool

Hovered check if avatar is hovered by HUD user mouse cursor.

func (*Avatar) Moving

func (av *Avatar) Moving() bool

Moving checks if avatar is in move.

func (*Avatar) Portrait

func (av *Avatar) Portrait() pixel.Picture

Portrait returns avatar portrait picture.

func (*Avatar) Position

func (av *Avatar) Position() pixel.Vec

Position returns current position of avatar.

func (*Avatar) SetPosition

func (av *Avatar) SetPosition(p pixel.Vec)

SetPosition sets current position of avatar.

func (*Avatar) Silence

func (av *Avatar) Silence(silence bool)

Silence toggles avatar audio effects.

func (*Avatar) Silenced

func (av *Avatar) Silenced() bool

Silenced checks if audio effects are silenced.

func (*Avatar) Skills

func (av *Avatar) Skills() (skills []*SkillGraphic)

Skills retruns all avatar skills(in form of graphical wrappers).

func (*Avatar) Update

func (av *Avatar) Update(win *mtk.Window)

Update updates avatar.

type AvatarAnimType

type AvatarAnimType string

Type for avatar animations types.

type Drawer

type Drawer interface {
	Position() pixel.Vec
	DrawArea() pixel.Rect
}

Interface for all objects with drawable objects.

type EffectGraphic

type EffectGraphic struct {
	*effect.Effect
	// contains filtered or unexported fields
}

Graphical wrapper for effects.

func NewEffectGraphic

func NewEffectGraphic(effect *effect.Effect, data *res.EffectGraphicData) *EffectGraphic

NewEffectGraphic creates new graphical wrapper for specified effect.

func (*EffectGraphic) DrawIcon

func (eg *EffectGraphic) DrawIcon(t pixel.Target, matrix pixel.Matrix)

DrawIcon draws effect icon and text label with remaining time(in seconds).

func (*EffectGraphic) Icon

func (eg *EffectGraphic) Icon() *pixel.Sprite

Icon returns effect icon.

type Greeting

type Greeting struct {
	*beep.Buffer
	Name string
}

Struct for greeting audio effects.

type ItemGraphic

type ItemGraphic struct {
	item.Item
	// contains filtered or unexported fields
}

Struct for graphical wrapper for items.

func NewItemGraphic

func NewItemGraphic(item item.Item, data *res.ItemGraphicData) *ItemGraphic

NewItemGraphic creates new graphical wrapper for specified item.

func (*ItemGraphic) Icon

func (itg *ItemGraphic) Icon() pixel.Picture

Icon returns item icon.

func (*ItemGraphic) MaxStack

func (itg *ItemGraphic) MaxStack() int

MaxStack returns maximal number of stacked items with same ID.

func (*ItemGraphic) Spritesheets

func (itg *ItemGraphic) Spritesheets() []*res.SpritesheetData

Spritesheets returns all spritesheets data.

type SkillGraphic

type SkillGraphic struct {
	*skill.Skill
	// contains filtered or unexported fields
}

Graphical wrapper for skills.

func NewSkillGraphic

func NewSkillGraphic(skill *skill.Skill, data *res.SkillGraphicData) *SkillGraphic

NewSkillGraphic creates new graphical wrapper for specified skill.

func (*SkillGraphic) ActivationAnim

func (sg *SkillGraphic) ActivationAnim() AvatarAnimType

ActivationAnim returns skill activation animation.

func (*SkillGraphic) ActivationAudio

func (sg *SkillGraphic) ActivationAudio() *beep.Buffer

AudioEffect returns skill audio effect.

func (*SkillGraphic) Icon

func (sg *SkillGraphic) Icon() pixel.Picture

Icon returns skill icon sprite.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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