3d Tetris is a reimagining of traditional Tetris into a 3-dimensional play spaces.
That means instead of moving in just the X-axis, the player now moves in the X and Z-axes.
Instead of rotating in just the Z-axis, the player can rotate the pieces in the X and Z-axes.
Conceptually simple, the added dimension actually greatly increases the difficulty of clearing layers and provides a unique and challenging experience.
The level contains important metadata for performing collision detection and game logic.
The shape is the piece the player can currently manipulate. It uses the level to prevent the player from making illegal moves.
The blocks are the basic component of each piece. Both the level and shape are comprised of a series of blocks.
For added experience, I implemented linear interpolation for the rotation of the shapes by the player. Because the level is designed as a grid, actually moving the shapes with interpolation would cause problems with the collision detection. Instead, when the player pushes a button to rotate the shape, a short animation is played, before the piece is put back in its proper position.
To start/unpause the game, push 'p'
Use 'wasd' to move the shape forwards, left, back, and right
Use 'WASD' (shift + 'wasd') to rotate the shape forwards, left, back, and right
Use [Spacebar] to quick snap the current shape down onto the level
Have fun!
Don't judge, it's harder than it looks!
CSCE 450 Programming Assignment Code
Designed with Mobirise
OpenGL