home *** CD-ROM | disk | FTP | other *** search
- class fwg.Human
- {
- var kUp;
- var kDown;
- var kLeft;
- var kRight;
- var kA;
- var kB;
- static var aKey = new Array(87,83,65,68,74,75);
- function Human()
- {
- this.kUp = new Mkey(fwg.Human.aKey[0]);
- this.kDown = new Mkey(fwg.Human.aKey[1]);
- this.kLeft = new Mkey(fwg.Human.aKey[2]);
- this.kRight = new Mkey(fwg.Human.aKey[3]);
- this.kA = new Mkey(fwg.Human.aKey[4]);
- this.kB = new Mkey(fwg.Human.aKey[5]);
- this.setCtrl();
- }
- function move()
- {
- this.kLeft.move();
- this.kRight.move();
- this.kUp.move();
- this.kDown.move();
- this.kA.move();
- this.kB.move();
- }
- function setCtrl()
- {
- this.kUp.down = function()
- {
- Global.GAME.pKnight.jump();
- };
- this.kLeft.hold = function()
- {
- Global.GAME.pKnight.walk(-1);
- };
- this.kRight.hold = function()
- {
- Global.GAME.pKnight.walk(1);
- };
- this.kDown.down = function()
- {
- Global.GAME.pKnight.changeWeapon();
- };
- this.kA.down = function()
- {
- Global.GAME.pKnight.attack_0();
- };
- this.kB.down = function()
- {
- Global.GAME.pKnight.attack_2();
- };
- this.kRight.up = this.kLeft.up = function()
- {
- Global.GAME.pKnight.stand();
- };
- }
- }
-