• Advertisement

Archived

This topic is now archived and is closed to further replies.

Sharp Invader - Game made in C#

This topic is 5271 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is an arcade style space shooter which I made in C# using part Windows GDI and part GDI+. It's only the second game I've ever made and would appreciate some comments, suggestions, and criticism (I have tough skin, so don't be afraid to let loose). Not much else to say, except that you'll need the .NET runtime to play it (obviously). You can find it at http://www.microsoft.com/net/ - It's a 20 meg d/l, and I don't blame anyone who doesn't want to d/l it just to try out my game. Below is the readme.txt pasted, followed by a screenshot of the game and link to d/l game + source code. README.TXT:
-- ABOUT -- Sharp Invader was created by me, Dan Peverill. E-mail me at dan@danpeverill.com with any questions or comments that you may have. -- COMMANDS -- Up Arrow: Speed up. Down Arrow: Slow down. Right Arrow: Turn right. Left Arrow: Turn left. Spacebar: Fire missile. R: Turns radar on/off. C: Turns cloak on/off. Enter: Starts game or pauses/unpauses game. Q: Quits game if the game is paused. Esc: Exit game. -- SCORE -- Objects in the game give you points for destroying or collecting them, except for space stations. To get points for destroying a space station you'll need to collect the power up which was left behind after its destruction. Bonus points are awarded at the end of the game based on your overall performance. -- CLOAKING -- When you cloak, your power will start to drain quickly. When your power runs out, you will uncloak. -- SPACE STATIONS -- The game increases in level based on the level of the space stations that you destroy. But be warned, each station that reappears is significantly stronger then the last, and produces tougher enemies. -- POWER UPS -- On the left is the description of the powerup, on the right is what the power does. (Dropped by Space Stations) Red Static: Increases Shields and Power. (Dropped by Asteroids) Blinking Purple: Increases Shields. Blinking Pink: Increases Power. Circling Blue: Basic Missiles. Circling Yellow: Double Missiles. Circling Green: Homing Missiles. -- RADAR -- The radar shows a variety of things; Green: You. Yellow: Missile. Blue: Asteroid. Red: Enemy. Orange: Enemy space station.
SCREENSHOT: GAME + SOURCE CODE: http://www.danpeverill.com/SharpInvader.zip [edited by - wyrd on August 15, 2003 7:12:58 PM]

Share this post


Link to post
Share on other sites
Advertisement
Haven''t been able to download it, but judging by the screenshot it looks good, especially for a second game!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Nice game you''ve got!
care to share where you learn to make games in .NET?

Share this post


Link to post
Share on other sites
Hm. Do you use DirectX or is this done using GDI+? Just out of interest.

Nice to see people stariting to use the framework for such things :-) I am way too much into db stuff to find enough free time for something like this.

Share this post


Link to post
Share on other sites
quote:
Original post by wyrd
This is an arcade style space shooter which I made in C# using part Windows GDI and part GDI+.

Share this post


Link to post
Share on other sites
quote:
Original post by bjmumblingmiles
Why did you use part GDI in C# instead of full GDI+?

I''m sure the OP will tell you that GDI+ is slow...

Share this post


Link to post
Share on other sites
Wow, responses. I'm a little shocked considering that .NET isn't to popular around here.

quote:

Haven't been able to download it, but judging by the screenshot it looks good, especially for a second game!



Link should be working now though if it wasn't earlier.

quote:

Why did you use part GDI in C# instead of full GDI+?



The game was originally being built in GDI+, unfortunately it was to slow (and at the time it was just the map engine I had running, nothing else). I tried for a day to speed it up, but unfortunately I couldn't (even after consulting several other .NET programmers on the subject).

Eventually I decided to make a few wrapper classes of my own so I could use BitBlt for drawing, which is where the actual bottleneck was (Graphics.DrawImage is slower then snot, but the other drawing routines seem to be fine). Thanks to the way GDI+ is built, it made it quite easy and didn't take much time at all, and gave me a significant boost in the fps. The actual GDI wrapper classes are in the Source/GDI folder if you care.

Now with all the map tiles, particles, missiles, stars, effects and ships being drawn on the screen, the game runs at a steady ~34 fps on my machine (800mhz) with even over 500 objects flying around the screen at times.

I would use DirectX, but I don't know how yet. I might try out DirectX for my next game.

quote:

Nice game you've got!
care to share where you learn to make games in .NET?



I just learned on my own pretty much. I knew some of the basics about game loops and how to give images the illusion of movement, that was about it. Personally I'd just look at tutorials, books and games written in C/C++ and translate the code to .NET, it shouldn't be that difficult assuming you know both C/C++ and .NET.

quote:

I thought it was pretty cool. How about a fullscreen option?



Not really sure how to do fullscreen in GDI or GDI+, or do you mean the ability to increase the form size so the form takes up the whole screen?

Thanks for the responses all.

[edited by - wyrd on August 16, 2003 1:50:42 PM]

[edited by - wyrd on August 16, 2003 1:51:21 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Cool game! Hey wait a minute. Don''t you know you can''t make games with C#?!? The nerve!

Share this post


Link to post
Share on other sites
quote:
Original post by wyrd
Not really sure how to do fullscreen in GDI or GDI+, or do you mean the ability to increase the form size so the form takes up the whole screen?

Just use a maximized window without any window decorations(title bar etc).

Share this post


Link to post
Share on other sites
quote:
Original post by bjmumblingmiles
quote:
I''m sure the OP will tell you that GDI+ is slow...

So is GDI though! lol..its a lose lose kinda thing ;-)



Yeah but at least regular GDI allows hardware acceleration.

Anyway good job wyrd. I have a Managed C++ version of Asteroids that uses MDX somewhere around here if you want to see it.

Share this post


Link to post
Share on other sites

  • Advertisement