Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.events.KeyboardEvent;
- import flash.display.Stage;
- /**
- * ...
- * @author MindGem
- */
- public class HeroClass extends Sprite
- {
- public var hero:Hero = new Hero();
- private var maxSpeed:Number = 5;
- public function HeroClass()
- {
- addChild(hero);
- hero.x = 250;
- hero.y = 250;
- hero.gotoAndStop(1);
- addEventListener(KeyboardEvent.KEY_DOWN, heroMovement);
- }
- public function heroMovement(e:KeyboardEvent):void
- {
- switch(e.keyCode)
- {
- case Keyboard.KEY_DOWN:
- trace("test");
- break;
- }
- }
Add Comment
Please, Sign In to add comment