ball

package
v1.0.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ball

type Ball interface {
	Angle() float64
	Bounces() int
	Bounds() geometry.Rect
	CheckGoal() (bool, geometry.Side)
	Position() geometry.Vector
	Reset(nextSide geometry.Side) Ball
	SetAngle(angle float64)
	SetBounces(bounces int)
	SetPosition(pos geometry.Vector)
	Update(p1Bounds, p2Bounds geometry.Rect)
	Width() float64
}

Ball represents a ball.

type Local

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

Local represents the ball in a local game.

func NewLocal

func NewLocal(nextSide geometry.Side, screenWidth, screenHeight float64, lvl level.Level) *Local

NewLocal creates a new ball to play locally. nextSide is the side that the ball will go when the game starts. screenWidth and screenHeight are the dimensions of the screen. lvl is the level of the game.

func (*Local) Angle

func (b *Local) Angle() float64

Angle returns the angle of the ball.

func (*Local) Bounces

func (b *Local) Bounces() int

Bounces returns the number of bounces of the ball.

func (*Local) Bounds

func (b *Local) Bounds() geometry.Rect

Bounds returns the bounds of the ball.

func (*Local) CheckGoal

func (b *Local) CheckGoal() (bool, geometry.Side)

CheckGoal checks if the ball has scored a goal.

func (*Local) Position

func (b *Local) Position() geometry.Vector

Position returns the position of the ball.

func (*Local) Reset

func (b *Local) Reset(nextSide geometry.Side) Ball

Reset resets the position of the ball.

func (*Local) SetAngle

func (*Local) SetAngle(_ float64)

SetAngle will panic because it is not implemented.

func (*Local) SetBounces

func (*Local) SetBounces(_ int)

SetBounces will panic because it is not implemented.

func (*Local) SetPosition

func (b *Local) SetPosition(pos geometry.Vector)

SetPosition sets the position of the ball.

func (*Local) Update

func (b *Local) Update(p1Bounds, p2Bounds geometry.Rect)

Update updates the position of the ball.

func (*Local) Width

func (b *Local) Width() float64

Width returns the width of the ball.

type Network

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

Network represents the ball in a network game.

func NewNetwork

func NewNetwork() *Network

NewNetwork creates a new ball to play in a network game.

func (*Network) Angle

func (*Network) Angle() float64

Angle will panic because it is not implemented.

func (*Network) Bounces

func (*Network) Bounces() int

Bounces will panic because it is not implemented.

func (*Network) Bounds

func (b *Network) Bounds() geometry.Rect

Bounds returns the bounds of the ball.

func (*Network) CheckGoal

func (*Network) CheckGoal() (bool, geometry.Side)

CheckGoal will panic because it is not implemented.

func (*Network) Position

func (b *Network) Position() geometry.Vector

Position returns the position of the ball.

func (*Network) Reset

func (*Network) Reset(_ geometry.Side) Ball

Reset will panic because it is not implemented.

func (*Network) SetAngle

func (b *Network) SetAngle(angle float64)

SetAngle sets the angle of the ball.

func (*Network) SetBounces

func (b *Network) SetBounces(bounces int)

SetBounces sets the number of bounces of the ball.

func (*Network) SetPosition

func (b *Network) SetPosition(pos geometry.Vector)

SetPosition sets the position of the ball.

func (*Network) Update

func (*Network) Update(_, _ geometry.Rect)

Update will panic because it is not implemented.

func (*Network) Width

func (b *Network) Width() float64

Width returns the width of the ball.

Jump to

Keyboard shortcuts

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