Snake: Flash game + tutorial


  • Currently 4.7/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 4.7/5 (38 votes)
| Comments (16) | Views (113)

Snake tutorialThis version of the classic game of Snake is remarkable in that it comes with source code and a complete tutorial explaining the code by its author, Strille of Sweden. Available on his website, the tutorial is a great way for anyone to get started programming games in Flash. The code is simple and straightforward for even a novice to understand, and it features an excellent design, as well as some very good examples of maintaining game state data in arrays.

The link to the game, also from Strille's website, is an enhanced version of the one featured in the tutorial. Included is a high score list with which you can view an instant replay of any of the games in the list. Simply click the "view" link next to the score you want to see the replay for. The enhanced version also features an instant replay of your own game once you finish. Kudos to Strille for both sharing his code, and for the excellent additions to this classic game. Click.

16 Comments

Strille has also written snake game in 746 bytes and tetris in 1kB, which are amazing.

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

i need some help
i'm a student
i need help me to gets code of snake and must using java programmig include Threads
thanks

Score: 0 (0 votes) Vote up Vote down Report this comment Reply
Matthew Huffaker May 17, 2005 8:18 PM

hi
my name is matthew huffaker and i am having truble writing a pregream and , it would be greatly appriciated if you could send me the code for the snake game for a visual Basic. That would be greatly Appriciated

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

hahahaha! Sure, I'll get right on that.

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

hey, ive been looking for source code of any simple game that requires control of the mouse of arrow keys. im really into trouble. if you could help me it would be a great help.
thanks!!!

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

this game is too tough.can't have my fingers right on the target..sighn

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

hi
i'm trying to build a game similar to snake and i understand a fair bit of actionscript but i was wondering if someone could fill me in on how to make a "hitTest" action to make the square move to a different location.
Thank You

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

Hi John,

hitTest is a method of a MovieClip that tests to see if two MCs are overlapping anywhere.

When you say you're looking for a "hitTest action" what exactly do you mean by that? Do you mean simply when hitTest returns true that you want to move the square (what square?) to a different location?

If so, then all you do is set the square's _x and _y properties, which describe where on the stage it is located.

For example:

if(myMovieClip.hitTest(mySquareMC)) {
  mySquareMC._x = someNewLocationX;
  mySquareMC._y = someNewLocationY;
}

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

Hi...i m a student i need to get the code 4 multi snake or if possible code 4 a snake that moves on voice commands.

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

Sir,

hai! iam yuva, iam interested in developing Flash games and webdesign. kindly send me some interested gaming with sourcefiles/tutorials

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

What are you all talking about codes? I don't get it there is like codes in every single game in this whole entire website. Can someone please explain to me about these codes and how you do them PLEASE!!!!!!!!

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

What I don't understand is that people sometimes spend hours playing this. I don't get that they can be so bored...

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

hi, i'm a begginer in Flash. i need help, pls can you help me arrange for an actionscript book - used one.
pls help me. pls, i beg you.
thank you and God bless.
francis

Score: 0 (0 votes) Vote up Vote down Report this comment Reply
Anonymous July 29, 2007 6:25 AM

it wont let me get on the game!! it just shows a little box thing up at the top left corner!!! HELP!!

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

I am having problems when I removed the movie clips. I made a new level but I can not attach or reduplicate the orignal movie clip
for (var i =0; i {
_root["movieclip" +i].removeMovieClip();
}
The fallowing scene says you have finish the first level. Next to continue
In the next level I want to update movie clips to more enemies, but however the movie clips donot show up.
_root.attachMovie("movieclip", "moviecli2",34)
gamer.

Score: 0 (0 votes) Vote up Vote down Report this comment Reply
Anonymous June 2, 2010 5:51 PM

Hi,
I'm Pierre and I have like 5 hours to make a snake game, I already have the full script and I'm using Macormedia Flash Professional 8 but I can't play the game with the script alone and I need help to make sure it works for tomorow.

Thanks
Pierre

Score: 0 (0 votes) Vote up Vote down Report this comment Reply

^ Scroll Up | Homepage >

Leave a comment [top of page]

    Please consider creating a Casual Gameplay account if you're a regular visitor here, as it will allow us to create an even better experience for you. Sign-up here!
  • PLEASE UNDERSTAND SITE POLICIES BEFORE POSTING COMMENTS
  • You may use limited HTML tags for style:
    (a href, b, br/, strong, em, ul, ol, li, code, spoiler)
    HTML tags begin with a less-than sign: < and end with a greater-than sign: >. Always. No exceptions.
  • To post spoilers, please use spoiler tags: <spoiler> example </spoiler>
    If you need help understanding spoiler tags, read the spoiler help.
  • Please Preview your comment before posting, especially when using spoilers!
  • No link dropping, no domains as names; do not spam, and do not advertise! (rel="nofollow" in use)
On the Edge of Earth: 5000> Tricky On the Edge of Earth: 5000 is a sci-fi adventure game by Roope Tamminen, originally developed for the Ludum Dare 48 game jam under the theme of "Connected Worlds". In it, you play as an astronaut attempting to terraform a world, using a whole bunch of sciencey stuff he doesn't quite remember how to use. While enjoyment will on the player's tolerance for tinkering, On the Edge of Earth: 5000 is a charming experience that rewards experimentation.  ...
1,663 Views
3 Comments
Hero and Daughter> Dora Tongue firmly planted in cheek and, um, assets spilling out all over the place, this dungeoncrawling RPG translated by vgperson and created by Tachi follows Ralph, a hero busted back down to level one, as he summons powerful female companions to help defeat the Dark Lord.  ...
Aries Escape: Episode No.14> elle While browsing a new display at the fine arts museum one day, you wind up trapped inside a strange exhibition. The artwork here is quite puzzling—literally. To escape these rooms, to even find the door, you need to collect clues and useful items, then use them to solve a series of puzzles.  ...
1,611 Views
14 Comments
Button Escape 24> Dora There are eleven buttons you need to find and click in order to escape from this challenge by Tototo Room, but first you need to get in touch with nature to solve the puzzles in your way...  ...

Recent Comments

 

Display 5 more comments
Limit to the last 5 comments

Casual game of the week

9 Clues: The Ward

Browser game of the week

On the Edge of Earth: 5000

Mobile game of the week

Twelve

Your Favorite Games edit

add
Save links to your favorite games here. Use the Favorites editor.

Popular on JiG


The Room

Virtual Villagers: Origins

Submachine 9: The Temple

Surgeon Simulator 2013

The House 2

Papa's pastaria

Fireboy and Watergirl 4: The Crystal Temple

Fireboy and Watergirl 3: The Ice Temple

Moonchild

The Royal Trap

Loren the Amazon Princess

1931: Scheherazade at the Library of Pergamum

Magical Diary

Heileen Series

Visit our great partner: maxcdn!

Monthly Archives

Legal notice

All games mentioned or hosted and images appearing on JayIsGames are Copyright their respective owner(s).

All other content is Copyright ©2003-2014 JayIsGames.com. All Rights Reserved.