Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Ship extends MovieClip
- {
- var velocity;
- function onLoad()
- {
- velocity = 10;
- }
- function onEnterFrame()
- {
- if( Key.isDown(Key.RIGHT))
- {
- _x = _x + velocity;
- }
- if( Key.isDown(Key.LEFT))
- {
- _x = _x - velocity;
- }
- if(Key.isDown(Key.UP))
- {
- _y = _y - velocity;
- }
- if(Key.isDown(Key.DOWN))
- {
- _y = _y + velocity;
- }
- }
- }
Add Comment
Please, Sign In to add comment