player

package
v1.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-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 Player

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

Player is the player of the game.

func New

func New(name string, side geometry.Side, screenWidth, screenHeight, fieldBorderWidth float64) *Player

New creates a new player.

func (*Player) BouncerHeight

func (p *Player) BouncerHeight() float64

BouncerHeight returns the height of the player bouncer.

func (*Player) BouncerWidth

func (p *Player) BouncerWidth() float64

BouncerWidth returns the width of the player bouncer.

func (*Player) Bounds

func (p *Player) Bounds() geometry.Rect

Bounds returns the bounds of the player.

func (*Player) Name

func (p *Player) Name() string

Name returns the name of the player.

func (*Player) Position

func (p *Player) Position() geometry.Vector

Position returns the position of the player.

func (*Player) SetPosition

func (p *Player) SetPosition(y float64)

SetPosition sets the Y position of the player.

func (*Player) Update

func (p *Player) Update(up, down ebiten.Key)

Update updates the player position based on the keys pressed.

Jump to

Keyboard shortcuts

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