Click here to Skip to main content
Click here to Skip to main content

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

Comments and Discussions

Generalgr8 Pinmembershine ms15-Nov-07 3:48 
Generalipnee Pinmembereraykaya16-Apr-07 20:04 
QuestionTransparent PictureBox possible? Pinsussgrayaii22-Jan-04 10:42 
QuestionWhere's the article? PinmemberPaul Evans6-Nov-03 1:46 
GeneralBomb Bug PinmemberSteve Miller3-Nov-03 9:15 
GeneralRe: Bomb Bug Pinmembersnorkie16-May-07 11:22 
GeneralI know my demo sucks :-D PinmemberRikaino26-Oct-03 9:37 
GeneralDo more with less PinmemberJerry Maguire26-Oct-03 7:01 
GeneralGameplay PinmemberGiles26-Oct-03 5:13 
GeneralManaged DirectX PineditorHeath Stewart26-Oct-03 3:11 
GeneralRe: Managed DirectX Pinmemberdog_spawn26-Oct-03 8:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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.150414.1 | Last Updated 26 Oct 2003
Article Copyright 2003 by Rikaino
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid