Introduction
Missile Command .NET is a simple video game written in C# using GDI+ for graphics. It's a tribute to the classic Missile Command game by Atari. I wrote this game to teach myself more about programming in C#.
What can you learn from this code?
This code demonstrates:
- How to use the System.Drawing namespace to render simple yet effective graphics.
- How to use the System.IO namespace to read from and write to text files.
- How to implement multiple forms and pass information between them.
- How to implement a window menu bar in code.
- How to use a Timer component to trigger an event at a regular interval.
- How to detect a collision between graphics using the Bitmap.GetPixel method.
- How to interact with various input controls on a form.
- How to pull good performance from a C# Windows application by eliminating boxing/unboxing ('new' keyword) from core code, avoiding implicit and explicit type conversions, and using the StringBuilder class to build strings instead of the '+' operator.