Saturday, April 10, 2010

Flash Snake Game Tutorial [Contents]

Introduction

The "snake game" (it has several names) is one of the simplest game concepts ever, and just like Tetris it's very addictive. There are a lot of variations of this game written in Flash, and this tutorial will explain one way to create it. It's a relatively easy game to code, but many fail to make sure that when keys are pressed in rapid succession they are all registered. This is necessary if you want to have full control of the snake at all times.

I will assume that you know at least some ActionScript. If you are a beginner some techniques are probably new. This tutorial will include storing information in a two dimensional array, the concept of a queue, using a key listener, attaching movie clips at run-time and some other things like the very useful modulo operator (%).

0 comments:

Post a Comment