Some kind of Tetris

Comments

  • Wow, rotating Tetris! You should post it here as well: <:-P
    https://www.Reddit.com/r/processing/new/

  • I love it!

  • Lovely "Ringtris" -- an interest prototype. The aesthetic reminds me of some of the Art Style games -- in particular, Cubello.

    It would be interesting if ragged bottom rows of the tube also hung down from the top of the screen, and you could press a special key to "clamp" them (like a mechanical press) and clear the matching rows from the bottom of screen if they match the ragged top row. This would make it "Toroid-tris" since it potentially wraps in both directions.

  • Thanks for your kinds words! Never heard of Cubello, but it looks interesting.

    @jeremydouglass: Your idea sounds interesting, too. But rather than modifying the actual game I would go for "Toroid-tris" right from the beginning. Maybe with a toroid-like depiction of the playfield, as well. I'll think about how to do this effectively.

    But till then, I'm working on a multitasking game.

    multitask

    Up to now it's just a rough working prototype. I have to improve some things and I'll also make it a little prettier later on. Then I'll post it here as well. (And yes, I like Teris). ;)

  • ...or go real 3D (at the moment the game logic is still 2d, the game surface is just turned to circle)

    real 3D:

    https://en.wikipedia.org/wiki/Blockout

  • Yeah, I tried these more-D-tetrisses (also the 4 dimensional version) but I found the 2D versions more enjoyable and I still think the old "standard" tetris works best as as game.

  • Bellissimo :)

  • here is a example of some blockout stones / pieces

    Blockout II seems to be for free btw, see below

    // BlockOut 
    
    // https : // en.wikipedia.org/wiki/Blockout
    // http : // www.blockout.net/blockout2/
    
    
    ArrayList<Piece> pieces = new ArrayList ();
    
    int[][][] layout0 =  {
      { { 0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      {{ 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 1, 1, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }
    }; 
    
    int[][][] layout1 =  {
      { { 0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 1, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 1, 1, 0, 0}, 
        {0, 0, 1, 1, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }
    };
    
    
    int[][][] layout2 =  {
      { { 0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      {{ 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 1, 1, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }
    }; 
    
    
    int[][][] layout3 =  {
      { { 0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      {{ 0, 0, 0, 1, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 1, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 0, 1, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0} 
      }
    };
    
    int[][][] layout4 =  {
      { { 0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      {{ 0, 0, 0, 1, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 1, 1, 1, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 1, 1, 1, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 1, 1, 1, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0} 
      }
    };
    
    
    int[][][] layout5 =  {
      { { 0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      {{ 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 1, 0, 0}, 
        { 0, 0, 0, 0, 0, 0}, 
        { 0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 1, 1, 1, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 1, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }, 
    
      { {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0}, 
        {0, 0, 0, 0, 0, 0} 
      }
    }; 
    
    
    void setup() { 
      size(1300, 800, P3D);
    
      Piece temp1 ; 
      temp1 = new Piece (layout0, 0, color(255, 0, 0), 
        199, 100, 0 );
      pieces.add(temp1);
    
      temp1 = new Piece (layout1, 1, color(255, 0, 255), 
        199, 250, 0 );
      pieces.add(temp1);
    
      temp1 = new Piece (layout2, 2, color(5, 255, 255), 
        199, 400, 0 );
      pieces.add(temp1);
    
      temp1 = new Piece (layout3, 3, color(5, 5, 255), 
        199, 550, 0 );
      pieces.add(temp1);
    
    
      // 2nd column 
      temp1 = new Piece (layout4, 4, color(5, 255, 0), 
        359, 100, 0 );
      pieces.add(temp1);
    
      temp1 = new Piece (layout5, 5, color(5, 255, 0), 
        359, 250, 0 );
      pieces.add(temp1);
    }
    
    void draw() {
    
      background(255);
      lights(); 
    
      for (Piece currentPiece : pieces) {
        currentPiece.display();
      } //for
    } // func 
    
    // ==============================================
    
    class Piece {
    
      int type = 0;
    
      color c1 = color(255, 0, 0); 
    
      boolean[][][] layout = new boolean [6] [6] [6];
    
      int size = 18; 
    
      float angle1 = random(TWO_PI); 
      float angle2 = random(TWO_PI); 
    
      PVector pos = new PVector(); 
      // constr 
      Piece ( int[][][] layoutTemp, int typeTemp, 
        color colorTemp, 
        float xTemp, float yTemp, float zTemp) {
    
        type = typeTemp;
        c1   = colorTemp; 
    
        for (int x=0; x<6; x++) { 
          for (int y=0; y<6; y++) { 
            for (int z=0; z<6; z++) {
              if (layoutTemp[x][y][z]==1) {
                layout[x][y][z]=true;
              } else { 
                layout[x][y][z]=false;
              } //
            }//for
          }//for
        }//for
    
        pos.x=xTemp; 
        pos.y=yTemp; 
        pos.z=zTemp;
      } // constr 
    
      void display() {
    
        pushMatrix();
    
        translate(pos.x, pos.y, pos.z);
        rotateY(angle1);
        rotateZ(angle2);
    
        fill(c1); 
        for (int x=0; x<6; x++) { 
          for (int y=0; y<6; y++) { 
            for (int z=0; z<6; z++) {
              if (layout[x][y][z]) {
                pushMatrix();
                translate ((x-3)*size, (y-3)*size, (z-3)*size); 
                box(size); 
                popMatrix();
              }//if
            }//for
          }//for
        }//for
        popMatrix();
        angle1+=.041;
        angle2+=0.0402;
      }// method
      //
    }//class
    //
    
  • I made a P5.js version. It's now playable online: polymetronome.com/tube

  • Really fun. Nice reflection effect.

    One suggestion -- the wide row size (19) means that clearing rows moves really slowly and that single mistakes are much more likely to block a row (1/19, not 1/10) -- so the game feels slower and harder than original Tetris, with less positive feedback. Perhaps consider scaling up on a tighter ring, like 13? Or making that a setting.

  • looks fantastic

    Although I have to hold shift to make A and S and cursor work

    (Win 10 machine here)

  • Although I have to hold shift to make A and S and cursor work.

    Weird. When I used 'a' and 's' for input nothing happened for me when I pressed the keys (caps lock was not active). I had to use 'A' and 'S' for the inputs to be recognized. Anyway, I now use both.

  • thanks, a and s work now

    for cursors, I still have to hold shift (which doesn't make sense really, I know)

  • I now included the keycodes from keycode.info/ for the arrow keys.

    Which browser do you use?

  • I still need to hold shift

    Mozilla Firefox on Win10

  • It's the same for me with Firefox but I have no clue why this happens.

    The keycodes displayed on keycode.info are the same in Firefox.

Sign In or Register to comment.