game

package
v0.0.0-...-f53ceb8 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitImages

func InitImages()

InitImages initialize game images

func InitSounds

func InitSounds()

InitSounds initialize sounds

func UpdateSound

func UpdateSound()

UpdateSound to loop if needed

Types

type Game

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

Game struct for ebiten

func (*Game) Draw

func (g *Game) Draw(screen *ebiten.Image)

Draw the screen

func (*Game) Layout

func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int)

Layout the game screen

func (*Game) Start

func (g *Game) Start()

Start the game

func (*Game) Update

func (g *Game) Update() error

Update logical state of the game

type Location

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

Location in the game

type Object

type Object interface {
	Update()
	Draw(*ebiten.Image, *Game)
	GetLocation() Location
	GetPhysics() Physics
}

Object in the game

type Physics

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

Physics in the game

type Ship

type Ship struct {
	Object
	Location
	Physics
	// contains filtered or unexported fields
}

Ship space ship

func NewShip

func NewShip(x float64, y float64) *Ship

NewShip is initialized and returned

func (*Ship) CcwThrustersOff

func (ship *Ship) CcwThrustersOff()

CcwThrustersOff counter clockwise thrusters off

func (*Ship) CcwThrustersOn

func (ship *Ship) CcwThrustersOn()

CcwThrustersOn counter clockwise thrusters on

func (*Ship) CwThrustersOff

func (ship *Ship) CwThrustersOff()

CwThrustersOff clockwise thruters off

func (*Ship) CwThrustersOn

func (ship *Ship) CwThrustersOn()

CwThrustersOn clockwise thrusters on

func (*Ship) Draw

func (ship *Ship) Draw(screen *ebiten.Image, g *Game)

Draw the ship on screen in game

func (*Ship) FwdThrustersOff

func (ship *Ship) FwdThrustersOff()

FwdThrustersOff forward thrusters off

func (*Ship) FwdThrustersOn

func (ship *Ship) FwdThrustersOn()

FwdThrustersOn forward thrusters on

func (*Ship) GetLocation

func (ship *Ship) GetLocation() Location

GetLocation of ship

func (*Ship) GetPhysics

func (ship *Ship) GetPhysics() Physics

GetPhysics of ship

func (*Ship) RevThrustersOff

func (ship *Ship) RevThrustersOff()

RevThrustersOff reverse thrusters off

func (*Ship) RevThrustersOn

func (ship *Ship) RevThrustersOn()

RevThrustersOn reverse thrusters on

func (*Ship) Update

func (ship *Ship) Update()

Update the ship state

type ViewPort

type ViewPort struct {
	Location
	// contains filtered or unexported fields
}

ViewPort a player sees through

func NewViewPort

func NewViewPort(x float64, y float64, scale int) *ViewPort

NewViewPort is initialized and returned

func (*ViewPort) Follow

func (vp *ViewPort) Follow(obj Object)

Follow object

func (*ViewPort) FollowAhead

func (vp *ViewPort) FollowAhead(obj Object)

FollowAhead of object

Jump to

Keyboard shortcuts

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