Reader Level:
Articles

C#RIS : Tetris Game in C#

By Andrew McCarter on February 14, 2002
I have written a Tetris clone that demonstrates how to use off-screen graphics buffering for smooth animation and utilizes a multi-dimensional array approach to designing a game grid. The classes are largely self-explanatory and the techniques are documented in code well enough to explain what is going on.
  • 0
  • 0
  • 50136
Download Files:
 






Overview

I have written a Tetris clone that demonstrates how to use off-screen graphics buffering for smooth animation and utilizes a multi-dimensional array approach to designing a game grid. The classes are largely self-explanatory and the techniques are documented in code well enough to explain what is going on. I have enclosed two screen shots as well. A summary of the classes is as follows:  



LayoutForm.cs              this is merely the GUI for the game and controls all keyboard input
Screen.cs                     this class handles the creation of off-screen graphics used for
double-buffering

Shape.cs                      this class takes care of creating the shape and positioning it in the game grid

GameGrid.cs                 this class represents the game grid - comprised of a multi-dimensional array

Andrew McCarter

Andrew K. McCarter is a senior technology consultant with Technium, Inc. He currently works on architecting web-based systems that interface with SAP. This is his first C# program.

COMMENT USING

Trending up