Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 129025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:43:42+00:00 2026-05-11T05:43:42+00:00

I am working on coding a Tetris clone in XNA C# and am unsure

  • 0

I am working on coding a Tetris clone in XNA C# and am unsure of the best way to approach the data structure side of the game on a high level.

I am totally fine with the collision detection, rotations, animation etc. What I need to know the best way to do the storing of ‘dropped blocks’ – ie blocks that are no longer under tha player’s control.

I think that each Tetromino block should be stored in its own class that consists of a 4×4 array so that the block can easily be rotated. The problem is then how to I store the tetromino’s final position into the game grid by then cutting the tetromino up into individual blocks(for each cell) and then set the main game grid’s corresponding positions to hold these same blocks, then disappearing the tetromino once it has reached its final position. Maybe there is some drawback to my method.

Should I create a 10×20 matrix for the main game grid which can then store? or should I use stacks or queues to somehow store the dropped blocks. Or maybe there is some better method/data structure to store things?

I am sure my way would work, but I am reaching out to see if anybody knows a better way or if my way is good enough?

P.S. Not homework, this will be a project for my portfolio. Thanks.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:43:43+00:00Added an answer on May 11, 2026 at 5:43 am

    Once a block is immobile, there’s nothing that distinguishes it from any other block that is now immobile. In that regard, I think it makes the most sense to store the entire grid as a matrix, where each square is either filled or not (along with the color of the block if it is).

    I feel like the matrix has many advantages. It’ll make collision detection simple (no having to compare with multiple objects, just locations on a matrix). Storing it as a matrix will also make it easier to determine when a full line has been created. On top of that, you don’t have to worry about splicing an immobile Tetromino when a line disappears. And when one does, you can just shift the entire matrix down in one fell swoop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a novice in PHP & MySQL coding and still working my way through
I've been working through the Stanford iPhone Coding course and currently hooking into the
I'm working on a project where I'm coding in C in a UNIX environment.
I've been working with a small group of people on a coding project for
I'm working for a company that has strict coding style guidelines but no automatic
I'm used to doing all my coding in one C file. However, I'm working
I've been working/coding in C#/Java for some years, so the basics etc. don't give
$fp = fopen(http://feeds.reuters.com/Reuters/PoliticsNews?format=xml,r) or die(Error reading RSS data.); The above coding working correctly in
I am working on a coding problem and I need to check whether a
I've been working on coding a personal website from scratch in my free time,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.