Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionState ¶
type ActionState uint8
const ( IDLE ActionState = iota ATTACKING ActionState = iota // Inactionable BLOCKSTUN ActionState = iota HITSTUN ActionState = iota KNOCKDOWN ActionState = iota )
type Boundaries ¶
Boundaries is a collection of different types of hitboxes of an entity.
func (Boundaries) Flip ¶
func (b Boundaries) Flip(over sdl.Point) Boundaries
Horizontally flip all hitboxes of an entity over a point.
func (Boundaries) TranslateTo ¶
func (b Boundaries) TranslateTo(moveTo sdl.Point) Boundaries
Move all hitboxes of an entity in the direction of a vector moveTo.
type Character ¶
type Character struct { KeyboardControls controls.KeyboardLayout Origin sdl.Point State ActionState CurrentMove *Move CurrentMoveFrame uint16 }
func (*Character) GetBoundaries ¶
func (c *Character) GetBoundaries() Boundaries
func (*Character) ProcessActions ¶
func (c *Character) ProcessActions(actions []controls.PlayerAction)
Process player input and translate it into character activity.
type Hitbox ¶
Hitbox is an interactable area primarily used to calculate collisions with other entities.
type Move ¶
type Move struct {
// contains filtered or unexported fields
}
func (Move) BoundariesFromFrame ¶
func (m Move) BoundariesFromFrame(frame uint16) Boundaries
Given a frame number, calculate Character's Boundaries from the hitbox progression of the move.
func (Move) TotalFrameCount ¶
Calculate the total frame count of a move, during which a character regularly would not be able to act until it ends.
Click to show internal directories.
Click to hide internal directories.