Click here to Skip to main content
6,596,602 members and growing! (18,874 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Game Development » Games     Intermediate

Star Fighter

By Rikaino

A quick and dirty example to make a Star Fighter game using forms with C#.
C++, C#.NET 1.0, .NET 1.1, Win2K, WinXP, Win2003, Visual Studio, MFC, Dev
Posted:25 Oct 2003
Views:62,775
Bookmarked:19 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
27 votes for this article.
Popularity: 4.52 Rating: 3.16 out of 5
13 votes, 48.1%
1
1 vote, 3.7%
2
2 votes, 7.4%
3
3 votes, 11.1%
4
8 votes, 29.6%
5

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


Member

Location: United States United States

Other popular Game Development articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 11 of 11 (Total in Forum: 11) (Refresh)FirstPrevNext
Generalgr8 Pinmembershine ms3:48 15 Nov '07  
Generalipnee Pinmembereraykaya20:04 16 Apr '07  
GeneralTransparent PictureBox possible? Pinsussgrayaii10:42 22 Jan '04  
GeneralWhere's the article? PinmemberPaul Evans1:46 6 Nov '03  
GeneralBomb Bug PinmemberSteve Miller9:15 3 Nov '03  
GeneralRe: Bomb Bug Pinmembersnorkie11:22 16 May '07  
GeneralI know my demo sucks :-D PinmemberRikaino9:37 26 Oct '03  
GeneralDo more with less PinmemberJerry Maguire7:01 26 Oct '03  
GeneralGameplay PinmemberGiles5:13 26 Oct '03  
GeneralManaged DirectX PineditorHeath Stewart3:11 26 Oct '03  
GeneralRe: Managed DirectX Pinmemberdog_spawn8:12 26 Oct '03  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 25 Oct 2003
Editor: Heath Stewart
Copyright 2003 by Rikaino
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project