class Tetryst::Board

Defined in:

tetryst/board.cr

Constant Summary

BLOCK_SIZE = ((Game::SCREEN_HEIGHT / GRID_HEIGHT) / 8).to_i * 8

in pixels

BLOCKED_TIME = 0.2
DROP_TIME = 0.5

in seconds

GRID_HEIGHT = 22
GRID_WIDTH = 10

in blocks

KEY_DOWN_INITIAL_TIME = 0.2
KEY_DOWN_SOFT_DROP_RATE = 2
KEY_DOWN_TIME = 0.06
SCORE_FOUR_LINES = 800
SCORE_HARD_DROP = 2
SCORE_ONE_LINE = 100
SCORE_SOFT_DROP = 1

score

SCORE_THREE_LINES = 500
SCORE_TWO_LINES = 300

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(x : Int32 = 0, y : Int32 = 0, level : Int32 = 0) #

[View source]

Class Method Detail

def self.height #

[View source]
def self.width #

[View source]

Instance Method Detail

def cells : Array(Array(Cell)) #

[View source]
def clear_lines #

[View source]
def draw #

[View source]
def drop_time_from_level #

[View source]
def game_over? : Bool #

[View source]
def game_over_collision?(tetromino) #

[View source]
def level : Int32 #

[View source]
def lines_cleared : Int32 #

[View source]
def new_level #

[View source]
def new_tetromino #

[View source]
def next_tetrominos : Array(Shape) #

[View source]
def place(tetromino : Tetromino) #

[View source]
def print #

[View source]
def score : Int32 #

[View source]
def set_cell(grid_x, grid_y, shape : Shape) #

[View source]
def update #

[View source]
def update_tetromino #

[View source]
def x : Int32 #

[View source]
def y : Int32 #

[View source]