gamescene

package
v0.0.0-...-6206c15 Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PlayerUnit = 32

Variables

This section is empty.

Functions

This section is empty.

Types

type Dir

type Dir int
const (
	DirLeft Dir = iota
	DirRight
	DirUp
	DirDown
)

type Field

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

func (*Field) Conflicts

func (f *Field) Conflicts(rect image.Rectangle, dir Dir) bool

func (*Field) Draw

func (f *Field) Draw(screen *ebiten.Image)

func (*Field) InElevator

func (f *Field) InElevator(rect image.Rectangle) bool

func (*Field) StartPosition

func (f *Field) StartPosition() (x, y int)

func (*Field) TouchesElevator

func (f *Field) TouchesElevator(rect image.Rectangle, dir Dir) bool

func (*Field) TouchesGoal

func (f *Field) TouchesGoal(rect image.Rectangle, dir Dir) bool

func (*Field) Update

func (f *Field) Update(context scene.Context)

type GameScene

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

func New

func New(id int) *GameScene

func (*GameScene) Draw

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

func (*GameScene) Update

func (s *GameScene) Update(context scene.Context) error

type Object

type Object interface {
	OverlapsWithDir(rect image.Rectangle, dir Dir) bool

	Update(context scene.Context)
	Draw(screen *ebiten.Image)
}

type ObjectElevator

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

func (*ObjectElevator) Draw

func (o *ObjectElevator) Draw(screen *ebiten.Image)

func (*ObjectElevator) Overlaps

func (o *ObjectElevator) Overlaps(rect image.Rectangle) bool

func (*ObjectElevator) OverlapsWithDir

func (o *ObjectElevator) OverlapsWithDir(rect image.Rectangle, dir Dir) bool

func (*ObjectElevator) Update

func (o *ObjectElevator) Update(context scene.Context)

type ObjectFF

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

func (*ObjectFF) Draw

func (o *ObjectFF) Draw(screen *ebiten.Image)

func (*ObjectFF) OverlapsWithDir

func (o *ObjectFF) OverlapsWithDir(rect image.Rectangle, dir Dir) bool

func (*ObjectFF) Update

func (o *ObjectFF) Update(context scene.Context)

type ObjectGoal

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

func (*ObjectGoal) Draw

func (o *ObjectGoal) Draw(screen *ebiten.Image)

func (*ObjectGoal) OverlapsWithDir

func (o *ObjectGoal) OverlapsWithDir(rect image.Rectangle, dir Dir) bool

func (*ObjectGoal) Update

func (o *ObjectGoal) Update(context scene.Context)

type ObjectWall

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

func (*ObjectWall) Draw

func (o *ObjectWall) Draw(screen *ebiten.Image)

func (*ObjectWall) OverlapsWithDir

func (o *ObjectWall) OverlapsWithDir(rect image.Rectangle, dir Dir) bool

func (*ObjectWall) Update

func (o *ObjectWall) Update(context scene.Context)

type Player

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

func NewPlayer

func NewPlayer(x, y int) *Player

func (*Player) AtGoal

func (p *Player) AtGoal() bool

func (*Player) Draw

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

func (*Player) Update

func (p *Player) Update(context scene.Context, f *Field)

Jump to

Keyboard shortcuts

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