Click here to Skip to main content
12,633,856 members (28,754 online)
Click here to Skip to main content
Add your own
alternative version


30 bookmarked

Star Fighter

, 25 Oct 2003
Rate this:
Please Sign up or sign in to vote.
A quick and dirty example to make a Star Fighter game using forms with C#.
<!-- Article image -->

Sample Image - starfighter2.jpg

<!-- Add the rest of your HTML here -->


There aren't really too many game programming examples with the C# language...not yet.  Comming from a game programming background, I decided to whip one up with Visual Studios .NET. The final result after 2 hours of coding: Star Fighter 1.0.


Instead of digging deep into the DirectX interface, I decided to just use simple Windows Forms. The process is quite simple. The entire game loop is handle by a simple form timer event which processes the ship movement, aliens movement, bombs, and bullets. Keyboard input is done by the keydown handler event. The entire code is self explanatory and fairly documented. Graphics were ripped from Blitz3d's demo game "Insectoids".


Just a warning to everyone, Windows Forms is not the best method for intense action graphics, and if you experience some poor performance and slowdowns it's normal. I ran this code using a P4 3.02 ghz and it went smoothly for me but others reported extreme slowness. Also, there's an annoying bug when the ship gets hit by the alien's bomb which causes the game to end - that which I could not figure out after a half an hour of debugging.

Questions, Comments, Complaints

For more projects, game demos, C# programming visit my website:

Have Fun!


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

Generalgr8 Pin
shine ms15-Nov-07 3:48
membershine ms15-Nov-07 3:48 
Generalipnee Pin
eraykaya16-Apr-07 20:04
membereraykaya16-Apr-07 20:04 
QuestionTransparent PictureBox possible? Pin
grayaii22-Jan-04 10:42
sussgrayaii22-Jan-04 10:42 
QuestionWhere's the article? Pin
Paul Evans6-Nov-03 1:46
memberPaul Evans6-Nov-03 1:46 
GeneralBomb Bug Pin
Steve Miller3-Nov-03 9:15
memberSteve Miller3-Nov-03 9:15 
GeneralRe: Bomb Bug Pin
snorkie16-May-07 11:22
membersnorkie16-May-07 11:22 
GeneralI know my demo sucks :-D Pin
Rikaino26-Oct-03 9:37
memberRikaino26-Oct-03 9:37 
GeneralDo more with less Pin
Jerry Maguire26-Oct-03 7:01
memberJerry Maguire26-Oct-03 7:01 
GeneralGameplay Pin
Giles26-Oct-03 5:13
memberGiles26-Oct-03 5:13 
GeneralManaged DirectX Pin
Heath Stewart26-Oct-03 3:11
editorHeath Stewart26-Oct-03 3:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161208.2 | Last Updated 26 Oct 2003
Article Copyright 2003 by Rikaino
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid