Rotating Tetris Piece

BlitzMax Forums/BlitzMax Beginners Area/Rotating Tetris Piece

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

No afraid not.

The game consists of a 2D array grid and each cell can contain a block. The blocks are organised into shapes. Each shape has x/y origins, an array of x/y points that make up the block and its x/y pivot. Research tells me that this is a good way of doing it.

The array of points are relative to the shape's origin.

There are methods to place a piece and remove a piece, at point x/y. This loops through each point and adds the point's value to the origin to find out which cell of the grid should have a block added/removed.