Skip to content
joj0x90 edited this page Nov 27, 2020 · 4 revisions

Description:

This Object contains some methods to wrap the differnet kind of Tetris blocks onto a two-dimensional array, given a start coordinate. The colors for each block are hardcoded. The blocks will rotate clockwise around a fixed point as described in following image:


i_block(x, y):

Arguments: x -> X-Position of start-pixel, y -> Y-Position of start-pixel.
This rethod will calculate the form for the desired block and return it together with its color.
returns a tuple consisting of an array of positions, which describe the blocks pixels in relation to given (x, y)-position and a predefined color.


o_block(x, y):

Arguments: x -> X-Position of start-pixel, y -> Y-Position of start-pixel.
This rethod will calculate the form for the desired block and return it together with its color.
returns a tuple consisting of an array of positions, which describe the blocks pixels in relation to given (x, y)-position and a predefined color.


l_block(x, y):

Arguments: x -> X-Position of start-pixel, y -> Y-Position of start-pixel.
This rethod will calculate the form for the desired block and return it together with its color.
returns a tuple consisting of an array of positions, which describe the blocks pixels in relation to given (x, y)-position and a predefined color.


z_blocks(x, y):

Arguments: x -> X-Position of start-pixel, y -> Y-Position of start-pixel.
This rethod will calculate the form for the desired block and return it together with its color.
returns a tuple consisting of an array of positions, which describe the blocks pixels in relation to given (x, y)-position and a predefined color.


t_block(x, y):

Arguments: x -> X-Position of start-pixel, y -> Y-Position of start-pixel.
This rethod will calculate the form for the desired block and return it together with its color.
returns a tuple consisting of an array of positions, which describe the blocks pixels in relation to given (x, y)-position and a predefined color.


turn():

There will also be a turn-method for turning the blocks.

Clone this wiki locally