fighters

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package fighters is a prototype of The Everlasting Fighters.

Index

Constants

View Source
const MaxSoundFrames = 120

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	RoomID   string
	Sprites  []*sprites.Sprite
	States   []CharacterState
	MaxHP    uint8
	MaxMeter int8
}

func (*Character) Render

func (c *Character) Render(ps *PlayerState, b *sprites.Batch, sx float32)

func (*Character) Update

func (c *Character) Update(s *State, ps *PlayerState, inputs rollback.InputFrame)

type CharacterState

type CharacterState struct {
	Sprite   int
	Sound    *audio.Sound
	Update   func(s *State, ps *PlayerState, inputs rollback.InputFrame)
	Hitboxes []HitboxDef
}

type Game

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

func New

func New(ctx context.Context) (*Game, error)

func (*Game) MakeScreenReaderUI added in v0.3.19

func (g *Game) MakeScreenReaderUI() *screenreader.UI

func (*Game) Render

func (g *Game) Render(ctx context.Context) error

func (*Game) Resize

func (g *Game) Resize(ctx context.Context) error

func (*Game) Update

func (g *Game) Update(ctx context.Context, frameAdvance bool) (*router.PageInfo, error)

type HitboxDef added in v0.3.17

type HitboxDef struct {
	X0, X1 float32
	Y0, Y1 float32
	Block  bool
	Push   bool
	Hurt   uint8
}

type PlayerState

type PlayerState struct {
	Char      *Character
	Pos       [2]float32
	Vel       [2]float32
	HP        uint8
	Meter     int8
	HPDelay   uint8
	HPChanged uint8
	Combo     uint8
	Flip      bool
	State     int
	Count     int
	Sound     [MaxSoundFrames]SoundRecord
}

func (*PlayerState) SetState

func (ps *PlayerState) SetState(i int)

type SoundRecord added in v0.3.17

type SoundRecord struct {
	Sound *audio.Sound
	Pos   [3]float32
}

type State

type State struct {
	FrameNum uint64
	Player   [2]PlayerState
}

func (*State) Clone added in v0.3.12

func (s *State) Clone() rollback.State

func (*State) Frame

func (s *State) Frame() uint64

func (*State) OnFrame added in v0.3.12

func (s *State) OnFrame()

func (*State) OnRollback added in v0.3.12

func (s *State) OnRollback()

func (*State) Render

func (s *State) Render(b *sprites.Batch, sx float32)

func (*State) Update

func (s *State) Update(p1, p2 rollback.InputFrame)

Jump to

Keyboard shortcuts

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