1/jekyll_site/en/2023/01/22/volumetric-tetris.md
2023-12-17 08:21:20 +03:00

3.3 KiB

title description sections tags scripts styles canonical_url url_translated title_translated date lang
Volumetric tetris General educational game in the broad meaning of this word. When learning programming languages, it is recommended to write your own version first and then...
Logical game
Experimental interface
javascript
online
canvas
game
puzzle
geometry
matrix
graphics
square
cube
3d
three-dimensional
/js/classes-point-cube.js
/js/tetris-figures.js
/js/tetris-model.js
/js/tetris-controller.js
/js/tetris-view.js
/css/pomodoro1.css
/en/2023/01/22/volumetric-tetris.html /ru/2023/01/21/volumetric-tetris.html Объёмный тетрис 2023.01.22 en

General educational game in the broad meaning of this word. When learning programming languages, it is recommended to write your own version first and then use it to demonstrate and test other software or hardware. The three-dimensional interface is written in JavaScript Canvas — the logic of the game itself is two-dimensional.

Description of graphics algorithm: [Spinning cube in space]({{ '/en/2023/01/11/spinning-cube-in-space.html' | relative_url }}).

Experimental interface

Turned off by default — you can just play Tetris. In addition to the flat version, two volumetric variants are added: parallel projection and perspective projection — parameters for each of them can be changed. For perspective projection: you can change the position of the observer screen and the remoteness of the projection source. The observer looks at the center of the image, and the center of the projection is remote at a distance, comparable to the size of the playing field. For parallel projection: you can change the vertical position. For both projections: you can rotate the playing field along all three axes. The central point for rotations — is the central lower far point of the field. For all variants of the image: the size of the cube — 32, the size of the square — 30 and the indent — 2. The origin of coordinates is located at the upper left point, the axes are directed: X to the right, Y downwards and Z to the distance.

Usage example: start the game, collect a certain number of figures on the field, then pause the game, and switch between the variants of the three-dimensional image, rotate the field with figures, change the settings.

{% include volumetric-tetris-en.html -%}

Gaming process

Controls: keyboard buttons with arrows — right, left, up, down and the button pause.

Game points are awarded for fully collected rows of the elements of the figures. The number of points scored depends on the number of rows collected, 10 points for each row if there are 10 cubes in a row, and multiply increases, if collected at the same time: 2 lines — by 3 times, 3 lines — by 5 times, 4 lines — by 10 times.

Game feature: the collected lines first blink and then disappear, while the gaming process is not suspended for this time — the current figure continues to fall.

Level increases when collecting 10 completed rows, that is 100 points, if there are 10 cubes in a row. At each new level, the speed of the figures increases and reaches its maximum at level 21. In snail mode, the speed increases 5 times slower and reaches a maximum at level 104. The current speed is displayed above the playing field as a meter indicator.