home *** CD-ROM | disk | FTP | other *** search
- function init()
- {
- this.WALL_LEFT = 10;
- this.WALL_RIGHT = 630;
- this.dx = 2;
- this.dy = 0;
- this.px = this._x;
- this.py = this._y;
- this.stat = "standby";
- _parent.neko_mc_list.push(this);
- this.floor_num = 0;
- }
- function main()
- {
- switch(this.stat)
- {
- case "run":
- this.run();
- break;
- case "fall":
- this.fall();
- break;
- case "death":
- this.death();
- }
- this._x = this.px;
- this._y = this.py;
- }
- function entryStartRun()
- {
- this.stat = "run";
- }
- function entryFall()
- {
- if(this.stat == "fall")
- {
- return undefined;
- }
- this.mc_g.gotoAndStop("fall");
- this.floor_num = this.floor_num + 1;
- this.stat = "fall";
- this.ground_y = 60 + this.floor_num * 80;
- }
- function entryDeath()
- {
- if(this.stat == "death")
- {
- return undefined;
- }
- this.stat = "death";
- this.mc_g.gotoAndStop("death");
- if(_root.game_mode == 1)
- {
- _root.neko = _root.neko - 1;
- _parent.neko_end_cnt = _parent.neko_end_cnt + 1;
- if(_root.neko == 0)
- {
- _root.gotoAndPlay("gameover");
- }
- }
- else if(_root.stat == "main")
- {
- _root.neko = _root.neko - 1;
- if(_root.neko == 0)
- {
- _root.gotoAndPlay("gameover");
- }
- else
- {
- _root.gotoAndPlay("miss");
- }
- }
- }
- function run()
- {
- this.px += this.dx;
- this.py += this.dy;
- if(this.px <= this.WALL_LEFT)
- {
- this.px = this.WALL_LEFT;
- this.dx = - this.dx;
- }
- if(this.px >= this.WALL_RIGHT)
- {
- this.px = this.WALL_RIGHT;
- this.dx = - this.dx;
- }
- if(this.dx > 0)
- {
- this._xscale = 100;
- }
- else
- {
- this._xscale = -100;
- }
- if(this.mc_hit.hitTest(_parent.mc_home.mc_hit))
- {
- this.stat = "goal";
- this.mc_g.gotoAndStop("goal");
- _parent.neko_end_cnt = _parent.neko_end_cnt + 1;
- _parent.neko_goal_cnt = _parent.neko_goal_cnt + 1;
- _parent.mc_home.entryMark(_parent.neko_goal_cnt);
- if(_root.game_mode == 1)
- {
- if(_parent.neko_end_cnt == 10)
- {
- _root.gotoAndPlay("stageclear");
- }
- }
- else if(_parent.neko_goal_cnt == 10)
- {
- _root.gotoAndPlay("stageclear");
- }
- }
- }
- function fall()
- {
- this.dy = this.dy + 1;
- this.px += this.dx / 2;
- this.py += this.dy;
- if(this.py >= this.ground_y)
- {
- this.py = this.ground_y;
- this.dy = 0;
- this.stat = "run";
- this.mc_g.gotoAndPlay("walk");
- }
- }
- function death()
- {
- this.mc_g.gotoAndStop("death");
- }
- this.init();
-