Play classic snake with your joystick – .NET (C#) Source Code
Last month, I decided to learn .NET. A few classes later, I had started coding simple Windows applications. In my VB6 days, I was obsessed with coding a Snake game and had actually succeeded in it (but it looked so ugly that my friends still laugh about it after 5 years!). I’ve been learning C# on .NET all this month and picked up the basics pretty quickly. I came across free source code for a Snake game – complete with a high scores function. A few days after taking up the course, we guys brought a kudhoogala kuchi to play NFS Carbon. Then hit the idea truck.
Once again I looked around the interwebs for a C# joystick class and I found one on CodeProject. So I sat down with putting these two solutions into one. All the code used was released under GPL or BSD (or some kind of DWTFYW license) and the original authors have been credited. You could download and test run the game on your Windows machine. It only requires the .NET framework to be installed on your machine. Chances are, you already have it. I’ve also included my source code. It is compatible only with Visual Studio 2008.

Here’s the usual screenshot tour of the game’s features. Please help me test the game. Mail me any bug/crash reports. And you could always use the comments section to add your ideas, suggestions and criticisms. I’ll be more than happy to add suggested features and distribute the game for free.
Download jSnake (requires .NET Framework)
jSnake Source Code (.NET C#)
You might also want to try the original keyboard version – Download Snake Source Code.
If you're new here, you may want to subscribe to my RSS feed or my SMS feed. Thanks for visiting!
Possibly Related Posts
- One-click switching to any DNS provider of your choice
- Safely switch to Google Public DNS for a faster internet experience
Tagged as code, download, game + Categorized under Technology, .NET | »







The program is crashing in my system without getting opened (have you handled all the exceptions?!). I’m having .NET 3.5 and 2.0.
Looks good (from screen shots). Here are my suggestions -
You wrap it in a setup which looks for the .NET framework and if it is missing it’ll do the rest. I think those kind of setup templates are available in web.
As usual you can add levels with increased obstacles and speed.
You can also make your game look flashy by replacing the rectangular boxes with a snake image.
Good work!
@nlvraghavendra: Yeah I did! Can you send me a screenshot of the error? Yeah and I thought of publishing an installer, but only after ironing out all these problems. I was afraid no one would comment on this. At least one soul did
Nothing strange. Same old “The program has encountered the problem and needs to close” which will request to send the error to MSFT. Mostly this will occur when a dependency is missing or when an unhandled exception sneaks through. Deploy it some other environment and test it out.
Here is the screen shot of the error. Even if the framework is missing it throws the same error
. Let me check it out.
@nlvraghavendra: Hmm.. I did try it out on a friend’s XP machine too and it worked flawlessly! You sure the JoystickInterface.dll file is in the same folder as the game’s EXE?
@Pras: Ha ha! Of course.
The setup you gave me worked great!
@nlvraghavendra: Great then! I’ve updated the post with the link to the installer
Hello, Could you send me the source to [e-mail removed]
But without the joystick, i only want that the snake runs.
It would be awesome! i need it like in 10 hours. Please could you send it?
I would even pay you on paypal for it.
Thank you!
@Pajoo: Here’s the link for the original keyboard version – http://www.publicjoe.f9.co.uk/csharp/apps/csc-snake.html
Thanks allot!!! how can i make it up to you?
dude you saved me!!!!
AGAIN THANKS!!!!!!
when I run the game, send me an exception “Application.Run (new snakeForm ());”: FileNotFoundException
I use visual studio 2008 pro
@Jose: Is Framework 3.5 SP1 installed?
no, I didnt.

i´ve already installed and it works
thanks
Hey, i know i may not ask you this but i really need it..
Do you maybe have a simple made snake game?
just so simple that it looks like a beginner made it.
Please you would help me realy out!
thanks!
Hey i have another request, if you can help me!
I need another snake because me teacher said he didnt believe i made it and he was correct haha
Do you maybe have a simple made snake in C# so he believes i made it?
Ill pay you on paypal $10!
Thanks!
@Pajoo: I’d suggest you better learn it yourself. That will help you in the long run (and also save you your money)