Skip to content
← Back to Community
3D Tetris :D
Profile icon
phazrlazr

This is Tetris but in 3D. So the pieces you control are no longer called tetrominoes, they're now called tetracubes. And the number of blocks for each piece is consistent. But otherwise, this plays like normal Tetris. The controls are stated in the game.

Here is a screenshot of the game. I am getting a tetris for the first time in 3D tetris.
image

In case you don't know how to play Tetris, in 2D (normal) Tetris you gain points and progress through the game by clearing lines. That is done by filling an entire line with blocks. If you reach the top of the play area you lose. So in this 3D Tetris, since the "3D version" of lines are planes, you clear planes instead of lines. The controls, as I stated, are in the game.

I was reading from an OpenGL tutorial and after I finished reading enough that I could probably make something on my own, I thought of making Tetris. In 3D. I've always wondered how 3D Tetris would play like. I decided to make it in WebGL instead because of portability (my friends would probably hesitate running an .exe file I gave them), and I found out the WebGL API is basically just OpenGL but it's in JavaScript instead of C; they even have the same function names. (Except GLSL is different, that was kinda annoying).

It would be cool if someone can fork this but use all the pentacubes instead of all the tetracubes. I looked it up and found a picutre of all 29 of them.
![https://upload.wikimedia.org/wikipedia/commons/f/fa/Pentacubes.PNG]
Of course I could just do that myself, but I'm lazy I guess I dunno.

Voters
Profile icon
ZacNicholson
Profile icon
CoderBroz
Profile icon
DemirDeniz
Profile icon
DalyanErgin
Profile icon
piphi
Profile icon
IGamer123
Profile icon
tussiez
Profile icon
JWZ6
Profile icon
IntelDS
Profile icon
maxina
Comments
hotnewtop
Profile icon
Creatito1

This is amazing, the only thing that could be better is maybe a better layout for the controls.

Profile icon
phazrlazr

@Creatito1 I realize now that the layout definitely isn't the best if you're using a mouse. I was using a touchpad and I guess that people without touchpads are a lot more common, so I changed the layout to better accommodate for the lack of a readily available right hand for the keyboard. Thanks for telling me that.

Profile icon
Creatito1

@phazrlazr Did I do something wrong, I wanted to see the new controls and this happens:

image

It worked fine before?

Profile icon
Creatito1

Oh never mind I got it with this:

image

Profile icon
phazrlazr

@Creatito1 weird, I don't have that enabled and it works perfectly fine. And WebGL initialization is definitely not an extension that is still in draft status... This is the line of code that initializes WebGL immediately before checking if it is properly initialized:

gl = canvas.getContext("webgl");
Profile icon
Creatito1

@phazrlazr well that’s interesting but it works so... whatever

Profile icon
Brendan23

@phazrlazr wow! this is great!

Profile icon
IntellectualGuy

This is awesome!

Profile icon
DuckMonkey

Awesome, man!

Profile icon
FlaminHotValdez

@FuckingMonke L A N G U A G E.

Profile icon
tussiez

Really pog

Profile icon
maxina

POGGG

Profile icon
Jasperscode

someone make hacks and mods for this game

Profile icon
elijahbernard

Cool!

Profile icon
BananaJellyfish

Wow this is amazing!

Profile icon
ch1ck3n

Its amazing how some new people are taken a rise in repl talk than the famous people

Profile icon
Whippingdot

P

O

G

Profile icon
abhayminecraft

This is awesome!

Profile icon
elburg

this is truly beautiful...