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
1
vote
2 answers

python list Index out of range error

I am working on a python tetris game that my proffessor assigned for the final project of a concepts of programming class. I have got just about everything he wanted to work on it at this point but I am having a slight problem with one part of it.…
dman762000
  • 181
  • 1
  • 1
  • 6
1
vote
3 answers

C++ Tetris: A function that deletes lines

I've been studying this tetris tutorial and I've come across the function that deletes lines and brings the row/s down one level. I'm kind of understanding what is going on with these functions, but some parts are confusing me. I'll try and explain…
longAD
  • 53
  • 1
  • 6
1
vote
4 answers

How do I create Tetris Blocks in XNA with C#?

I'm making a Tetris Clone in C# with XNA, and I'm unsure of how to actually implement the blocks. I don't think that making the shapes as images will work (because parts are removed when lines are formed), so I Have blocks to make up the pieces like…
Slateboard
  • 1,031
  • 6
  • 15
  • 31
1
vote
1 answer

My JPanel class does not draw a rectangle onto my JFrame?

I am trying to make a tetris game using java however I am currently just trying to make a shape appear on my Game Grid... I have looked at my code and cannot find any errors or mistakes which mean this won't work? This is my main class called…
1
vote
2 answers

Java Tetris rotation bug

I'm having some problems with Tetris. So first of all, I have a class Shape, and then subclasses of Shape for each shape type. This is how a Shape subclass looks like: public class SquareShape extends Shape { public SquareShape(){ coords…
V Sebi
  • 4,253
  • 2
  • 15
  • 8
1
vote
2 answers

C# console tetris programming. Making the pieces move?

I'm trying to make my first game, a console tetris. I have a class Block, that contains x and y integers. Then I have a class Piece : List, and a class Pieces : List. I can already randomly generate pieces, and make them fall one row…
Uri
  • 2,207
  • 2
  • 21
  • 21
1
vote
3 answers

getting undefined at random times

i will try to add only relevant code but just in case its needed full page is here, and feel free to check it out on github as well. i am building a tetris game using canvas/javascript and part of it //drop the falling piece by one…
Math chiller
  • 4,123
  • 6
  • 28
  • 44
1
vote
0 answers

Most optimal way to fill grid with 1 type Tetromino

I need to fill a grid with variable X (X is between 2 and 7) and Y (Y is lower then 30) with a predefined shape, in this case a T Tetromino (the block with a row of three blocks with one added below the center). The Tetromino can rotate in all 4…
J. van Dijk
  • 395
  • 3
  • 6
1
vote
2 answers

Get the value of an individual pixel

I'm making Tetris and im trying to make a line clear function. I have a way to do this that is a bit complicated and im looking to simplify. My idea is to check some pixel RGB values and see if they're not black (the color of the background). Is…
Dan G.
  • 982
  • 1
  • 8
  • 20
1
vote
3 answers

Having trouble stopping the pieces in my Tetris game(Java swing)

I'm making a tetris game in Java, and I am having a little trouble making the current piece stop when they hit another piece that's already landed. I have separate classes for each tetromino shape. When the currentPiece is falling, the shape with…
RN_
  • 878
  • 2
  • 11
  • 30
1
vote
1 answer

Tetris GUI by coloring JButtons. Problems with rendering

I am making a Tetris game and for my GUI I chose to color JButtons to use as my tetris board. I set up a grid of JButtons. I plan to loop through the Tetris grid that is returned from newGrid = game.gamePlay(oldGrid); and color each JButton based…
msteppe91
  • 143
  • 2
  • 18
1
vote
5 answers

how to generate Tetris piece from a given grid

At first I think my question should have been asked before, but I didn't find what I want. One element of this iOS app I'm developing is break a 8x8 grid into Tetris pieces (every piece is made of 4 blocks). Two particular question I have are: what…
Tony Xu
  • 3,031
  • 4
  • 32
  • 43
1
vote
4 answers

JPanel within JFrame

I've just started learning Java and now I'm making a GUI for Tetris. I want to have something like that: But I get: EDIT: Could someone tell me how to fix this? It is the part of a TetrisFrame's (extending JFrame) constructor: setLayout(new…
nme
  • 647
  • 1
  • 7
  • 22
0
votes
3 answers

Checking Left/Right in an int array for Tetris, Android/Java

I'm trying to make a tetris game for android to help learn game programming for android. My goLeft/Rights break right when the button is pressed, the code for going left is in a class separate of the fields int array, and the list parts array. The…
Matthew
  • 35
  • 1
  • 8
0
votes
3 answers

Why am I getting this Stack Overflow exception?

I am writing a Tetris clone, which is the largest project I have really done. In implementing the row deletion code, I have begun recieving a stack overflow exception. I think it probably has something to do with my huge collections or horribly…
Patrick
  • 1,894
  • 3
  • 15
  • 17