Questions tagged [tetris]

Block matching game created by Alexey Pajitnov . Elements are 4-segmented pieces where the name of the game comes (tetra is numerical prefix in Greek used for 4).

Tiles are 4-segmented pieces which also provided the name of the game (tetra the Greek numerical prefix for the number 4). More on Wikipedia

285 questions
0
votes
1 answer

Generate a sequence of strings based on a sample string out of string fragments

I have a list if items/ tuples which contain sets like this: a_list = [(a, {x}), (b, {y}), (c, {y,z}), (d, {y,z}), (e, {x,y}), (f, {x,y,z})] And a sample pattern: pattern = {x,y} Given a number of draws i would like to generate a sequence of items…
Raggamuffin
  • 699
  • 1
  • 6
  • 19
0
votes
1 answer

UNITY.. C#. How to make 3 gameObjects as one without losing each of gameObjects positioning

I am making a puzzle using drag & drop in unity. The puzzle piece is like Tetris-piece, each puzzle piece is composed of a group of cubes. the puzzle piece needs to be dragged and then dropped into the slots of missing cubes of the structure(e.g.…
Critics
  • 59
  • 11
0
votes
2 answers

Using arrays for tetris pieces and grid. Why won't this piece show up completely?

Here's the code, below is a link to the jsfiddle. The first row of the block isn't drawn for some reason, all these 2 dimension for loops are hard for me to wrap my head around, and can't find the reason why the block is only being drawn from the…
onlyme0349
  • 93
  • 1
  • 8
0
votes
1 answer

Tetris Rotation without arrays

I am writing a Tetris Clone, it is almost done, except for the collisions. For example In order to move the Piece Z I use a method: void PieceZ::movePieceDown() { drawBlock (x1,y1++); drawBlock (x2,y2++); drawBlock (x3,y3++); drawBlock…
user5759898
0
votes
1 answer

Tetris shifting 2D array

I'm currently writing a tetris in C++ and I am at the last stage, I need to delete a row when it is full. Once a piece falls it is stored in a boolean array grid[20][10]. For example I check which row is full (or true), if it is I call a method…
user5759898
0
votes
1 answer

Uncaught TypeError: Cannot read property 'length' of undefined [JavaScript]

So I'm trying to make a Tetris game but when I open it in my browser I get Uncaught TypeError: Cannot read property 'length' of undefined. Tetris.html:245 in the JavaScript console. Then I go and take a look at it and it looks right so I posted it…
Adam Oates
  • 193
  • 3
  • 12
0
votes
1 answer

Problems with a getter for a 4x4 matrix in c

Hello I have to program a tetris game in C by tomorrow and I'm having a bit of trouble with a getter that should return a sprite as a 4x4 matrix. It most likely is pretty simple tho I am not that familiar with pointers to arrays. so in the first…
0
votes
1 answer

Deleting part of figure drawn with patch - MATLAB

So im trying to build a simple tetris game in Matlab. I am drawing and updating the figure using the patch method with predefined position vectors for each shape. So far so good, but when i need to delete a row (when the player fills a row), i am…
mihaa123
  • 1,012
  • 9
  • 19
0
votes
0 answers

How to check if you can move a tetris piece to left or right

So I am making a Tetris game as a learning project in Java. The structure of the game is that I have a block class, which holds the coordinates of each block, and also I have a tetromino class, which holds an array of blocks and can change all of…
0
votes
2 answers

Java - keyPressed event isn't being called

I am making myself a tetris clone in java, as a learning project. However I am now stuck at the part of getting the input for moving the piece left and right. I am not sure if the problem is in my methods, or is in the keyPressed method not being…
0
votes
2 answers

Tetris [PyGame] - Let the shapes fall

I'm trying to clone the Tetris game and already have PyGame pick a random shape and display it. I drew an array-backed grid and 'told' PyGame to draw colored squares in certain cells in order to get the cells. def iShape(): grid [0][5] = 3 …
Yuki
  • 1
  • 2
0
votes
1 answer

how to draw the blocks for tetris

So Im making tetris and I dont know how to draw the blocks( L,I,Z etc) I have one block as Texture2D and every class for the blocks look like this: namespace Tetris { public class ZBlock { Color Color; const int x = 4; …
0
votes
1 answer

Tetris brain java

I have an assignment to make a better tetris brain in Java. I am fairly new to the program and I am having some difficulties coming up with a loop to help me place the pieces in any space that doesn't have any pieces there already. I tried this loop…
0
votes
1 answer

Invalid read of size 1 in tetris using valgrind

I am trying to write a tetris dynamic 2D array of rows and cols named data; I make a function called edit_2Darray to duplicate the original 2D array and make each column longer, and for the rest I fill with space; ==21909== Invalid read of size…
0
votes
1 answer

C++ Tetris Program bucket not being displayed

I am making a C++ Tetris game for my programming class and write now I am working on displaying the bucket and having the pieces drop into the bucket, but I am not yet moving the pieces in the bucket. I am able to build the program successfully, but…