XNA Game Studio - Tetris Reloaded

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
3,220
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 14, 2009

This is a game of Tetris I programmed in XNA Game Studio from scratch! No books, no websites, all coded by me after researching the algorithm behind Tetris. XNA is a framework for Visual Studio C# which allows you to make 2D and 3D games for the Xbox 360 and PC. The software is 100%, and if your interested in XNA you can visit the official website (Only thing that cost money is if you want to debug your games on Xbox 360, PC games are 100% free to make and the software requires no subscription):
http://creators.xna.com/

SOUND - the game has a theme song and full blown sound effects, my desktop recording software is not capable of recording the sound though. Wait for me to upload the files and then you can experience the game and sounds for yourself!

This game took me a couple of weeks to make, as it's my first real animated game I've ever programmed from scratch ( come from a web programming and software programming background). I've been wanting to make a game of Tetris for a couple of years now, since I started using Qbasic a couple of years ago in school.
At first I wanted to make a game in VB.net, but if you didn't know, Visual Basic sucks at games! I was anxious to use XNA but intimidated by it. After learning Java in college, though, I realized C# is an exact knock off of the Java language and I easily figured out the XNA framework to make my own game.

There are some minor flaws and bugs in the game such as the rows clearing and shapes not rotating when on the edge of the grid, and the coding is a nightmare, as I could have made better use of OOP when I made this but I was more interested in just getting the game to work! Later on I will add the code though, if anyone wishes to see how it works.
The way a traditional modern game of tetris is coded by today uses the "Flood Fill Algorithm", where all the blocks are drawn on the screen and then blocks are flip-flopped as they drop and rotate on the screen. Another array holds the life of each block, if a block is currently alive in that place.
http://en.wikipedia.org/wiki/Flood_fill

Another method I've seen is with smooth animation and no use of the flood fill, although this would require hundreds of lines of code and mathematical calculations to determine the coordinates of each block depending on where others is.
I'm happy to help anyone who is working on their own game of Tetris, it's not that difficult to accomplish although it requires some deep thinking and planning of with pen and paper! Good luck!

Category:

Gaming

Tags:

License:

Standard YouTube License

  • likes, 3 dislikes

Link to this comment:

Share to:

Uploader Comments (sedativechunk)

  • can u pls send me send me a link to the code as well!!

  • Sure, send me your email address in a message and I'll send you the source code.

  • i would like to see the code for this game do you know when your going to post it we have do create a game for class and i want to do tetris and your game is the only game i have seen using xna 3.0 and c #

  • I'll send you a link now with the source code. Check your inbox.

see all

All Comments (10)

Sign In or Sign Up now to post a comment!
  • Thats insane, I wish I could do something like that.

  • Is this done in 3.1? Could you please send me the source code for this? im very interested in learning how to use xna properly so examples like this would be amazing

  • I'm working on a few other ones. I just did the matrix code falling in XNA and I'm working on my own version of Slime Volleyball and then a side scroller. I really want to get into 3D soon!

    Tetris took me years until I understood the flood fill algorithm, it makes things a whole lot easier! If you program the whole grid and controls into a class, you can make 4+ player games of Tetris in XNA, you just have to do the calculations correct so the game handles slower framerates correctly.

  • Wow, im a programmer too and ive just finished one of my own games ive created, its just a simple 2D Shooter game for the mean time. im a true fan of tetris and really like it. have you made any other games?

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more