Back to godoc.org

Package blocks

v1.3.0
Latest Go to latest

The latest major version is .

Published: May 14, 2016 | License: Apache-2.0 | Module: github.com/brettchalupa/ebiten

Index

Constants

const ScreenHeight = 240
const ScreenWidth = 256

Variables

var Pieces = map[BlockType]*Piece{
	BlockType1: {
		// contains filtered or unexported fields
	},
	BlockType2: {
		// contains filtered or unexported fields
	},
	BlockType3: {
		// contains filtered or unexported fields
	},
	BlockType4: {
		// contains filtered or unexported fields
	},
	BlockType5: {
		// contains filtered or unexported fields
	},
	BlockType6: {
		// contains filtered or unexported fields
	},
	BlockType7: {
		// contains filtered or unexported fields
	},
}

type Angle

type Angle int
const (
	Angle0 Angle = iota
	Angle90
	Angle180
	Angle270
)

func (Angle) RotateLeft

func (a Angle) RotateLeft() Angle

func (Angle) RotateRight

func (a Angle) RotateRight() Angle

type BlockType

type BlockType int
const (
	BlockTypeNone BlockType = iota
	BlockType1
	BlockType2
	BlockType3
	BlockType4
	BlockType5
	BlockType6
	BlockType7
	BlockTypeMax = BlockType7
)

type Field

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

func NewField

func NewField() *Field

func (*Field) AbsorbPiece

func (f *Field) AbsorbPiece(piece *Piece, x, y int, angle Angle)

func (*Field) Draw

func (f *Field) Draw(r *ebiten.Image, x, y int) error

func (*Field) DropPiece

func (f *Field) DropPiece(piece *Piece, x, y int, angle Angle) int

func (*Field) Flushing

func (f *Field) Flushing() bool

func (*Field) IsBlocked

func (f *Field) IsBlocked(x, y int) bool

func (*Field) MovePieceToLeft

func (f *Field) MovePieceToLeft(piece *Piece, x, y int, angle Angle) int

func (*Field) MovePieceToRight

func (f *Field) MovePieceToRight(piece *Piece, x, y int, angle Angle) int

func (*Field) PieceDroppable

func (f *Field) PieceDroppable(piece *Piece, x, y int, angle Angle) bool

func (*Field) RotatePieceLeft

func (f *Field) RotatePieceLeft(piece *Piece, x, y int, angle Angle) Angle

func (*Field) RotatePieceRight

func (f *Field) RotatePieceRight(piece *Piece, x, y int, angle Angle) Angle

func (*Field) SetEndFlushing

func (f *Field) SetEndFlushing(fn func(lines int))

func (*Field) Update

func (f *Field) Update() error

type Game

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

func NewGame

func NewGame() *Game

func (*Game) Update

func (game *Game) Update(r *ebiten.Image) error

type GameScene

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

func NewGameScene

func NewGameScene() *GameScene

func (*GameScene) Draw

func (s *GameScene) Draw(r *ebiten.Image) error

func (*GameScene) Update

func (s *GameScene) Update(state *GameState) error

type GameState

type GameState struct {
	SceneManager *SceneManager
	Input        *Input
}

type GamepadScene

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

func NewGamepadScene

func NewGamepadScene() *GamepadScene

func (*GamepadScene) Draw

func (s *GamepadScene) Draw(screen *ebiten.Image) error

func (*GamepadScene) Update

func (s *GamepadScene) Update(state *GameState) error

type Input

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

func (*Input) IsRotateLeftTrigger

func (i *Input) IsRotateLeftTrigger() bool

func (*Input) IsRotateRightTrigger

func (i *Input) IsRotateRightTrigger() bool

func (*Input) StateForDown

func (i *Input) StateForDown() int

func (*Input) StateForGamepadButton

func (i *Input) StateForGamepadButton(b ebiten.GamepadButton) int

func (*Input) StateForKey

func (i *Input) StateForKey(key ebiten.Key) int

func (*Input) StateForLeft

func (i *Input) StateForLeft() int

func (*Input) StateForRight

func (i *Input) StateForRight() int

func (*Input) Update

func (i *Input) Update()

type Piece

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

func (*Piece) AbsorbInto

func (p *Piece) AbsorbInto(field *Field, x, y int, angle Angle)

func (*Piece) Collides

func (p *Piece) Collides(field *Field, x, y int, angle Angle) bool

func (*Piece) Draw

func (p *Piece) Draw(r *ebiten.Image, x, y int, angle Angle) error

func (*Piece) DrawAtCenter

func (p *Piece) DrawAtCenter(r *ebiten.Image, x, y, width, height int, angle Angle) error

func (*Piece) InitialPosition

func (p *Piece) InitialPosition() (int, int)

type Scene

type Scene interface {
	Update(state *GameState) error
	Draw(screen *ebiten.Image) error
}

type SceneManager

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

func NewSceneManager

func NewSceneManager(initScene Scene) *SceneManager

func (*SceneManager) Draw

func (s *SceneManager) Draw(r *ebiten.Image) error

func (*SceneManager) GoTo

func (s *SceneManager) GoTo(scene Scene)

func (*SceneManager) Update

func (s *SceneManager) Update(state *GameState) error

type TitleScene

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

func NewTitleScene

func NewTitleScene() *TitleScene

func (*TitleScene) Draw

func (s *TitleScene) Draw(r *ebiten.Image) error

func (*TitleScene) Update

func (s *TitleScene) Update(state *GameState) error

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