Archived

This topic is now archived and is closed to further replies.

Mapping a play area for Tetris

Recommended Posts

I am a bit confused as to what the next step or process is in creating my first game. Here is what I have so far and how I see it going. I have an array of [4][4] that is controlling the blocks that I will generate and have fall. I am using a sprite class to draw the individual blocks to the screen at this time and then have a function that generates random blocks. The blocks do not rotate as of yet but they will rotate by just redrawing the array. As in this: {0,0,0,1 0,0,0,1 0,0,0,1 0,0,0,1} you hit the up key and it now becomes this {0,0,0,0 0,0,0,0 0,0,0,0 1,1,1,1} This is atleast how I see it working, probally will change as this is my first game. What I am trying to get atleast an idea on is how to map out a playing field and then save the one array as it hits the bottom into a larger array which is the playing area. I am working on collision detection right now and getting that to work as it is my first time doing it. And once I get it up and running I want to be able to start working on the play area. Thanks for any hints or suggestions anyone has. Also to move the blocks I am using a translation like this one.

if(KeyDown(DIK_DOWN))
{
Sprite::SetRotation(0,0);
m_vTranslation.x+=m_fTranslateX;
m_vTranslation.y+=m_fTranslateY;
m_fTranslateX=-1.0f;
m_fTranslateY=5.0f;
}


This is the best way I have seen people use, if there is another way to do it that someone knows let me know as I am trying to learn different ways to do stuff. Plexis

• Forum Statistics

• Total Topics
628381
• Total Posts
2982360

• 10
• 9
• 15
• 24
• 11