home *** CD-ROM | disk | FTP | other *** search
- stop();
- stopAllSounds();
- _root.level = 1;
- _root.score = 0;
- _root.enemy_num = 1;
- _root.item_num = 8;
- _root.count_num = 0;
- _root.menu_mc.life.gotoAndStop(1);
- _root.man2.gotoAndStop(7);
- _root.time_num = 0.05;
- _root.hurting = false;
- _root.sound_ok = true;
- FNstart = function()
- {
- _root.game_start = true;
- };
- FNchogi = function(mc)
- {
- mc.fall = 0;
- mc.downing = false;
- mc.speedX = 6;
- mc.speedY = 5;
- mc.stand = true;
- mc.gotoAndStop(1);
- mc.posY = _root.bg._y;
- mc.posY1 = _root.back._y;
- };
- FNchogi(_root.man);
- FNchogi2 = function(mc)
- {
- mc._visible = false;
- _root.man_alpha.gotoAndStop(1);
- _root.man2._visible = false;
- mc._xscale = 130;
- mc.gotoAndStop(1);
- };
- FNchogi3 = function(mc)
- {
- mc._visible = true;
- _root.man2._visible = true;
- mc._xscale = 130;
- mc.gotoAndStop(1);
- };
- FNscore = function(s, num)
- {
- var _loc2_ = 1;
- while(_loc2_ <= 5)
- {
- this.menu_mc[s + _loc2_].gotoAndStop(Math.floor(num / Math.pow(10,_loc2_ - 1)) % 10 + 1);
- _loc2_ = _loc2_ + 1;
- }
- };
- FNscore("l",_root.level);
- FNscore("s",_root.score);
- FNitem = function()
- {
- var _loc2_ = 1;
- while(_loc2_ <= _root.item_num)
- {
- _root.back["o" + _loc2_].gotoAndStop(random(6) + 2);
- _loc2_ = _loc2_ + 1;
- }
- };
- FNitem();
- FNright = function(mc, speed)
- {
- if(mc.stand)
- {
- mc.gotoAndStop("walking");
- }
- else
- {
- mc.gotoAndStop("fly_walking");
- }
- if(_root.bg2.hitTest(mc._x + speed,mc._y,true) == false && _root.bg.hit.hitTest(mc._x + speed + 20,mc._y,true) == false)
- {
- mc._x += speed;
- }
- };
- FNleft = function(mc, speed)
- {
- if(mc.stand)
- {
- mc.gotoAndStop("walking");
- }
- else
- {
- mc.gotoAndStop("fly_walking");
- }
- if(_root.bg2.hitTest(mc._x - speed,mc._y,true) == false && _root.bg.hit.hitTest(mc._x - speed - 20,mc._y,true) == false)
- {
- mc._x -= speed;
- }
- };
- FNup = function(mc, speed, mc1)
- {
- if(mc.stand)
- {
- mc.stand = false;
- mc.downing = false;
- mc.gotoAndStop("fly");
- }
- mc.fall = 0;
- if(_root.bg.hit.hitTest(mc._x,mc._y - speed,true) == false)
- {
- if(mc._y > 250)
- {
- mc._y -= speed;
- }
- else if(_root.bg._y > 950)
- {
- if(mc._y > 60)
- {
- mc._y -= speed;
- }
- }
- else
- {
- _root.bg._y += speed;
- _root.back._y += speed;
- }
- }
- if(mc.mc_in.bubble._currentframe < 11)
- {
- mc.mc_in.bubble.play();
- mc1.mc_in.bubble.play();
- }
- else if(mc.mc_in.bubble._currentframe > 11)
- {
- mc.mc_in.bubble.gotoAndPlay(21 - (mc.mc_in.bubble._currentframe - 1));
- mc1.mc_in.bubble.gotoAndPlay(21 - (mc1.mc_in.bubble._currentframe - 1));
- }
- };
- FNdown = function(mc, speed, mc1)
- {
- if(_root.bg.hit.hitTest(mc._x,mc._y + mc.fall + speed,true))
- {
- mc.stand = true;
- mc.downing = false;
- mc.fall = 0;
- }
- else
- {
- mc.downing = true;
- if(mc._y > 230 && mc._y < 250)
- {
- if(_root.back._y > mc.posY1)
- {
- _root.bg._y -= mc.fall;
- _root.bg._y -= speed;
- _root.back._y -= mc.fall;
- _root.back._y -= speed;
- }
- else
- {
- _root.back._y = mc.posY1;
- _root.bg._y = mc.posY;
- mc._y += mc.fall;
- mc._y += speed;
- }
- }
- else if(mc._y < 230)
- {
- mc._y += mc.fall;
- mc._y += speed;
- }
- else
- {
- mc._y += mc.fall;
- mc._y += speed;
- }
- if(mc.fall == 0)
- {
- mc.mc_in.bubble.gotoAndPlay(11 + (11 - mc.mc_in.bubble._currentframe));
- mc1.mc_in.bubble.gotoAndPlay(11 + (11 - mc1.mc_in.bubble._currentframe));
- }
- mc.fall += 0.5;
- }
- };
- FNgoal = function(mc, mc1)
- {
- if(mc.hit.hitTest(mc1) && mc1._currentframe == 2 && mc.stand)
- {
- _root.game_start = false;
- _root.FNchogi2(_root.man);
- mc1.gotoAndStop("into");
- }
- };
- FNstay = function(mc, speed)
- {
- if(_root.hurting == false)
- {
- if(mc.stand)
- {
- mc.gotoAndStop("stay");
- }
- else
- {
- mc.gotoAndStop("fly");
- }
- }
- };
- FNeat = function(mc)
- {
- var _loc2_ = 1;
- while(_loc2_ <= item_num)
- {
- if(mc.hit.hitTest(_root.back["o" + _loc2_]) && _root.back["o" + _loc2_]._currentframe != 8)
- {
- _root.count_num = _root.count_num + 1;
- _root.back["o" + _loc2_].gotoAndStop("ok");
- }
- _loc2_ = _loc2_ + 1;
- }
- if(_root.count_num == item_num && _root.back.door._currentframe == 1)
- {
- _root.back.door.gotoAndStop(2);
- }
- };
- FNhurt = function(mc, mc1)
- {
- var _loc2_ = 1;
- while(_loc2_ <= enemy_num)
- {
- if(mc.hit.hitTest(_root.back["enemy" + _loc2_].hit) && mc._currentframe != 5 && _root.hurting == false)
- {
- _root.hurting = true;
- mc.gotoAndStop("hurt");
- mc1.gotoAndStop(5);
- _root.game_start = false;
- }
- if(mc.hit.hitTest(_root.back["enemy" + _loc2_].rec) && mc._currentframe != 5)
- {
- trace("부딪히다");
- _root.back["enemy" + _loc2_].gotoAndPlay("stop");
- }
- _loc2_ = _loc2_ + 1;
- }
- };
- this.onEnterFrame = function()
- {
- if(_root.game_start)
- {
- _root.menu_mc.time_bar.bar._xscale -= _root.time_num;
- if(_root.menu_mc.time_bar.bar._xscale <= 0)
- {
- _root.menu_mc.life.nextFrame();
- if(_root.menu_mc.life._currentframe != 4)
- {
- _root.menu_mc.time_bar.bar._xscale = 100;
- }
- else
- {
- _root.menu_mc.time_bar.bar._xscale = 0;
- }
- }
- _root.man2._x = _root.man._x + 20;
- _root.man2._y = _root.man._y - 2;
- _root.man2.gotoAndStop(_root.man._currentframe);
- current = _root.man.mc_in.bubble._currentframe;
- if(Key.isDown(37))
- {
- FNleft(_root.man,_root.man.speedX);
- _root.man._xscale = 130;
- _root.man2._xscale = _root.man._xscale + 30;
- }
- if(Key.isDown(39))
- {
- FNright(_root.man,_root.man.speedX);
- _root.man._xscale = -130;
- _root.man2._xscale = _root.man._xscale - 30;
- }
- if(Key.isDown(32))
- {
- if(sound_ok)
- {
- sound4.start();
- }
- sound_ok = false;
- FNup(_root.man,_root.man.speedY,_root.man2);
- }
- else
- {
- sound_ok = true;
- FNdown(_root.man,_root.man.speedY,_root.man2);
- }
- if(Key.isDown(39) == false && Key.isDown(37) == false)
- {
- FNstay(_root.man,_root.man.speedY);
- }
- if(Key.isDown(38))
- {
- FNgoal(_root.man,_root.back.door);
- }
- FNeat(_root.man);
- FNhurt(_root.man,_root.man2);
- }
- };
-