Snake Flash Game

5. February 2011

 

 

One of my first attempts at AS3, so keep that in mind…

 

This game was originally developed in AS2.  I converted it to AS3 in Flash CS4.

Conversion details:

  1. Changed to MovieClip class from Action
  2. Used an Array for the snake body instead of eval
  3. Added KeyboardEvents and stored the current key state in an Array
  4. As frame is processed (in Event.ENTER_FRAME) look up current key state to find direction
  5. Use hitTestObject() to determine if snake's head is touching mouse


 

 

  By John Dorsey  IT Brigade Inc.           

Flash , , , ,