game

package
v0.0.0-...-0ee797a Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Figure     models.Figure
	Field      [][]int
	FigureType int

	StartTime   time.Time
	PlayerScore int
}

func DefaultData

func DefaultData() (data Data)

Creates a variable with default game data

func (*Data) CheckFilledLines

func (d *Data) CheckFilledLines()

Checks for filled lines, removes them if found and increases the score

func (*Data) Create

func (d *Data) Create()

This function is responsible for creating a new shape with random coordinates on the x-axis and random rotation

func (*Data) EndStats

func (d *Data) EndStats()

Printing of the player's score along with the exit from the game

func (*Data) Game

func (d *Data) Game()

func (*Data) GameScreen

func (d *Data) GameScreen()

Displaying the playing field

func (*Data) Move

func (d *Data) Move(command string) bool

This function is responsible for correct movement of the figure on the field

func (*Data) ReadingKeyboard

func (d *Data) ReadingKeyboard()

This function is responsible for controlling the falling figure with the keyboard

func (*Data) Save

func (d *Data) Save()

Adding a fallen figure to the field

Jump to

Keyboard shortcuts

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