Tuesday 6 December 2011

Week 16 - Bird Flying

Code to control your bird is below.  The bird must be saved as a movieClip symbol and the code is placed in the actions of the bird object:

onClipEvent (enterFrame) {
 if (Key.isDown(Key.LEFT)) {
  _x--;
 }
 if (Key.isDown(Key.RIGHT)) {
  _x++;
 }
 if (Key.isDown(Key.UP)) {
  _y--;
 }
 if (Key.isDown(Key.DOWN)) {
  _y++;
 }
}

No comments:

Post a Comment