tetris

Tetris Piece Rotation Algorithm

What are the best algorithms (and explanations) for representing and rotating the pieces of a tetris game? I always find the piece rotation and representation schemes confusing. Most tetris games seem to use a naive "remake the array of blocks" at each rotation: http://www.codeplex.com/Project/ProjectDirectory.aspx?ProjectSearchText=t...

How to write Tetris in Scala? (code review)

Today's the 25th birthday of Tetris. I believe writing Tetris clone is one of the best ways to familiarize oneself to a new language or a platform. It's not completely trivial and it lends itself well to learning language specific constructs like iterators and closures. I've been hearing about Scala, and finally decided to read some doc...

Rotating cordinates around pivot? (tetris)

Hi guys, I'm attempting to design my very own tetris clone but have run into a little problem with shape rotations. I have a 2 dimensional array representing a 10 x 20 game grid and individual shape objects which when initialised contain coordinates of where on the grid the shape will start falling from. So for example, when the user m...

Determining which inputs to weigh in an evolutionary algorithm

I once wrote a Tetris AI that played Tetris quite well. The algorithm I used (described in this paper) is a two-step process. In the first step, the programmer decides to track inputs that are "interesting" to the problem. In Tetris we might be interested in tracking how many gaps there are in a row because minimizing gaps could help pl...

Tetris: Layout of Classes

Hi all. I've written a working tetris clone but it has a pretty messy layout. Could I please get feedback on how to restructure my classes to make my coding better. I focuses on making my code as generic as possible, trying to make it more an engine for games only using blocks. Each block is created seperately in the game. My game has ...

C# console tetris programming. Making the pieces move?

Hello friends. 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<Block>, and a class Pieces : List<Piece>. I can already randomly generate pieces, and make them fall one row per second. I still didn't get to collisions detection, but I think that I ...

Is there a standard size for the Tetris grid?

I am, as a lot of other programmers, building a Tetris clone. But the thing is that I try to do my best and I know maybe it's not a relevant detail; but I want to know whether there's a standard size for the grid. Thanks in advance. ...

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 This. Unfortunately, I don't know how to actually define the blocks to make the pieces,...

Can Tetris be made without using XNA currently? Using C#?

I have an outdated computer, that currently will not run certain XNA components. I am a beginner at this stuff, so I'm looking to get some other programming stuff done before I get a new computer that can run XNA and everything else. But is Tetris easy to make without XNA? ...

tetris rotation

Hey, For university we're supposed to write a game (the language is modula2 little chance you know it). Each tetromino is defined through a central piece and 3 relative pieces, Now when it comes to rotation i just rotate the relative blocks (linear algebra). What i am asking myself is how to handle the rotations a user does when the pi...

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. Whenever I start moving pieces left and right I keep getting "index out of range error". Th...