Documentation ¶
Index ¶
- Constants
- Variables
- type Angle
- type BlockType
- type Field
- func (f *Field) AbsorbPiece(piece *Piece, x, y int, angle Angle)
- func (f *Field) Draw(r *ebiten.Image, x, y int) error
- func (f *Field) DropPiece(piece *Piece, x, y int, angle Angle) int
- func (f *Field) Flushing() bool
- func (f *Field) IsBlocked(x, y int) bool
- func (f *Field) MovePieceToLeft(piece *Piece, x, y int, angle Angle) int
- func (f *Field) MovePieceToRight(piece *Piece, x, y int, angle Angle) int
- func (f *Field) PieceDroppable(piece *Piece, x, y int, angle Angle) bool
- func (f *Field) RotatePieceLeft(piece *Piece, x, y int, angle Angle) Angle
- func (f *Field) RotatePieceRight(piece *Piece, x, y int, angle Angle) Angle
- func (f *Field) SetEndFlushing(fn func(lines int))
- func (f *Field) Update() error
- type Game
- type GameScene
- type GameState
- type Input
- type Piece
- func (p *Piece) AbsorbInto(field *Field, x, y int, angle Angle)
- func (p *Piece) Collides(field *Field, x, y int, angle Angle) bool
- func (p *Piece) Draw(r *ebiten.Image, x, y int, angle Angle) error
- func (p *Piece) DrawAtCenter(r *ebiten.Image, x, y, width, height int, angle Angle) error
- func (p *Piece) InitialPosition() (int, int)
- type Scene
- type SceneManager
- type TitleScene
Constants ¶
View Source
const ScreenHeight = 240
View Source
const ScreenWidth = 256
Variables ¶
View Source
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 }, }
Functions ¶
This section is empty.
Types ¶
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 (*Field) MovePieceToLeft ¶
func (*Field) MovePieceToRight ¶
func (*Field) PieceDroppable ¶
func (*Field) RotatePieceLeft ¶ added in v1.1.0
func (*Field) RotatePieceRight ¶
func (*Field) SetEndFlushing ¶
type GameScene ¶
type GameScene struct {
// contains filtered or unexported fields
}
func NewGameScene ¶
func NewGameScene() *GameScene
type GameState ¶
type GameState struct { SceneManager *SceneManager Input *Input }
type Piece ¶
type Piece struct {
// contains filtered or unexported fields
}
func (*Piece) DrawAtCenter ¶
func (*Piece) InitialPosition ¶
type SceneManager ¶
type SceneManager struct {
// contains filtered or unexported fields
}
func NewSceneManager ¶
func NewSceneManager(initScene Scene) *SceneManager
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) Update ¶
func (s *TitleScene) Update(state *GameState) error
Click to show internal directories.
Click to hide internal directories.