gtris

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScreenWidth  = 240
	ScreenHeight = 240
)

Variables

This section is empty.

Functions

func NewFont

func NewFont() font.Face

Types

type AttractModeInput

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

func NewAttractModeInput

func NewAttractModeInput() *AttractModeInput

func (*AttractModeInput) IsSpacePressed

func (input *AttractModeInput) IsSpacePressed() bool

func (*AttractModeInput) Read

func (input *AttractModeInput) Read() *ebiten.Key

type Game

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

func NewGame

func NewGame() *Game

func (*Game) Draw

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

func (*Game) Layout

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

func (*Game) Start

func (g *Game) Start()

func (*Game) StartPlay

func (g *Game) StartPlay()

func (*Game) Update

func (g *Game) Update() error

type GameState

type GameState int
const (
	GameStateGameOver GameState = iota
	GameStatePlaying
)

type Input

type Input interface {
	Read() *ebiten.Key
	IsSpacePressed() bool
}

type KeyboardInput

type KeyboardInput struct {
}

func (*KeyboardInput) IsSpacePressed

func (*KeyboardInput) IsSpacePressed() bool

func (*KeyboardInput) Read

func (*KeyboardInput) Read() *ebiten.Key

type Piece

type Piece struct {
	Blocks [][]int
	Image  *ebiten.Image
}

func NewPiece

func NewPiece(blocks [][]int, imgData []byte) *Piece

func (*Piece) Draw

func (p *Piece) Draw(screen *ebiten.Image, gameZonePos *Position, piecePos *Position)

type Position

type Position struct {
	X int
	Y int
}

func (*Position) Add

func (p *Position) Add(other Position)

type Size

type Size struct {
	Width  uint
	Height uint
}

Jump to

Keyboard shortcuts

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