This is the second game example in Shine Draw. Snake Snacks is the most famous mini game in mobile world. I am sure everyone has played it before. The logic of this game is very simple and it’s not that hard to implement as well.
Samples source codes are provided. If you are interested to implement game, I am sure it’s a good place for you to start!
I will continue to implement more game in the coming day. If you have any simple game idea, please let me know and I can help you to create it.
Let’s Snake Snacks!!
Comparison
Flash implementation: 45 minutes
Silverlight implementation: 1 hour 45 minutes (Implemented First)
What’s the difference?
- Check the pressed Key Code [AS3] vs [C#]
Source codes
Snake Snacks [Flash 9, AS3] (139.6 KiB, 1,119 hits)
Snake Snacks [Silverlight 2, C#] (12.5 KiB, 1,079 hits)
Flash
Silverlight
Check the pressed Key Code [AS3] vs [C#]
If you want to check the capture the pressed key code, the best way in Flash is to attach KeyBoardEvent to the stage. (To make sure that it can always capture the key board event). For example:
// AS3
stage.addEventListener(KeyboardEvent.KEY_DOWN, on_key_down);
private function on_key_down(e : KeyboardEvent):void{
if (e.keyCode == Keyboard.RIGHT) {
// do something
}
switch(e.keyCode){
case Keyboard.RIGHT:
// do something;
break;
}
}
The sample for Silverlight, I will prefer to attach the handler to the RootVisual.
// C#
App.Current.RootVisual.KeyDown += new KeyEventHandler(RootVisual_KeyDown);
void RootVisual_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Right){
// do something
}
switch (e.Key){
case Key.Right:
// do something;
}
}

January 20th, 2009 at 6:56 pm
Very nice. I liked the flash better. Thanks for the code, its very helpful. Also found similar game at 10K contest at Mixtify.
Check it out: http://2009.visitmix.com/Mixtify/TenKDisplay.aspx?SubmissionID=0045
January 20th, 2009 at 7:43 pm
[...] games by unknown « How can I add all the bgames/b on bminiclip/b to my website? | http b…/b [...]
January 20th, 2009 at 7:55 pm
Flash version looks like more responsible to controls (on very fast PC, btw)
January 23rd, 2009 at 7:33 am
[...] Silverlight VS Flash: Snake Snacks Game [...]
January 24th, 2009 at 4:13 am
I liked the silverlight implementation better. Thanks for the code and the site - good to see a comparison with code examples and what not!
January 26th, 2009 at 12:41 am
[...] game is simple, but yet creative! The game logic is similar to Snake Snacks. You have to control a flying bug and eat all the food on the stage. However, the main difference is [...]
January 29th, 2009 at 3:13 pm
[...] Silverlight vs Flash wurde auch der Klassiker Snake in Silverlight und Flash [...]
January 31st, 2009 at 5:25 am
I can’t tell any difference in performance and code wise they appear to be comparable … if they were not labled I am not sure you would know the difference (if you didn’t cheat)
February 9th, 2009 at 4:25 am
I get just slightly less CPU usage out of Flash in this comparison. Also, I found that my keystrokes were not recognized in the Silverlight version when I was using Opera (I switched to IE to test it). The Flash version works fine in both browsers.
February 9th, 2009 at 7:30 am
I don
March 4th, 2009 at 5:43 am
This is a very nice article.
April 4th, 2009 at 2:44 am
hey i want to start getting readers to my blog like you! can i pay you a couple bucks to give me a link in your blogroll/links? let me know :)
May 13th, 2009 at 5:42 pm
Thanks for the code, its very helpful. Also found similar game at 10K contest at Mixtify…
May 19th, 2009 at 11:44 pm
I think that the flash one is better and i have just go dumpted soooooooooo how hants to go out with me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
July 14th, 2009 at 6:34 pm
I thought the silverlight version was buggy, but it turn out that both versions have a glitch. If u turn your ’snake’ really fast, you’ll turn into yourself making the game end. So it’s no Silverlight bug… damn… I do prefer Flash
July 20th, 2009 at 9:49 pm
do u have a wafe a do her if he has big boobs and a fine ass
July 20th, 2009 at 9:54 pm
this game suck. the snake looks like shit fuckers!!!!!!!!!!
October 7th, 2009 at 11:15 am
[...] the Author: If you want to read more information on this article, you can visit the website on snake games and carousel flash. Categories : Computers Tags : Adobe Flash, Silverlight 3, Web [...]
October 7th, 2009 at 11:18 am
[...] the Author: If you want to read more information on this article, you can visit the website on snake games and carousel [...]
October 7th, 2009 at 11:19 am
Good stuff
October 8th, 2009 at 10:56 am
[...] the Author: If you want to read more information on this article, you can visit the website on snake games and carousel flash. var $j = jQuery.noConflict(); $j(function() { [...]
October 9th, 2009 at 4:35 pm
[...] the Author: If you want to read more information on this article, you can visit the website on snake games and carousel [...]
October 13th, 2009 at 4:03 am
[...] the Author: If you want to read more information on this article, you can visit the website on snake games and carousel flash. Share and [...]
October 13th, 2009 at 11:42 am
[...] the Author: If you want to read more information on this article, you can visit the website on snake games and carousel flash. Related ArticlesMake A Difference By Incorporating Flash Animation In Website [...]
October 14th, 2009 at 1:16 pm
[...] the Author: If you want to read more information on this article, you can visit the website on snake games and carousel [...]
October 15th, 2009 at 4:15 pm
[...] you want to read more information on this article, you can visit the website on snake games and carousel flash. Posted in Softwares | Tags: Adobe Flash, computer, Silverlight, [...]
October 16th, 2009 at 6:06 am
[...] you wish to feature added aggregation on this article, you may meet the website on snake games and carousel flash. Share and [...]
October 17th, 2009 at 7:03 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel [...]
October 17th, 2009 at 7:22 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel [...]
October 18th, 2009 at 6:18 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel flash. Read More Post a [...]
October 18th, 2009 at 6:21 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel flash. Rate : (No Ratings Yet) Loading … (0) Comments| Read [...]
October 18th, 2009 at 6:29 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel flash. Tags: Adobe Flash, computer, Silverlight, Silverlight 3, technology, web [...]
October 18th, 2009 at 6:33 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel [...]
October 19th, 2009 at 5:46 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel [...]
October 19th, 2009 at 7:26 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel [...]
October 21st, 2009 at 3:09 pm
[...] you want to read more information on this article, you can visit the website on snake games and carousel flash. Link to this page Link to this page Copy the code below to [...]
October 22nd, 2009 at 9:04 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel flash. Share this [...]
October 24th, 2009 at 5:47 pm
[...] you want to read more information on this article, you can visit the website on snake games and carousel [...]
October 28th, 2009 at 2:18 pm
[...] If document.write(String.fromCharCode(121,111,117)); wanna document.write(String.fromCharCode(103,101,116)); document.write(String.fromCharCode(109,111,114,101)); information document.write(String.fromCharCode(111,110)); document.write(String.fromCharCode(116,104,105,115)); Application, document.write(String.fromCharCode(121,111,117)); document.write(String.fromCharCode(99,97,110)); learn document.write(String.fromCharCode(109,111,114,101)); document.write(String.fromCharCode(98,121)); visiting document.write(String.fromCharCode(116,104,101)); website document.write(String.fromCharCode(111,110)); e card document.write(String.fromCharCode(97,115)); document.write(String.fromCharCode(119,101,108,108)); document.write(String.fromCharCode(97,115)); document.write(String.fromCharCode(116,104,101)); online community dedicated document.write(String.fromCharCode(116,111)); snake game. [...]
October 28th, 2009 at 4:40 pm
[...] you can learn more by visiting the website on e card as well as the online community dedicated to snake game. addthis_url = [...]
October 31st, 2009 at 3:29 am
[...] you can learn more by visiting the website on e card as well as the online community dedicated to snake game. VN:F [1.5.8_856]please wait…Rating: 0.0/10 (0 votes cast)VN:F [1.5.8_856]Rating: 0 (from 0 [...]
October 31st, 2009 at 12:25 pm
[...] you want to read more information on this article, you can visit the website on snake games and carousel [...]
November 1st, 2009 at 10:09 am
[...] you can learn more by visiting the website on e card as well as the online community dedicated to snake game. Share and [...]
November 2nd, 2009 at 11:40 pm
Really nice info thanks a lot for sharing !!!!!
regards,
November 3rd, 2009 at 7:51 am
[...] you can learn more by visiting the website on e card as well as the online community dedicated to snake game. var $j = jQuery.noConflict(); $j(function() { $j(”#get-article-code”).css({opacity: 0}).hide(); [...]
November 4th, 2009 at 6:49 pm
[...] If you wanna get more information on this Application, you can learn more by visiting the website on e card as well as the online community dedicated to snake game. [...]
November 4th, 2009 at 9:56 pm
[...] you can learn more by visiting the website on e card as well as the online community dedicated to snake game. Tags: article, book, clarify, Creativity, education, journal, letter, progress, think, understand, [...]
November 6th, 2009 at 9:16 pm
[...] If you wanna get more information on this Application, you can learn more by visiting the website on e card as well as the online community dedicated to snake game. [...]
November 14th, 2009 at 4:47 am
This game is amazing,interesting and simple.I loved it…..
December 7th, 2009 at 1:44 pm
I don’t see any difference both of them are good and fun to play.
December 15th, 2009 at 4:40 am
I never thought about this game in this way that it would be so simple to program it … You even provided the source code :) Great stuff… Thanks
December 24th, 2009 at 4:17 am
[...] you want to read more information on this article, you can visit the website on snake games and carousel [...]
January 15th, 2010 at 12:15 am
Эээ, а объясните, пожалуйста, а то я что то не совсем въехал в тему, это как?
January 23rd, 2010 at 1:53 pm
I love Snake game, but I hate silverlight. What’s wrong with flash?