Guest User

Untitled

a guest
Oct 18th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Ship extends MovieClip
  2. {
  3.     var velocity;
  4.    
  5.     function onLoad()
  6.     {
  7.         velocity = 10;
  8.     }
  9.    
  10.     function onEnterFrame()
  11.     {
  12.         if( Key.isDown(Key.RIGHT))
  13.         {
  14.             _x = _x + velocity;
  15.         }
  16.         if( Key.isDown(Key.LEFT))
  17.         {
  18.             _x = _x - velocity;
  19.         }
  20.         if(Key.isDown(Key.UP))
  21.         {
  22.             _y = _y - velocity;
  23.         }
  24.         if(Key.isDown(Key.DOWN))
  25.         {
  26.             _y = _y + velocity;
  27.         }
  28.     }
  29. }
Add Comment
Please, Sign In to add comment