internal

package
v0.0.0-...-9fc0885 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvatarBodyPart

type AvatarBodyPart struct {
	// contains filtered or unexported fields
}

Struct for avatar sprite body part (e.g. body, head, weapon). TODO: animations for kneel and lie.

func (*AvatarBodyPart) Down

func (abp *AvatarBodyPart) Down()

Down turns current animataion down.

func (*AvatarBodyPart) Draw

func (abp *AvatarBodyPart) Draw(t pixel.Target, matrix pixel.Matrix)

Draw draws current body animation.

func (*AvatarBodyPart) DrawArea

func (abp *AvatarBodyPart) DrawArea() pixel.Rect

DrawArea returns current draw area.

func (*AvatarBodyPart) Idle

func (abp *AvatarBodyPart) Idle()

Idle sets idle animation as current draw animation.

func (*AvatarBodyPart) Kneel

func (abp *AvatarBodyPart) Kneel()

Kneel sets kneel animtaion as current draw animation.

func (*AvatarBodyPart) Left

func (abp *AvatarBodyPart) Left()

Left turns current animataion left.

func (*AvatarBodyPart) Lie

func (abp *AvatarBodyPart) Lie()

Lie sets lie animation as current draw animation.

func (*AvatarBodyPart) Melee

func (abp *AvatarBodyPart) Melee()

Melee sets melee animation as current draw animation.

func (*AvatarBodyPart) MeleeOnce

func (abp *AvatarBodyPart) MeleeOnce()

MeleeOnce restarts and sets melee animation as secondary animation to show only once.

func (*AvatarBodyPart) Move

func (abp *AvatarBodyPart) Move()

Move sets move animation as current draw animation.

func (*AvatarBodyPart) Right

func (abp *AvatarBodyPart) Right()

Right turns current animataion right.

func (*AvatarBodyPart) Shoot

func (abp *AvatarBodyPart) Shoot()

Shoot sets shoot animation as current draw animation.

func (*AvatarBodyPart) ShootOnce

func (abp *AvatarBodyPart) ShootOnce()

ShootOnce restarts and sets shoot animation as secondary animation to show only once.

func (*AvatarBodyPart) SpellCast

func (abp *AvatarBodyPart) SpellCast()

SpellCast sets spell cast animation as current draw animation.

func (*AvatarBodyPart) Up

func (abp *AvatarBodyPart) Up()

Up turns current animataion up.

func (*AvatarBodyPart) Update

func (abp *AvatarBodyPart) Update(win *mtk.Window)

Update updates current body animation.

type AvatarSprite

type AvatarSprite struct {
	// contains filtered or unexported fields
}

Struct for avatar sprite animations.

func NewAvatarSprite

func NewAvatarSprite(bodySpritesheet, headSpritesheet pixel.Picture) *AvatarSprite

NewAvatarSprite creates new sprite for specified body and head spritesheets.

func NewFullBodyAvatarSprite

func NewFullBodyAvatarSprite(spritesheet pixel.Picture) *AvatarSprite

NewFullBodyAvatarSprite creates new sprite with only one full body animated part.

func (*AvatarSprite) Clear

func (as *AvatarSprite) Clear()

Clear sets base body parts as current body parts.

func (*AvatarSprite) CraftCast

func (as *AvatarSprite) CraftCast()

CraftCast sets craft cast animations as current draw animations.

func (*AvatarSprite) Down

func (as *AvatarSprite) Down()

Down turns all current animataions down.

func (*AvatarSprite) Draw

func (as *AvatarSprite) Draw(t pixel.Target, matrix pixel.Matrix)

Draw draws current sprite elements.

func (*AvatarSprite) DrawArea

func (as *AvatarSprite) DrawArea() pixel.Rect

DrawArea returns current draw area.

func (*AvatarSprite) Idle

func (as *AvatarSprite) Idle()

Idle sets idle animations as current draw animations.

func (*AvatarSprite) Kneel

func (as *AvatarSprite) Kneel()

Kneel sets kneel animations as current draw animtaions.

func (*AvatarSprite) Left

func (as *AvatarSprite) Left()

Left turns all current animataions left.

func (*AvatarSprite) Lie

func (as *AvatarSprite) Lie()

Lie sets lie animations as current draw animtaions.

func (*AvatarSprite) Melee

func (as *AvatarSprite) Melee()

Melee sets melee animations as current draw animations.

func (*AvatarSprite) MeleeOnce

func (as *AvatarSprite) MeleeOnce()

MeleeOnce starts one melee animation for all sprite parts.

func (*AvatarSprite) Move

func (as *AvatarSprite) Move()

Move sets move animations as current draw animations.

func (*AvatarSprite) Right

func (as *AvatarSprite) Right()

Right turns all current animataions right.

func (*AvatarSprite) SetFullBody

func (as *AvatarSprite) SetFullBody(spritesheet pixel.Picture)

SetFullBody creates new full body animations from specified avatar spritesheet.

func (*AvatarSprite) SetHead

func (as *AvatarSprite) SetHead(spritesheet pixel.Picture)

SetHead creates head animations from specified avatar spritesheet.

func (*AvatarSprite) SetTorso

func (as *AvatarSprite) SetTorso(spritesheet pixel.Picture)

SetTorso creates body animations from specified avatar spritesheet.

func (*AvatarSprite) SetWeapon

func (as *AvatarSprite) SetWeapon(spritesheet pixel.Picture)

SetWeapon creates new weapon animations from specified avatar spritesheet.

func (*AvatarSprite) Shoot

func (as *AvatarSprite) Shoot()

Shoot sets shoot animations as current draw animations.

func (*AvatarSprite) ShootOnce

func (as *AvatarSprite) ShootOnce()

ShootOnce starts one shoot animation for all sprite parts.

func (*AvatarSprite) SpellCast

func (as *AvatarSprite) SpellCast()

SpellCast sets spell cast animations as current draw animations.

func (*AvatarSprite) Up

func (as *AvatarSprite) Up()

Up turns all current animataions up.

func (*AvatarSprite) Update

func (as *AvatarSprite) Update(win *mtk.Window)

Update updates current sprite elements.

Jump to

Keyboard shortcuts

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