engine

package module
v0.0.0-...-312315a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ball

type Ball struct {
	X float64
	Y float64
	// contains filtered or unexported fields
}

func (*Ball) Bounds

func (b *Ball) Bounds() *Bounds

func (*Ball) Debug

func (b *Ball) Debug()

func (*Ball) Draw

func (b *Ball) Draw(screen *ebiten.Image)

func (*Ball) Hit

func (b *Ball) Hit(p Player)

func (*Ball) Initialize

func (b *Ball) Initialize()

func (*Ball) Reset

func (b *Ball) Reset()

func (*Ball) Update

func (b *Ball) Update()

type Bounds

type Bounds struct {
	Min [2]float64
	Max [2]float64
}

func (*Bounds) Overlaps

func (ball *Bounds) Overlaps(player *Bounds) bool

type Entity

type Entity interface {
	Draw(screen *ebiten.Image)
	Update()
	Debug()
	Bounds() *Bounds
}

type Player

type Player struct {
	X float64
	Y float64
	// contains filtered or unexported fields
}

func (*Player) Bounds

func (p *Player) Bounds() *Bounds

func (*Player) ChangeDirection

func (p *Player) ChangeDirection(direction consts.MovingDirection)

func (*Player) Debug

func (p *Player) Debug()

func (*Player) Draw

func (p *Player) Draw(screen *ebiten.Image)

func (*Player) Initialize

func (p *Player) Initialize(playerNumber int)

func (*Player) Update

func (p *Player) Update()

type State

type State struct {
	Player1 *Player
	Player2 *Player
	Ball    *Ball

	Entities []Entity
	// contains filtered or unexported fields
}

func (*State) AddScore

func (s *State) AddScore(playerNumber int)

func (*State) CheckGoal

func (s *State) CheckGoal()

func (*State) CheckHit

func (s *State) CheckHit()

func (*State) Draw

func (s *State) Draw(screen *ebiten.Image)

func (*State) InitializeState

func (s *State) InitializeState()

func (*State) PrintState

func (s *State) PrintState()

func (*State) Update

func (s *State) Update()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳