Click here to Skip to main content
Licence 
First Posted 25 Oct 2003
Views 75,411
Bookmarked 27 times

Star Fighter

By | 25 Oct 2003 | Article
A quick and dirty example to make a Star Fighter game using forms with C#.

Sample Image - starfighter2.jpg

Introduction

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.

Method

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".

Bugs

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: http://www.3d-design.0catch.com/.

Have Fun!

License

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

Rikaino



United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalgr8 Pinmembershine ms2:48 15 Nov '07  
Generalipnee Pinmembereraykaya19:04 16 Apr '07  
QuestionTransparent PictureBox possible? Pinsussgrayaii9:42 22 Jan '04  
QuestionWhere's the article? PinmemberPaul Evans0:46 6 Nov '03  
GeneralBomb Bug PinmemberSteve Miller8:15 3 Nov '03  
GeneralRe: Bomb Bug Pinmembersnorkie10:22 16 May '07  
GeneralI know my demo sucks :-D PinmemberRikaino8:37 26 Oct '03  
GeneralDo more with less PinmemberJerry Maguire6:01 26 Oct '03  
GeneralGameplay PinmemberGiles4:13 26 Oct '03  
GeneralManaged DirectX PineditorHeath Stewart2:11 26 Oct '03  
GeneralRe: Managed DirectX Pinmemberdog_spawn7:12 26 Oct '03  

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.

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