Jump to content
  • Advertisement
Sign in to follow this  
Jiggle156

Tetris Clone (in progress, hit a wall)

This topic is 2540 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am currently writing a Tetris clone game, and due to a lack of knowledge on how to plan properly - its becoming...challenging.
I have written a fair amount of code already, but it's all over the place - and probably only makes sense in my head, so perhaps best not to post it here. But anyhow, I am using a 2D array of boolean values to deal with collision. A brick will be randomly created, and bound to the base pointer controlled by key events. I understand how its going to move, and collide with things - but I have absolutely no idea what to do when it hits the bottom. How should I make it 'stay around', once the block is deleted, and a new one bound?

Note: Using C++, SDL and this is my first game project.

Share this post


Link to post
Share on other sites
Advertisement
When I've written Tetris clones in the past I tended to have a 2d array of blocks for use as the background blocks, as it were. So when your shape settles, just turn on relevant blocks on the background 2d array.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!