Back to godoc.org

Package field

v0.0.3
Latest Go to latest

The latest major version is .

Published: Feb 26, 2020 | License: Apache-2.0 | Module: github.com/kemokemo/kuronan-dash

Index

Variables

var LaneHeights = []int{firstLaneHeight, secondLaneHeight, thirdLaneHeight}

LaneHeights is the height array to draw lanes.

type Cloud

type Cloud struct {
	Image *ebiten.Image
	// contains filtered or unexported fields
}

Cloud is the cloud object to draw.

func (*Cloud) Draw

func (c *Cloud) Draw(screen *ebiten.Image) error

Draw draws this cloud.

func (*Cloud) Initialize

func (c *Cloud) Initialize(img *ebiten.Image, pos view.Position)

Initialize initializes this cloud with a image and the initial position.

func (*Cloud) SetMagnification

func (c *Cloud) SetMagnification(mag float32)

SetMagnification sets the magnification for the scroll speed.

func (*Cloud) SetSpeed

func (c *Cloud) SetSpeed(speed ScrollSpeed)

SetSpeed sets the speed to scroll.

func (*Cloud) Update

func (c *Cloud) Update()

Update updates the position of this cloud according to the spped.

type Field

type Field interface {
	Initialize()
	SetScrollSpeed(speed ScrollSpeed)
	Update()
	Draw(screen *ebiten.Image) error
}

Field is the interface to draw the field.

type Grass

type Grass struct {
	Image *ebiten.Image
	// contains filtered or unexported fields
}

Grass is the Grass parts to move and draw.

func (*Grass) Draw

func (p *Grass) Draw(screen *ebiten.Image) error

Draw draws this cloud.

func (*Grass) Initialize

func (p *Grass) Initialize(img *ebiten.Image, pos view.Position, v0 float32)

Initialize initializes this cloud with a image and the initial position. The v0 argument is the initial scroll speed for the Normal speed.

func (*Grass) SetSpeed

func (p *Grass) SetSpeed(speed ScrollSpeed)

SetSpeed sets the speed to scroll.

func (*Grass) Update

func (p *Grass) Update()

Update updates the position of this cloud according to the spped.

type Mountain

type Mountain struct {
	Image *ebiten.Image
	// contains filtered or unexported fields
}

Mountain is the mountain parts to move and draw.

func (*Mountain) Draw

func (m *Mountain) Draw(screen *ebiten.Image) error

Draw draws this cloud.

func (*Mountain) Initialize

func (m *Mountain) Initialize(img *ebiten.Image, pos view.Position, v0 float32)

Initialize initializes this cloud with a image and the initial position. The v0 argument is the initial scroll speed for the Normal speed.

func (*Mountain) SetSpeed

func (m *Mountain) SetSpeed(speed ScrollSpeed)

SetSpeed sets the speed to scroll.

func (*Mountain) Update

func (m *Mountain) Update()

Update updates the position of this cloud according to the spped.

type PrairieField

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

PrairieField is the field of prairie.

func (*PrairieField) Draw

func (p *PrairieField) Draw(screen *ebiten.Image) error

Draw draws the all field parts.

func (*PrairieField) Initialize

func (p *PrairieField) Initialize()

Initialize initializes all resources to draw.

func (*PrairieField) SetScrollSpeed

func (p *PrairieField) SetScrollSpeed(speed ScrollSpeed)

SetScrollSpeed sets the speed to scroll.

func (*PrairieField) Update

func (p *PrairieField) Update()

Update moves viewport for the all field parts.

type ScrollSpeed

type ScrollSpeed int

ScrollSpeed is the speed of scrolling the field.

const (
	// VeryFast is the fastest scrolling.
	VeryFast ScrollSpeed = iota
	// Fast is the fast scrolling.
	Fast
	// Normal is the normal scrolling.
	Normal
	// Slow is the slow scrolling.
	Slow
	// VerySlow is the slowest scrolling.
	VerySlow
)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier