game

package
v0.0.0-...-390c9aa Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloud

type Cloud struct {
	Active bool
	// contains filtered or unexported fields
}

func NewCloud

func NewCloud(sh, sw int32, t *sdl.Texture) *Cloud

func (*Cloud) Destroy

func (c *Cloud) Destroy() error

func (*Cloud) Draw

func (c *Cloud) Draw(r *sdl.Renderer)

func (*Cloud) OffScreen

func (c *Cloud) OffScreen() bool

func (*Cloud) Reset

func (c *Cloud) Reset(sh, sw int32)

func (*Cloud) Update

func (c *Cloud) Update(slow bool)

type CloudPool

type CloudPool []*Cloud

func (CloudPool) Destroy

func (cc CloudPool) Destroy() error

func (CloudPool) Next

func (cp CloudPool) Next() (*Cloud, bool)

type Game

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

Game represents a game

func New

func New() Game

New creates a new instance of Game

func (*Game) Init

func (g *Game) Init() error

Init initializes the game

type Grass

type Grass struct {
	Active bool
	// contains filtered or unexported fields
}

func NewGrass

func NewGrass(sh, sw int32, t *sdl.Texture) *Grass

func (*Grass) Destroy

func (g *Grass) Destroy() error

func (*Grass) Draw

func (g *Grass) Draw(r *sdl.Renderer)

func (*Grass) OffScreen

func (g *Grass) OffScreen() bool

func (*Grass) Reset

func (g *Grass) Reset(sh, sw int32)

func (*Grass) Update

func (g *Grass) Update(velocity int32)

type GrassPool

type GrassPool []*Grass

func (GrassPool) Destroy

func (gg GrassPool) Destroy() error

func (GrassPool) Next

func (gp GrassPool) Next() (*Grass, bool)

type Player

type Player struct {
	X, Y, W, H int32
	// contains filtered or unexported fields
}

func NewPlayer

func NewPlayer(sw, sh int32, t *sdl.Texture) *Player

func (*Player) Destroy

func (p *Player) Destroy() error

func (*Player) Draw

func (p *Player) Draw(r *sdl.Renderer)

func (*Player) Update

func (p *Player) Update(sw, sh int32)

type Score

type Score struct {
	Value int
	// contains filtered or unexported fields
}

func NewScore

func NewScore(f *ttf.Font, c sdl.Color) *Score

func (*Score) Destroy

func (s *Score) Destroy() error

func (*Score) Draw

func (s *Score) Draw(r *sdl.Renderer)

func (*Score) Update

func (s *Score) Update(p *Player, t *Trunk)

type Trunk

type Trunk struct {
	Active bool
	Scored bool
	// contains filtered or unexported fields
}

func NewTrunk

func NewTrunk(sh, sw int32, tex *sdl.Texture) *Trunk

func (*Trunk) ColidesWith

func (t *Trunk) ColidesWith(p *Player) bool

func (*Trunk) Destroy

func (t *Trunk) Destroy() error

func (*Trunk) Draw

func (t *Trunk) Draw(r *sdl.Renderer)

func (*Trunk) OffScreen

func (t *Trunk) OffScreen() bool

func (*Trunk) Reset

func (t *Trunk) Reset(sh, sw int32)

func (*Trunk) Update

func (t *Trunk) Update(sw, sh, velocity int32)

type TrunkPool

type TrunkPool []*Trunk

func (TrunkPool) Destroy

func (tt TrunkPool) Destroy() error

func (TrunkPool) Next

func (tt TrunkPool) Next() (*Trunk, bool)

func (TrunkPool) NextToPlayer

func (tt TrunkPool) NextToPlayer(p *Player) (*Trunk, bool)

Jump to

Keyboard shortcuts

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