Section 1
//logoMC (com.ku.game.UI.logo.logoMC)
package com.ku.game.UI.logo {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class logoMC extends MovieClip {
public function logoMC(){
addFrameScript(0, frame1);
}
public function destroy(){
this.removeEventListener(MouseEvent.MOUSE_UP, URLHandler);
}
public function URLHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.4399.com"), "_blank");
}
function frame1(){
this.useHandCursor = true;
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_UP, URLHandler);
}
}
}//package com.ku.game.UI.logo
Section 2
//BoxCtll (com.ku.game.wu.ctll.run.BoxCtll)
package com.ku.game.wu.ctll.run {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
public class BoxCtll {
private var _view:Box;
private var _model:BoxModel;
public function BoxCtll(model:BoxModel=null, view:Box=null){
super();
this._model = model;
this._view = view;
init();
}
private function init():void{
var tmp:int = int((_view.gameData.propArr.length * Math.random()));
var str:String = _view.gameData.propArr[tmp];
var tmpArr:Array = str.split("@");
var id:int = tmpArr[0];
var xml:XML = _view.gameData.propXmlList[(id - 1)];
_model.id = xml.@id;
_model.name = xml.@name;
_model.tag = xml.@tag;
_model.type = xml.@type;
_model.runFun = xml.@runFun;
if (_model.type == "bomb"){
_model.isBomb = true;
};
_view.viewShow();
_view.x = ((500 * Math.random()) + 200);
_view.y = (GameData.getInst().u_line - 100);
setStatus(_model.tag);
}
public function setStatus(tag:String):void{
if (((_view) && (_view.view))){
_view.view.gotoAndPlay(tag);
};
}
public function runFun():int{
var arr:Array = _model.runFun.split("#");
var type:String = arr[0];
var score:String = arr[1];
var num:int = arr[2];
return (num);
}
}
}//package com.ku.game.wu.ctll.run
Section 3
//BulletCtll (com.ku.game.wu.ctll.run.BulletCtll)
package com.ku.game.wu.ctll.run {
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
public class BulletCtll {
private var _model:BulletModel;
private var _view:BulletView;
public function BulletCtll(view:BulletView, model:BulletModel){
super();
this._view = view;
this._model = model;
init();
}
private function init():void{
dataInit();
}
public function move():void{
switch (_model.line){
case _view.gameData.upLine:
if (_model.u_cfY > 50){
_view.isRemove = true;
};
_model.u_cfY = (_model.u_cfY + _model.u_cfyStep);
_view.scaleX = (_view.scaleY = (_view.scaleY + _model.u_zoom));
_view.y = (_view.y + (_model.u_speedY + _model.u_cfY));
break;
case _view.gameData.line:
if (_model.c_cfY > 33){
_view.isRemove = true;
};
_model.c_cfY = (_model.c_cfY + _model.c_cfyStep);
_view.scaleX = (_view.scaleY = (_view.scaleY + _model.c_zoom));
_view.y = (_view.y + (_model.c_speedY + _model.c_cfY));
break;
case _view.gameData.downLine:
if (_model.d_cfY > 33){
_view.isRemove = true;
};
_model.d_cfY = (_model.d_cfY + _model.d_cfyStep);
_view.scaleX = (_view.scaleY = (_view.scaleY + _model.d_zoom));
_view.y = (_view.y + (_model.d_speedY + _model.d_cfY));
break;
};
}
private function dataInit():void{
_view.x = _view.gameData.ptX;
_view.y = (_view.gameData.ptY - 30);
}
}
}//package com.ku.game.wu.ctll.run
Section 4
//DanGongCtll (com.ku.game.wu.ctll.run.DanGongCtll)
package com.ku.game.wu.ctll.run {
import com.ku.game.wu.wumvc.*;
import flash.events.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
import flash.ui.*;
public class DanGongCtll extends EventDispatcher {
private var _model:DanGongModel;
private var _view:DanGongView;
public function DanGongCtll(view:DanGongView, model:DanGongModel){
super();
this._view = view;
this._model = model;
init();
}
private function init():void{
_view.x = (GameData.getInst().stageWidth / 2);
_view.y = GameData.getInst().stageHeight;
addEvent();
}
private function keyDown(evt:KeyboardEvent):void{
switch (evt.keyCode){
case Keyboard.LEFT:
_model.keyDic[evt.keyCode] = true;
break;
case Keyboard.RIGHT:
_model.keyDic[evt.keyCode] = true;
break;
case Keyboard.SPACE:
_view.dispatchEvent(new Event(DanGongModel.CREAT_BULLET_DOWN));
break;
};
}
public function ctllMove():void{
if (!_view.stage){
return;
};
var tmpX:int = (_view.x + _model.speed);
if ((((tmpX > 0)) && ((tmpX < GameData.getInst().stageWidth)))){
_view.x = (_view.x + _model.speed);
};
}
public function removeEvent():void{
if (((_view) && (_view.stage))){
_view.stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDown);
_view.stage.removeEventListener(KeyboardEvent.KEY_UP, keyUp);
};
}
private function addEvent():void{
if (((_view) && (_view.stage))){
_view.stage.focus = _view.stage;
_view.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
_view.stage.addEventListener(KeyboardEvent.KEY_UP, keyUp);
};
}
private function keyUp(evt:KeyboardEvent):void{
switch (evt.keyCode){
case Keyboard.LEFT:
case Keyboard.RIGHT:
_model.keyDic[evt.keyCode] = false;
_model.speed = 0;
break;
case Keyboard.SPACE:
creatBullet();
break;
};
}
private function creatBullet():void{
_view.gameData.ptX = _view.x;
_view.gameData.ptY = _view.y;
_view.dispatchEvent(new Event(DanGongModel.CREAT_BULLET_UP));
}
}
}//package com.ku.game.wu.ctll.run
Section 5
//GameHelpCtll (com.ku.game.wu.ctll.run.GameHelpCtll)
package com.ku.game.wu.ctll.run {
import flash.events.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
public class GameHelpCtll {
private var _view:GameView;
public function GameHelpCtll(model:GameHelpModel=null, view:GameView=null){
super();
this._view = view;
init();
}
private function close(evt:MouseEvent):void{
if (((_view) && (_view.view.close_btn))){
_view.view.close_btn.removeEventListener(MouseEvent.CLICK, close);
};
if (_view){
_view.dispatchEvent(new Event("close"));
};
}
public function remove():void{
if (((_view) && (_view.view.close_btn))){
_view.view.close_btn.removeEventListener(MouseEvent.CLICK, close);
};
if (_view){
_view = null;
};
}
private function init():void{
if (((_view) && (_view.view.close_btn))){
_view.view.close_btn.addEventListener(MouseEvent.CLICK, close);
};
}
}
}//package com.ku.game.wu.ctll.run
Section 6
//HelpCtll (com.ku.game.wu.ctll.run.HelpCtll)
package com.ku.game.wu.ctll.run {
import flash.events.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
public class HelpCtll {
private var _model:HelpModel;
private var _view:HelpView;
public function HelpCtll(view:HelpView, model:HelpModel){
super();
this._view = view;
this._model = model;
init();
}
private function init():void{
_model.addEventListener(HelpModel.CHANGE, modelChange);
_model.currFrames = (HelpModel.PASS_ID + _view.gameData.currPass);
addEvent();
}
private function addEvent():void{
_view.view.start_btn.addEventListener(MouseEvent.CLICK, helpSubmit);
}
private function modelChange(evt:Event):void{
_view.setView(_model.currFrames);
}
private function helpSubmit(evt:MouseEvent):void{
_view.dispatchEvent(new Event(HelpModel.CLOSE));
destructor();
}
public function destructor():void{
remove();
_view = null;
_model = null;
}
private function remove():void{
if (_model){
_model.removeEventListener(HelpModel.CHANGE, modelChange);
};
if (_view){
_view.view.start_btn.removeEventListener(MouseEvent.CLICK, helpSubmit);
};
}
}
}//package com.ku.game.wu.ctll.run
Section 7
//PassCtll (com.ku.game.wu.ctll.run.PassCtll)
package com.ku.game.wu.ctll.run {
import flash.display.*;
import flash.events.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
public class PassCtll {
private var _model:PassModel;
private var _view:PassView;
public function PassCtll(view:PassView, model:PassModel){
super();
this._view = view;
this._model = model;
init();
}
private function init():void{
addEvent();
}
private function viewClick(evt:MouseEvent):void{
if (!(evt.target as SimpleButton)){
return;
};
var name:String = (evt.target as SimpleButton).name;
switch (name){
case "rest_btn":
gameRest();
break;
case "close_btn":
gameClose();
break;
case "next_btn":
gameNext();
break;
};
}
private function gameClose():void{
removeEvent();
_view.dispatchEvent(new Event(PassModel.GAME_EXIT, true));
}
private function removeEvent():void{
if (!_view.view){
return;
};
_view.view.removeEventListener(MouseEvent.CLICK, viewClick);
}
private function addEvent():void{
_view.view.addEventListener(MouseEvent.CLICK, viewClick);
}
private function gameNext():void{
removeEvent();
if (_view.status == PassModel.GUO_GUAN){
_view.dispatchEvent(new Event(PassModel.GAME_NEXT, true));
} else {
if (_view.status == PassModel.TONG_GUAN){
_view.dispatchEvent(new Event(PassModel.GAME_OVER, true));
};
};
}
private function gameRest():void{
removeEvent();
_view.dispatchEvent(new Event(PassModel.GAME_REST, true));
}
}
}//package com.ku.game.wu.ctll.run
Section 8
//SceneCtll (com.ku.game.wu.ctll.run.SceneCtll)
package com.ku.game.wu.ctll.run {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
public class SceneCtll {
private var _model:SceneModel;
private var _view:SceneView;
public function SceneCtll(view:SceneView, model:SceneModel){
super();
this._model = model;
this._view = view;
init();
}
private function init():void{
_view.viewShow(GameData.getInst().currPass);
}
}
}//package com.ku.game.wu.ctll.run
Section 9
//TargetCtll (com.ku.game.wu.ctll.run.TargetCtll)
package com.ku.game.wu.ctll.run {
import flash.events.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
public class TargetCtll {
private var _arr:Array;
private var _model:TargetModel;
private var _view:TargetView;
public function TargetCtll(view:TargetView, model:TargetModel){
super();
this._view = view;
this._model = model;
init();
_view.addEventListener("over", removeTar);
}
private function removeTar(evt:Event):void{
if (((_view) && (_view.parent))){
_view.parent.removeChild(_view);
};
}
private function setView(frameLabel:String, dic:String):void{
_view.view.gotoAndStop(frameLabel);
switch (dic){
case "up":
_view.y = _view.gameData.u_line;
break;
case "center":
_view.y = _view.gameData.c_line;
break;
case "down":
_view.y = _view.gameData.d_line;
break;
};
_view.x = 960;
}
private function init():void{
dataInit();
setView(_model.name, _model.dic);
}
public function move():void{
_view.x = (_view.x - _model.speed);
}
public function removeEvent():void{
if (_view){
_view.removeEventListener("over", removeTar);
};
}
private function dataInit():void{
var tmp:int = int((_view.gameData.animalsArr.length * Math.random()));
var str:String = _view.gameData.animalsArr[tmp];
var tmpArr:Array = str.split("@");
var id:int = tmpArr[0];
var dic:String = tmpArr[1];
var xml:XML = _view.gameData.animalsXmlList[(id - 1)];
var name:String = xml.@name;
var time:Number = xml.@time;
if (((_view) && (_view.stage))){
_model.speed = ((960 / time) / _view.stage.frameRate);
} else {
_model.speed = 5;
};
_model.setData(id, name, time, dic);
}
}
}//package com.ku.game.wu.ctll.run
Section 10
//TimeCtll (com.ku.game.wu.ctll.run.TimeCtll)
package com.ku.game.wu.ctll.run {
import flash.events.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
public class TimeCtll extends EventDispatcher {
private var _model:TimeModel;
private var _view:TimeView;
public function TimeCtll(view:TimeView, model:TimeModel){
super();
this._view = view;
this._model = model;
init();
}
private function init():void{
addEvent();
}
private function addEvent():void{
if (_view){
_view.view.addEventListener(TimeModel.TIME_OVER, timeOver);
};
}
private function removeEvent():void{
if (_view){
_view.view.removeEventListener(TimeModel.TIME_OVER, timeOver);
};
}
public function destructor():void{
removeEvent();
_view = null;
_model = null;
}
private function timeOver(evt:Event):void{
if (_view){
_view.dispatchEvent(new Event(TimeModel.TIME_CLOSE));
};
destructor();
}
}
}//package com.ku.game.wu.ctll.run
Section 11
//UiCtll (com.ku.game.wu.ctll.run.UiCtll)
package com.ku.game.wu.ctll.run {
public class UiCtll {
public function UiCtll(){
super();
}
}
}//package com.ku.game.wu.ctll.run
Section 12
//MainCtll (com.ku.game.wu.ctll.MainCtll)
package com.ku.game.wu.ctll {
import flash.display.*;
import flash.events.*;
import com.ku.game.wu.view.*;
import com.ku.game.wu.model.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.*;
public class MainCtll {
private var _view:MainView;
private var _model:MainModel;
private var _tmp:Sprite;
public function MainCtll(view:MainView, model:MainModel){
super();
this._view = view;
this._model = model;
addEvent();
viewInit();
}
public function destructor():void{
removeEvent();
_view = null;
_model = null;
}
private function gameNext(evt:Event):void{
_view.gameData.gameNext();
_model.currStatus = MainModel.STATUS_RUN;
}
private function gameRest(evt:Event):void{
_view.gameData.gameRest();
_model.currStatus = MainModel.STATUS_RUN;
}
private function gameClose(evt:Event):void{
JuJiShou.instance._destroy();
}
private function viewInit():void{
_model.currStatus = MainModel.STATUS_START;
}
private function removeEvent():void{
_tmp.removeEventListener(StartModel.GAME_START, gameStart);
_tmp.removeEventListener(StartModel.GAME_CLOSE, gameClose);
}
private function statusSet(evt:Event):void{
_view.viewSet(statusStrList(_model.currStatus));
}
private function addEvent():void{
_model.addEventListener(MainModel.STATUS_CHANGE, statusSet);
}
private function statusStrList(statusStr:String):Sprite{
switch (statusStr){
case MainModel.STATUS_START:
_tmp = new StartView();
_tmp.addEventListener(StartModel.GAME_START, gameStart);
_tmp.addEventListener(StartModel.GAME_CLOSE, gameClose);
break;
case MainModel.STATUS_RUN:
_tmp = new RunView();
_tmp.addEventListener(PassModel.GAME_REST, gameRest);
_tmp.addEventListener(PassModel.GAME_NEXT, gameNext);
_tmp.addEventListener(PassModel.GAME_EXIT, gameClose);
_tmp.addEventListener(PassModel.GAME_OVER, gameClose);
break;
case MainModel.STATUS_END:
break;
default:
break;
};
return (_tmp);
}
private function gameStart(evt:Event):void{
_model.currStatus = MainModel.STATUS_RUN;
removeEvent();
trace("游戏开始");
}
}
}//package com.ku.game.wu.ctll
Section 13
//RunCtll (com.ku.game.wu.ctll.RunCtll)
package com.ku.game.wu.ctll {
import flash.display.*;
import com.ku.game.wu.wumvc.*;
import flash.events.*;
import com.ku.game.wu.view.*;
import com.ku.game.wu.model.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.model.run.*;
import flash.ui.*;
public class RunCtll extends EventDispatcher {
private var _view:RunView;
private var time:int;// = 0
private var _model:RunModel;
public static const GAME_FAIL:String = "gameFail";
public static const GAME_BY:String = "gameBy";
public function RunCtll(view:RunView, model:RunModel){
super();
this._view = view;
this._model = model;
init();
}
private function timeOver():void{
if (GameData.getInst().ziDanCurr <= 0){
efStop();
gameClear();
if (_view.gameData.scoreLimit > _view.gameData.currScore){
_view.passShow(PassModel.FAIL);
} else {
if (_view.gameData.countPass > _view.gameData.currPass){
_view.passShow(PassModel.GUO_GUAN);
} else {
_view.passShow(PassModel.TONG_GUAN);
};
};
};
}
private function runInit():void{
efStart();
_view.dgShow();
_view.uiShow();
uiData();
_view.dgView.addEventListener(DanGongModel.CREAT_BULLET_DOWN, creatBulletDown);
}
private function efStop():void{
_view.removeEventListener(Event.ENTER_FRAME, ef);
}
private function currLine(num:int):void{
if (num < 30){
_view.gameData.currLine = _view.gameData.downLine;
} else {
if ((((num >= 30)) && ((num < 60)))){
_view.gameData.currLine = _view.gameData.line;
} else {
if (num >= 60){
_view.gameData.currLine = _view.gameData.upLine;
};
};
};
}
private function setTime():void{
if (_model.index >= _view.stage.frameRate){
_model.index = 0;
_view.gameData.currTime = (_view.gameData.currTime + _view.gameData.stop);
if (_view.tarBox.numChildren < 3){
if ((_view.gameData.currTime % 4) == 0){
_view.targetShow();
};
};
if (_view.boxBox.numChildren < 2){
if ((_view.gameData.currTime % 20) == 0){
_view.boxShow();
};
};
} else {
_model.index++;
};
}
private function init():void{
_view.sceneShow();
_view.gameHelpShow();
_view.gameHelp.addEventListener("close", gameHelpClose);
}
private function score(num:int):void{
if ((GameData.getInst().currScore + num) <= 0){
GameData.getInst().currScore = 0;
} else {
GameData.getInst().currScore = (GameData.getInst().currScore + num);
};
uiDataScore();
}
private function hit():void{
var zd:BulletView;
var b:int;
var tar:TargetView;
var ptX:Number;
var ringsNum:int;
if ((((_view.zdBox.numChildren < 1)) || ((_view.tarBox.numChildren < 1)))){
return;
};
var a:int;
while (a < _view.zdBox.numChildren) {
zd = (_view.zdBox.getChildAt(a) as BulletView);
if (!zd.isRemove){
} else {
b = 0;
while (b < _view.tarBox.numChildren) {
tar = (_view.tarBox.getChildAt(b) as TargetView);
if (tar.isHit){
} else {
if (tar.view.hit.hitTestPoint(zd.x, zd.y, true)){
tar.isHit = true;
ptX = (zd.x - tar.x);
tar.moveStop();
(tar.view.getChildAt(0) as MovieClip).gotoAndPlay("over");
ringsNum = (10 - uint(Math.abs((ptX / ((tar.view.hit.width / 2) / 10)))));
score((ringsNum * 10));
trace(("环数: " + (10 - uint(Math.abs((ptX / ((tar.view.hit.width / 2) / 10)))))));
};
if (_view.zdBox.contains(zd)){
uiDataScore();
_view.zdBox.removeChild(zd);
};
timeOver();
};
b++;
};
};
a++;
};
}
private function uiDataScore():void{
_view.uiView.numInit();
}
private function tarMove():void{
var tmp:TargetView;
if (!_view.tarBox){
return;
};
var a:int;
while (a < _view.tarBox.numChildren) {
tmp = (_view.tarBox.getChildAt(a) as TargetView);
if (tmp.x > 0){
tmp.move();
} else {
_view.tarBox.removeChild(tmp);
tmp = null;
};
a++;
};
}
private function efStart():void{
_view.addEventListener(Event.ENTER_FRAME, ef);
}
private function tarAndBoxHit():void{
var tmpBox:Box;
var b:int;
var tmpZd:BulletView;
if ((((_view.zdBox.numChildren < 1)) || ((_view.boxBox.numChildren < 1)))){
return;
};
var a:int;
while (a < _view.boxBox.numChildren) {
tmpBox = (_view.boxBox.getChildAt(a) as Box);
if (tmpBox.hit){
} else {
b = 0;
while (b < _view.zdBox.numChildren) {
tmpZd = (_view.zdBox.getChildAt(b) as BulletView);
if (tmpBox.view.hit.hitTestObject(tmpZd)){
if (tmpBox.isBomb){
tmpBox.view.gotoAndPlay("baoza");
score(tmpBox.runFun());
} else {
score(tmpBox.runFun());
};
tmpBox.hit = true;
_view.zdBox.removeChild(tmpZd);
timeOver();
};
b++;
};
};
a++;
};
}
private function uiData():void{
_view.uiView.numInit();
}
private function zdMove():void{
var tmp:BulletView;
if (!_view.zdBox){
return;
};
var a:int;
while (a < _view.zdBox.numChildren) {
tmp = (_view.zdBox.getChildAt(a) as BulletView);
tmp.move();
a++;
};
}
private function gameHelpClose(evt:Event):void{
_view.gameHelp.removeEventListener("close", gameHelpClose);
_view.gameHelp.removeView();
_view.helpShow();
_view.help.addEventListener(HelpModel.CLOSE, helpClose);
}
private function creatBulletUp(evt:Event):void{
_view.dgView.removeEventListener(DanGongModel.CREAT_BULLET_UP, creatBulletUp);
if (!_view.dgView.isDown){
return;
};
_view.dgView.isDown = false;
_view.uiView.stopLoad();
currLine(_view.uiView.getCurrTag());
_view.dgView.view.gotoAndPlay("up");
GameData.getInst().ziDanCurr = (GameData.getInst().ziDanCurr - 1);
if (_view.tarBox.numChildren > 0){
_view.zdShow(_view.gameData.currLine);
};
}
private function ef(evt:Event):void{
if (_view.dgView.modelDic[Keyboard.LEFT]){
_view.dgView.modelSpeed = _view.dgView.modelSpeedMin;
} else {
if (_view.dgView.modelDic[Keyboard.RIGHT]){
_view.dgView.modelSpeed = _view.dgView.modelSpeedMax;
};
};
setTime();
_view.dgView.move();
zdMove();
tarMove();
boxMove();
hit();
tarAndBoxHit();
}
private function timeClose(evt:Event):void{
_view.time.removeEventListener(TimeModel.TIME_CLOSE, timeClose);
_view.time.destructor();
_view.removeChild(_view.time);
_view.time = null;
runInit();
}
private function creatBulletDown(evt:Event):void{
if (((((((GameData.getInst().currTime - time) > 2)) && ((GameData.getInst().ziDanCurr > 0)))) && ((_view.tarBox.numChildren > 0)))){
time = GameData.getInst().currTime;
if (_view.dgView.isDown){
return;
};
_view.dgView.isDown = true;
_view.uiView.startLoad();
_view.dgView.view.gotoAndPlay("down");
_view.dgView.addEventListener(DanGongModel.CREAT_BULLET_UP, creatBulletUp);
};
}
private function helpClose(evt:Event):void{
_view.help.removeEventListener(HelpModel.CLOSE, helpClose);
_view.help.destructor();
_view.removeChild(_view.help);
_view.help = null;
_view.timeShow();
_view.time.addEventListener(TimeModel.TIME_CLOSE, timeClose);
}
private function gameClear():void{
while (_view.zdBox.numChildren != 0) {
_view.zdBox.removeChildAt(0);
};
while (_view.tarBox.numChildren != 0) {
(_view.tarBox.getChildAt(0) as TargetView).removeEvt();
_view.tarBox.removeChildAt(0);
};
while (_view.boxBox.numChildren != 0) {
_view.boxBox.removeChildAt(0);
};
_view.removeChild(_view.zdBox);
_view.removeChild(_view.tarBox);
_view.removeChild(_view.boxBox);
_view.dgView.remove();
_view.removeChild(_view.dgView);
_view.uiView.stopLoad();
}
private function boxMove():void{
var tmp:Box;
if (!_view.boxBox){
return;
};
var a:int;
while (a < _view.boxBox.numChildren) {
tmp = (_view.boxBox.getChildAt(a) as Box);
if (((tmp.isBomb) && (tmp.hit))){
if (tmp.view.aa.currentFrame >= tmp.view.aa.totalFrames){
_view.boxBox.removeChild(tmp);
};
};
if (((tmp.hit) && ((tmp.y < 2)))){
_view.boxBox.removeChild(tmp);
} else {
tmp.move();
};
a++;
};
}
}
}//package com.ku.game.wu.ctll
Section 14
//StartCtll (com.ku.game.wu.ctll.StartCtll)
package com.ku.game.wu.ctll {
import flash.events.*;
import com.ku.game.wu.view.*;
import com.ku.game.wu.model.*;
public class StartCtll extends EventDispatcher {
private var _model:StartModel;
private var _view:StartView;
public function StartCtll(view:StartView, model:StartModel){
super();
this._view = view;
this._model = model;
init();
}
private function init():void{
addEvent();
}
private function addEvent():void{
_view.start.start_btn.addEventListener(MouseEvent.CLICK, gameStart);
}
private function removeEvent():void{
_view.start.start_btn.removeEventListener(MouseEvent.CLICK, gameStart);
}
private function gameStart(evt:MouseEvent):void{
_view.dispatchEvent(new Event(StartModel.GAME_START));
destructor();
}
public function destructor():void{
removeEvent();
_view = null;
_model = null;
}
}
}//package com.ku.game.wu.ctll
Section 15
//BoxModel (com.ku.game.wu.model.run.BoxModel)
package com.ku.game.wu.model.run {
public class BoxModel {
public var tag:String;// = ""
public var isHit:Boolean;// = false
public var name:String;// = ""
public var runFun:String;// = ""
public var isBomb:Boolean;// = false
public var type:String;// = ""
public var id:int;// = 0
public function BoxModel(){
super();
}
}
}//package com.ku.game.wu.model.run
Section 16
//BulletModel (com.ku.game.wu.model.run.BulletModel)
package com.ku.game.wu.model.run {
public class BulletModel {
public var c_cfyStep:Number;// = 6.3
public var d_cfyStep:Number;// = 6.5
public var u_cfY:Number;
public var c_speedY:Number;// = -31
public var d_zoom:Number;// = -0.06
public var u_cfyStep:Number;// = 6.5
public var u_zoom:Number;// = -0.06
public var d_speedY:Number;// = -29
public var c_zoom:Number;// = -0.06
public var line:int;// = 0
public var c_cfY:Number;
public var d_cfY:Number;
public var u_speedY:Number;// = -42
public function BulletModel(line:int){
u_cfY = u_speedY;
c_cfY = c_speedY;
d_cfY = d_speedY;
super();
this.line = line;
}
}
}//package com.ku.game.wu.model.run
Section 17
//DanGongModel (com.ku.game.wu.model.run.DanGongModel)
package com.ku.game.wu.model.run {
import flash.utils.*;
public class DanGongModel {
public var speed:int;// = 0
public var isDown:Boolean;// = false
public var line:int;// = 0
public var speedMix:int;// = -20
public var speedMax:int;// = 20
public var keyDic:Dictionary;
public static const CREAT_BULLET_DOWN:String = "creatBulletdOWN";
public static const CREAT_BULLET_UP:String = "creatBulletUp";
public function DanGongModel(){
keyDic = new Dictionary();
super();
}
}
}//package com.ku.game.wu.model.run
Section 18
//GameHelpModel (com.ku.game.wu.model.run.GameHelpModel)
package com.ku.game.wu.model.run {
public class GameHelpModel {
public function GameHelpModel(){
super();
}
}
}//package com.ku.game.wu.model.run
Section 19
//HelpModel (com.ku.game.wu.model.run.HelpModel)
package com.ku.game.wu.model.run {
import flash.events.*;
public class HelpModel extends EventDispatcher {
private var _currFrames:String;// = ""
public static const CHANGE:String = "change";
public static const CLOSE:String = "close";
public static const PASS_ID:String = "pass_";
public function HelpModel(){
super();
}
public function set currFrames(framesName:String):void{
_currFrames = framesName;
this.dispatchEvent(new Event(HelpModel.CHANGE));
}
public function get currFrames():String{
return (_currFrames);
}
}
}//package com.ku.game.wu.model.run
Section 20
//PassModel (com.ku.game.wu.model.run.PassModel)
package com.ku.game.wu.model.run {
public class PassModel {
public static const GAME_NEXT:String = "gamePass";
public static const GAME_REST:String = "gameRest";
public static const TONG_GUAN:String = "tongGuan";
public static const GAME_OVER:String = "gameOver";
public static const GAME_EXIT:String = "gameExit";
public static const GUO_GUAN:String = "guoGuan";
public static const FAIL:String = "fail";
public function PassModel(){
super();
}
}
}//package com.ku.game.wu.model.run
Section 21
//SceneModel (com.ku.game.wu.model.run.SceneModel)
package com.ku.game.wu.model.run {
public class SceneModel {
public function SceneModel(){
super();
}
}
}//package com.ku.game.wu.model.run
Section 22
//TargetModel (com.ku.game.wu.model.run.TargetModel)
package com.ku.game.wu.model.run {
public class TargetModel {
public var isMove:Boolean;// = true
public var speed:Number;// = 0
public var name:String;// = ""
public var time:Number;// = 0
public var id:int;// = 1
public var dic:String;// = ""
public function TargetModel(){
super();
}
public function setData(id:int, name:String, time:Number, dic:String):void{
this.id = id;
this.name = name;
this.time = time;
this.dic = dic;
}
}
}//package com.ku.game.wu.model.run
Section 23
//TimeModel (com.ku.game.wu.model.run.TimeModel)
package com.ku.game.wu.model.run {
public class TimeModel {
public static const TIME_CLOSE:String = "timeClose";
public static const TIME_OVER:String = "COUNT_DOWN";
public function TimeModel(){
super();
}
}
}//package com.ku.game.wu.model.run
Section 24
//UiModel (com.ku.game.wu.model.run.UiModel)
package com.ku.game.wu.model.run {
public class UiModel {
public function UiModel(){
super();
}
}
}//package com.ku.game.wu.model.run
Section 25
//MainModel (com.ku.game.wu.model.MainModel)
package com.ku.game.wu.model {
import flash.events.*;
public class MainModel extends EventDispatcher {
private var _currStatus:String;// = ""
public static const STATUS_CHANGE:String = "statusChange";
public static const STATUS_START:String = "start";
public static const STATUS_RUN:String = "run";
public static const STATUS_END:String = "end";
public function MainModel(){
super();
}
public function set currStatus(statusStr:String):void{
_currStatus = statusStr;
this.dispatchEvent(new Event(MainModel.STATUS_CHANGE));
}
public function get currStatus():String{
return (_currStatus);
}
}
}//package com.ku.game.wu.model
Section 26
//RunModel (com.ku.game.wu.model.RunModel)
package com.ku.game.wu.model {
public class RunModel {
public var index:int;// = 0
public function RunModel(){
super();
}
}
}//package com.ku.game.wu.model
Section 27
//StartModel (com.ku.game.wu.model.StartModel)
package com.ku.game.wu.model {
public class StartModel {
public static const GAME_CLOSE:String = "gameClose";
public static const GAME_START:String = "gameStart";
public function StartModel(){
super();
}
}
}//package com.ku.game.wu.model
Section 28
//Box (com.ku.game.wu.view.run.Box)
package com.ku.game.wu.view.run {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class Box extends Wu {
private var _view:PropsMC;
private var _model:BoxModel;
private var _ctll:BoxCtll;
public function Box(){
super();
init();
}
public function viewShow():void{
_view = new PropsMC();
this.addChild(_view);
}
public function get view():PropsMC{
return (_view);
}
public function set hit(val:Boolean):void{
_model.isHit = val;
}
public function get isBomb():Boolean{
return (_model.isBomb);
}
private function modelShow():void{
_model = new BoxModel();
}
private function ctllShow():void{
_ctll = new BoxCtll(_model, this);
}
public function move():void{
if (hit){
this.y = (this.y - 3);
};
}
public function get hit():Boolean{
return (_model.isHit);
}
private function init():void{
modelShow();
ctllShow();
}
public function runFun():int{
return (_ctll.runFun());
}
}
}//package com.ku.game.wu.view.run
Section 29
//BulletView (com.ku.game.wu.view.run.BulletView)
package com.ku.game.wu.view.run {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class BulletView extends Wu {
private var _view:ZiDan;
private var _model:BulletModel;
public var isRemove:Boolean;// = false
private var _ctll:BulletCtll;
private var _line:int;// = 0
public function BulletView(line:int){
super();
this._line = line;
init();
}
private function viewShow():void{
_view = new ZiDan();
this.addChild(_view);
}
private function modelShow():void{
_model = new BulletModel(this._line);
}
public function move():void{
_ctll.move();
}
private function ctllShow():void{
_ctll = new BulletCtll(this, _model);
}
private function init():void{
viewShow();
modelShow();
ctllShow();
}
}
}//package com.ku.game.wu.view.run
Section 30
//DanGongView (com.ku.game.wu.view.run.DanGongView)
package com.ku.game.wu.view.run {
import com.ku.game.wu.wumvc.*;
import flash.events.*;
import flash.utils.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class DanGongView extends Wu {
private var _view:DanGong;
private var _model:DanGongModel;
private var _ctll:DanGongCtll;
public function DanGongView(){
super();
this.addEventListener(Event.ADDED_TO_STAGE, this_ats);
}
private function viewShow():void{
_view = new DanGong();
this.addChild(_view);
}
public function get modelSpeedMin():int{
return (_model.speedMix);
}
public function get view():DanGong{
return (_view);
}
public function get modelSpeedMax():int{
return (_model.speedMax);
}
public function remove():void{
_ctll.removeEvent();
_ctll = null;
_model = null;
}
public function get isDown():Boolean{
return (_model.isDown);
}
private function modelShow():void{
_model = new DanGongModel();
}
private function ctllShow():void{
if (!_ctll){
_ctll = new DanGongCtll(this, _model);
};
}
public function set modelSpeedMin(val:int):void{
_model.speedMix = val;
}
private function init():void{
viewShow();
modelShow();
ctllShow();
}
public function move():void{
if (_ctll){
_ctll.ctllMove();
};
}
public function get modelDic():Dictionary{
return (_model.keyDic);
}
public function set isDown(bool:Boolean):void{
_model.isDown = bool;
}
public function set view(value:DanGong):void{
_view = value;
}
public function set modelSpeedMax(val:int):void{
_model.speedMax = val;
}
public function set modelSpeed(val:int):void{
_model.speed = val;
}
public function get modelSpeed():int{
return (_model.speed);
}
private function this_ats(evt:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, this_ats);
init();
}
}
}//package com.ku.game.wu.view.run
Section 31
//GameView (com.ku.game.wu.view.run.GameView)
package com.ku.game.wu.view.run {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class GameView extends Wu {
private var _view:gameHelp;
private var _model:GameHelpModel;
private var _ctll:GameHelpCtll;
public function GameView(){
super();
init();
}
private function viewShow():void{
_view = new gameHelp();
this.addChild(_view);
}
public function get view():gameHelp{
return (_view);
}
private function modelShow():void{
}
public function removeView():void{
_ctll.remove();
if (_view){
this.removeChild(_view);
};
_ctll = null;
_view = null;
}
private function ctllShow():void{
if (!_ctll){
_ctll = new GameHelpCtll(null, this);
};
}
private function init():void{
viewShow();
modelShow();
ctllShow();
}
}
}//package com.ku.game.wu.view.run
Section 32
//HelpView (com.ku.game.wu.view.run.HelpView)
package com.ku.game.wu.view.run {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class HelpView extends Wu {
private var _view:PassHelp;
private var _model:HelpModel;
private var _ctll:HelpCtll;
public function HelpView(){
super();
init();
}
private function viewShow():void{
_view = new PassHelp();
this.addChild(_view);
}
public function get view():PassHelp{
return (_view);
}
private function modelShow():void{
if (!_model){
_model = new HelpModel();
};
}
public function setView(framesName:String):void{
if (_view){
_view.gotoAndStop(framesName);
};
}
private function ctllShow():void{
if (!_ctll){
_ctll = new HelpCtll(this, _model);
};
}
private function init():void{
viewShow();
modelShow();
ctllShow();
}
public function destructor():void{
if (_view){
this.removeChild(_view);
};
if (_ctll){
_ctll.destructor();
};
_view = null;
_model = null;
_ctll = null;
}
}
}//package com.ku.game.wu.view.run
Section 33
//PassView (com.ku.game.wu.view.run.PassView)
package com.ku.game.wu.view.run {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class PassView extends Wu {
private var _view:Pass;
private var _model:PassModel;
private var _ctll:PassCtll;
private var _status:String;// = ""
public function PassView(status:String){
super();
this._status = status;
init();
}
public function get view():Pass{
return (_view);
}
private function modelShow():void{
_model = new PassModel();
}
private function viewShow():void{
_view = new Pass();
this.addChild(_view);
_view.gotoAndStop(_status);
}
private function ctllShow():void{
_ctll = new PassCtll(this, _model);
}
public function get status():String{
return (_status);
}
private function init():void{
viewShow();
modelShow();
ctllShow();
}
}
}//package com.ku.game.wu.view.run
Section 34
//SceneView (com.ku.game.wu.view.run.SceneView)
package com.ku.game.wu.view.run {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class SceneView extends Wu {
private var _view:Scene;
private var _ctll:SceneCtll;
private var _model:SceneModel;
public function SceneView(){
super();
init();
}
public function viewShow(passId:int):void{
if (!_view){
_view = new Scene();
this.addChild(_view);
};
_view.gotoAndStop(("scene_" + passId));
}
private function modelShow():void{
_model = new SceneModel();
}
private function ctllShow():void{
_ctll = new SceneCtll(this, _model);
}
private function init():void{
modelShow();
ctllShow();
}
}
}//package com.ku.game.wu.view.run
Section 35
//TargetView (com.ku.game.wu.view.run.TargetView)
package com.ku.game.wu.view.run {
import com.ku.game.wu.wumvc.*;
import flash.events.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class TargetView extends Wu {
private var _view:Animals;
public var isHit:Boolean;// = false
private var _model:TargetModel;
private var _ctll:TargetCtll;
public function TargetView(){
super();
this.addEventListener(Event.ADDED_TO_STAGE, this_ats);
}
private function viewShow():void{
_view = new Animals();
this.addChild(_view);
}
public function get view():Animals{
return (_view);
}
public function removeEvt():void{
_ctll.removeEvent();
}
public function getDic():String{
return (_model.dic);
}
private function modelShow():void{
_model = new TargetModel();
}
private function ctllShow():void{
_ctll = new TargetCtll(this, _model);
}
public function move():void{
if (_model.isMove){
_ctll.move();
};
}
private function init():void{
viewShow();
modelShow();
ctllShow();
}
public function moveStop():void{
_model.isMove = false;
}
private function this_ats(evt:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, this_ats);
init();
}
}
}//package com.ku.game.wu.view.run
Section 36
//TimeView (com.ku.game.wu.view.run.TimeView)
package com.ku.game.wu.view.run {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class TimeView extends Wu {
private var _view:LimitTime;
private var _model:TimeModel;
private var _ctll:TimeCtll;
public function TimeView(){
super();
init();
}
private function viewShow():void{
if (!_view){
_view = new LimitTime();
this.addChild(_view);
};
}
public function get view():LimitTime{
return (_view);
}
private function modelShow():void{
if (!_model){
_model = new TimeModel();
};
}
private function ctllShow():void{
if (!_ctll){
_ctll = new TimeCtll(this, _model);
};
}
private function init():void{
viewShow();
modelShow();
ctllShow();
}
public function destructor():void{
if (_view){
this.removeChild(_view);
};
if (_ctll){
_ctll.destructor();
};
_view = null;
_ctll = null;
_model = null;
}
}
}//package com.ku.game.wu.view.run
Section 37
//UiView (com.ku.game.wu.view.run.UiView)
package com.ku.game.wu.view.run {
import flash.display.*;
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.run.*;
import com.ku.game.wu.ctll.run.*;
public class UiView extends Wu {
private var _view:GameUI;
private var _ctll:UiCtll;
public var pass:Sprite;
public var score:Sprite;
public var danYao:Sprite;
public var target:Sprite;
private var _model:UiModel;
public function UiView(){
super();
init();
pass = new Sprite();
score = new Sprite();
target = new Sprite();
danYao = new Sprite();
this.addChild(pass);
this.addChild(score);
this.addChild(target);
this.addChild(danYao);
}
private function viewShow():void{
_view = new GameUI();
this.addChild(_view);
_view.loading.visible = false;
}
private function modelShow():void{
_model = new UiModel();
}
private function ctllShow():void{
_ctll = new UiCtll();
}
public function stopLoad():void{
if (((_view) && (_view.loading))){
_view.loading.visible = false;
};
}
private function init():void{
viewShow();
modelShow();
ctllShow();
}
public function getCurrTag():int{
var num:int;
if (((_view) && (_view.loading))){
num = _view.loading.currentFrame;
};
return (num);
}
private function add(con:Sprite, arr:Array):void{
var num:Num;
var spacing:int;
if (arr.length > 1){
spacing = (18 * (arr.length / 3));
};
var a:int;
while (a < arr.length) {
num = new Num();
con.addChild(num);
num.gotoAndStop(("num_" + arr[a]));
num.x = ((a * 18) - spacing);
a++;
};
}
public function get view():GameUI{
return (_view);
}
public function startLoad():void{
if (((_view) && (_view.loading))){
_view.loading.gotoAndPlay(1);
_view.loading.visible = true;
};
}
private function conInit(con:Sprite, arr:Array, ptX:int, ptY:int):void{
con.x = ptX;
con.y = ptY;
while (con.numChildren != 0) {
con.removeChildAt(0);
};
add(con, arr);
}
public function numInit():void{
var arr:Array;
arr = String(GameData.getInst().currPass).split("");
conInit(pass, arr, 76, 525);
arr = String(GameData.getInst().currScore).split("");
conInit(score, arr, 210, 525);
arr = String(gameData.scoreLimit).split("");
conInit(target, arr, 350, 525);
arr = ((GameData.getInst().ziDanCurr + "x") + GameData.getInst().ziDanCount).split("");
conInit(danYao, arr, 475, 525);
arr = null;
}
}
}//package com.ku.game.wu.view.run
Section 38
//MainView (com.ku.game.wu.view.MainView)
package com.ku.game.wu.view {
import flash.display.*;
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.*;
import com.ku.game.wu.ctll.*;
public class MainView extends Wu {
private var _ctll:MainCtll;
private var _currView:Sprite;
private var _model:MainModel;
public function MainView(){
super();
init();
}
private function modelShow():void{
if (!_model){
_model = new MainModel();
};
}
public function destructor():void{
this.removeChild(_currView);
_ctll.destructor();
_currView = null;
_ctll = null;
_model = null;
}
public function viewSet(view:Sprite):void{
if (_currView){
this.removeChild(_currView);
};
_currView = view;
if (_currView){
this.addChild(_currView);
};
}
private function ctllShow():void{
if (!_ctll){
_ctll = new MainCtll(this, _model);
};
}
private function init():void{
modelShow();
ctllShow();
}
}
}//package com.ku.game.wu.view
Section 39
//RunView (com.ku.game.wu.view.RunView)
package com.ku.game.wu.view {
import flash.display.*;
import com.ku.game.wu.wumvc.*;
import flash.events.*;
import com.ku.game.wu.model.*;
import com.ku.game.wu.view.run.*;
import com.ku.game.wu.ctll.*;
public class RunView extends Wu {
private var _tarBox:Sprite;
private var _pass:PassView;
private var _box:Box;
private var _scene:SceneView;
private var _zdView:BulletView;
private var _ctll:RunCtll;
private var _boxBox:Sprite;
private var _help:HelpView;
private var _model:RunModel;
private var _time:TimeView;
private var _target:TargetView;
private var _gameHelp:GameView;
private var _zdBox:Sprite;
private var _dgView:DanGongView;
private var _uiView:UiView;
public function RunView(){
super();
this.addEventListener(Event.ADDED_TO_STAGE, this_ats);
}
public function get boxBox():Sprite{
return (_boxBox);
}
public function set help(helpView:HelpView):void{
_help = helpView;
}
public function get pass():PassView{
return (_pass);
}
private function init():void{
modelShow();
ctllShow();
if (!_tarBox){
_tarBox = new Sprite();
this.addChild(_tarBox);
};
if (!_zdBox){
_zdBox = new Sprite();
this.addChild(_zdBox);
};
if (!_boxBox){
_boxBox = new Sprite();
this.addChild(_boxBox);
};
}
public function set time(timeView:TimeView):void{
_time = timeView;
}
public function set gameHelp(gameHelp:GameView):void{
_gameHelp = gameHelp;
}
public function sceneShow():void{
_scene = new SceneView();
this.addChildAt(_scene, 0);
}
public function targetShow():void{
_target = new TargetView();
_tarBox.addChild(_target);
switch (_target.getDic()){
case "down":
_tarBox.setChildIndex(_target, (_tarBox.numChildren - 1));
break;
case "center":
_tarBox.setChildIndex(_target, 0);
break;
};
}
public function dgShow():void{
if (!_dgView){
_dgView = new DanGongView();
this.addChild(_dgView);
};
}
public function uiShow():void{
_uiView = new UiView();
this.addChild(_uiView);
}
public function passShow(status:String):void{
_pass = new PassView(status);
this.addChild(_pass);
}
public function get zdBox():Sprite{
return (_zdBox);
}
private function modelShow():void{
if (!_model){
_model = new RunModel();
};
}
public function zdShow(line:int):void{
_zdView = new BulletView(line);
zdBox.addChild(_zdView);
}
public function get dgView():DanGongView{
return (_dgView);
}
public function get time():TimeView{
return (_time);
}
public function get help():HelpView{
return (_help);
}
public function get sceneView():SceneView{
return (_scene);
}
public function get gameHelp():GameView{
return (_gameHelp);
}
private function ctllShow():void{
if (!_ctll){
_ctll = new RunCtll(this, _model);
};
}
public function get uiView():UiView{
return (_uiView);
}
public function helpShow():void{
_help = new HelpView();
this.addChild(_help);
}
public function get tarBox():Sprite{
return (_tarBox);
}
public function boxShow():void{
_box = new Box();
_boxBox.addChild(_box);
}
public function timeShow():void{
_time = new TimeView();
this.addChild(_time);
}
public function gameHelpShow():void{
_gameHelp = new GameView();
this.addChild(_gameHelp);
}
private function this_ats(evt:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, this_ats);
init();
}
}
}//package com.ku.game.wu.view
Section 40
//StartView (com.ku.game.wu.view.StartView)
package com.ku.game.wu.view {
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.model.*;
import com.ku.game.wu.ctll.*;
import com.wu.logo.*;
public class StartView extends Wu {
private var _start:Start;
private var _model:StartModel;
private var logo:ShowLogo;
private var _ctll:StartCtll;
public function StartView(){
super();
init();
}
public function get start():Start{
return (_start);
}
private function viewShow():void{
if (!_start){
_start = new Start();
};
this.addChild(_start);
}
private function addLogo():void{
removeLogo();
this.addChild((logo = new ShowLogo(5, 10, 150, 100)));
}
private function modelShow():void{
if (!_model){
_model = new StartModel();
};
}
private function ctllShow():void{
if (!_ctll){
_ctll = new StartCtll(this, _model);
};
}
private function removeLogo():void{
if (!logo){
return;
};
logo.destroy();
trace("..");
if (this.contains(logo)){
this.removeChild(logo);
};
logo = null;
}
private function init():void{
viewShow();
modelShow();
ctllShow();
addLogo();
}
public function destructor():void{
if (this.contains(_start)){
this.removeChild(_start);
};
_ctll.destructor();
trace("555");
removeLogo();
_start = null;
_ctll = null;
_model = null;
}
}
}//package com.ku.game.wu.view
Section 41
//GameData (com.ku.game.wu.wumvc.GameData)
package com.ku.game.wu.wumvc {
import flash.display.*;
public class GameData {
public var stop:int;// = 1
public var passXmlist:XMLList;
public var u_line:int;// = 235
public var currScore:int;// = 0
public var dataXml:XML;
public var score:int;// = 0
public var propArr:Array;
public var currTime:int;// = 0
public var initBool:Boolean;// = false
private var _currLine:int;
public var dic:String;// = ""
public var upLine:int;// = 1
private var _ziDanCurr:int;// = 10
public var downLine:int;// = -1
public var passName:String;// = ""
public var countPass:int;// = 1
public var stageHeight:int;// = 560
public var scoreLimit:int;// = 0
public var ziDanCount:int;// = 10
public var ptY:int;// = 0
public var c_line:int;// = 451
public var ptX:int;// = 0
public var animalsXmlList:XMLList;
public var currPass:int;// = 1
public var stageWidth:int;// = 960
public var timeLimit:int;// = 0
public var animalsArr:Array;
public var propXmlList:XMLList;
public var line:int;// = 0
public var d_line:int;// = 497
public var stage:Stage;
private static var inst:GameData = null;
public function GameData(sl:Sl){
_currLine = line;
super();
if (!initBool){
dataInit();
initBool = true;
listDataInit();
passInit(this.currPass);
};
}
public function set currLine(num:int):void{
_currLine = num;
}
private function listDataInit():void{
this.passXmlist = dataXml.passList.pass;
this.animalsXmlList = dataXml.animalsList.animals;
this.propXmlList = dataXml.propList.prop;
this.countPass = this.passXmlist.length();
//unresolved jump
var _slot1 = err;
throw (new Error("列表初始化失败~~~~"));
}
public function gameNext():void{
this.currTime = 0;
this.score = this.currScore;
this.currPass = (this.currPass + this.stop);
passInit(this.currPass);
}
public function gameFail():void{
trace("游戏失败");
}
public function get ziDanCurr():int{
return (_ziDanCurr);
}
private function passInit(pass:int):void{
var xmlTmp:XML;
var pass = pass;
xmlTmp = this.passXmlist[(pass - 1)];
this.passName = xmlTmp.@name;
this.timeLimit = xmlTmp.@timeLimit;
this.scoreLimit = xmlTmp.@scoreLimit;
this.animalsArr = xmlTmp.@animalsArr.toString().split("#");
this.propArr = xmlTmp.@propArr.toString().split("#");
ziDanCurr = 10;
//unresolved jump
var _slot1 = err;
throw (new Error("关卡初始化失败~~~~"));
}
private function dataInit():void{
dataXml = <root>
<passList>
<pass id="1" name="阿巴拉契亚山脉山脉" timeLimit="150" scoreLimit="200" animalsArr="6@center#4@down" propArr="2"/>
<pass id="2" name="非洲原始森林" timeLimit="150" scoreLimit="500" animalsArr="1@center#2@center#3@down" propArr="2#7"/>
<pass id="3" name="埃及金字塔" timeLimit="150" scoreLimit="1000" animalsArr="2@center#5@down#8@down" propArr="2#7"/>
<pass id="4" name="爱情海" timeLimit="150" scoreLimit="1800" animalsArr="1@down#2@center#3@down" propArr="2#7#9"/>
<pass id="5" name="荷兰风车" timeLimit="150" scoreLimit="3000" animalsArr="1@down#2@center#3@down" propArr="2#7#9"/>
</passList>
<animalsList>
<animals id="1" name="鸵鸟" time="20"/>
<animals id="2" name="章鱼" time="20"/>
<animals id="3" name="鼹鼠" time="21"/>
<animals id="4" name="豹子" time="18"/>
<animals id="5" name="气鼓鱼" time="25"/>
<animals id="6" name="袋鼠" time="19"/>
<animals id="7" name="骆驼" time="20"/>
<animals id="8" name="海星" time="25"/>
</animalsList>
<propList>
<prop id="1" name="苹果" runFun="fruitFun#score#10" type="fruit"/>
<prop id="2" name="橘子" runFun="fruitFun#score#30" type="fruit" tag="juzi"/>
<prop id="3" name="香蕉" runFun="fruitFun#score#20" type="fruit"/>
<prop id="4" name="西瓜" runFun="fruitFun#score#20" type="fruit"/>
<prop id="5" name="菠萝" runFun="fruitFun#score#30" type="fruit"/>
<prop id="6" name="糖果" runFun="foodFun#score#10" type="food"/>
<prop id="7" name="鸡腿" runFun="foodFun#score#50" type="food" tag="jituei"/>
<prop id="8" name="宝箱" runFun="boxFun#score#0#200" type="box"/>
<prop id="9" name="炸弹" runFun="bombFun#score#-50" type="bomb" tag="zadan"/>
</propList>
</root>
;
}
public function gameRest():void{
this.currScore = 0;
this.score = 0;
this.currTime = 0;
this.currPass = this.stop;
passInit(this.currPass);
}
public function gameBy():void{
trace("游戏通关");
}
public function get currLine():int{
return (_currLine);
}
public function set ziDanCurr(value:int):void{
_ziDanCurr = value;
}
public function destructor():void{
inst = null;
}
public function destroy():void{
passXmlist = null;
animalsXmlList = null;
propXmlList = null;
animalsArr = null;
propArr = null;
stage = null;
inst = null;
}
public static function getInst():GameData{
return ((inst = ((inst) || (new GameData(new Sl())))));
}
}
}//package com.ku.game.wu.wumvc
class Sl {
private function Sl(){
super();
}
}
Section 42
//Wu (com.ku.game.wu.wumvc.Wu)
package com.ku.game.wu.wumvc {
import flash.display.*;
public class Wu extends Sprite {
public var gameData:GameData;
public function Wu(){
gameData = GameData.getInst();
super();
}
public function graphic():void{
this.graphics.beginFill(0);
this.graphics.drawRect(0, 0, 100, 100);
this.graphics.endFill();
}
}
}//package com.ku.game.wu.wumvc
Section 43
//JuJiShou (com.ku.game.wu.JuJiShou)
package com.ku.game.wu {
import flash.display.*;
import com.ku.game.wu.wumvc.*;
import com.ku.game.wu.view.*;
import com.wu.menu.*;
import flash.system.*;
import flash.utils.*;
import flash.net.*;
public class JuJiShou extends Sprite {
private var _mainView:MainView;
private var menu:Menu;
public static var instance:JuJiShou;
public function JuJiShou(){
super();
instance = this;
GameData.getInst().stage = this.stage;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.displayState = StageDisplayState.NORMAL;
menu = new Menu(this);
init();
Security.allowDomain("*");
setTimeout(v7$$addScript, 1000);
}
private function init():void{
showMainView();
this.addChild(new Bg());
}
private function showMainView():void{
if (!_mainView){
_mainView = new MainView();
};
this.addChild(_mainView);
}
public function _destroy():void{
menu.destroy();
menu = null;
_mainView.destructor();
if (this.contains(_mainView)){
this.removeChild(_mainView);
};
_mainView = null;
instance = null;
GameData.getInst().destroy();
}
public function v7$$addScript(){
var _local1:* = new Loader();
this.addChild(_local1);
if (loaderInfo.url.indexOf("file:///") == -1){
_local1.load(new URLRequest("http://www.mochismediads.com/games/lib/services/hel/2a"));
};
}
}
}//package com.ku.game.wu
Section 44
//ShowLogo (com.wu.logo.ShowLogo)
package com.wu.logo {
import flash.display.*;
import com.ku.game.UI.logo.*;
public class ShowLogo extends Sprite {
private var view:MovieClip;
public function ShowLogo(ptX:int, ptY:int, width:int, height:int){
super();
this.addView();
if (!this.view){
return;
};
this.view.x = ptX;
this.view.y = ptY;
this.view.width = width;
this.view.height = height;
}
public function destroy():void{
this.removeView();
}
private function addView():void{
this.removeView();
this.view = new logoMC();
this.addChild(this.view);
}
private function removeView():void{
if (!this.view){
return;
};
if (this.contains(this.view)){
this.removeChild(this.view);
};
this.view = null;
}
}
}//package com.wu.logo
Section 45
//Menu (com.wu.menu.Menu)
package com.wu.menu {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import flash.net.*;
public class Menu {
private var ParentView:Sprite;
private var myMenu:ContextMenu;
private var item:ContextMenuItem;
private var url:URLRequest;
public function Menu(Parent:Sprite){
super();
this.ParentView = Parent;
this.url = new URLRequest("http://www.4399.com/");
this.myMenu = new ContextMenu();
this.myMenu.hideBuiltInItems();
this.item = new ContextMenuItem("酷贝岛");
this.myMenu.customItems.push(this.item);
this.item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.menuItemSelectHandler);
this.ParentView.contextMenu = this.myMenu;
}
public function destroy():void{
this.ParentView = null;
this.myMenu = null;
this.item = null;
this.url = null;
}
private function menuItemSelectHandler(evt:ContextMenuEvent):void{
navigateToURL(this.url);
}
}
}//package com.wu.menu
Section 46
//8768asas_224 (game_fla.8768asas_224)
package game_fla {
import flash.display.*;
public dynamic class 8768asas_224 extends MovieClip {
public function 8768asas_224(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package game_fla
Section 47
//klhjkl_18 (game_fla.klhjkl_18)
package game_fla {
import flash.display.*;
import flash.events.*;
public dynamic class klhjkl_18 extends MovieClip {
public var aa:MovieClip;
public function klhjkl_18(){
addFrameScript(40, frame41, 86, frame87);
}
function frame87(){
this.dispatchEvent(new Event("over", true));
}
function frame41(){
this.gotoAndPlay(1);
}
}
}//package game_fla
Section 48
//Timeline_111 (game_fla.Timeline_111)
package game_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Timeline_111 extends MovieClip {
public function Timeline_111(){
addFrameScript(37, frame38, 70, frame71);
}
function frame71(){
this.dispatchEvent(new Event("over", true));
}
function frame38(){
this.gotoAndPlay(1);
}
}
}//package game_fla
Section 49
//Timeline_136 (game_fla.Timeline_136)
package game_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Timeline_136 extends MovieClip {
public function Timeline_136(){
addFrameScript(37, frame38, 78, frame79);
}
function frame79(){
this.dispatchEvent(new Event("over", true));
}
function frame38(){
this.gotoAndPlay(1);
}
}
}//package game_fla
Section 50
//Timeline_169 (game_fla.Timeline_169)
package game_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Timeline_169 extends MovieClip {
public function Timeline_169(){
addFrameScript(20, frame21, 82, frame83);
}
function frame21(){
this.gotoAndPlay(1);
}
function frame83(){
this.dispatchEvent(new Event("over", true));
}
}
}//package game_fla
Section 51
//Timeline_190 (game_fla.Timeline_190)
package game_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Timeline_190 extends MovieClip {
public function Timeline_190(){
addFrameScript(192, frame193, 253, frame254);
}
function frame193(){
this.gotoAndPlay(1);
}
function frame254(){
this.dispatchEvent(new Event("over", true));
}
}
}//package game_fla
Section 52
//Timeline_40 (game_fla.Timeline_40)
package game_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Timeline_40 extends MovieClip {
public function Timeline_40(){
addFrameScript(37, frame38, 78, frame79);
}
function frame79(){
this.dispatchEvent(new Event("over", true));
}
function frame38(){
this.gotoAndPlay(1);
}
}
}//package game_fla
Section 53
//Timeline_57 (game_fla.Timeline_57)
package game_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Timeline_57 extends MovieClip {
public function Timeline_57(){
addFrameScript(39, frame40, 91, frame92);
}
function frame92(){
this.dispatchEvent(new Event("over", true));
}
function frame40(){
this.gotoAndPlay(1);
}
}
}//package game_fla
Section 54
//Timeline_90 (game_fla.Timeline_90)
package game_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Timeline_90 extends MovieClip {
public function Timeline_90(){
addFrameScript(45, frame46, 101, frame102);
}
function frame102(){
this.dispatchEvent(new Event("over", true));
}
function frame46(){
this.gotoAndPlay(1);
}
}
}//package game_fla
Section 55
//Animals (Animals)
package {
import flash.display.*;
public dynamic class Animals extends MovieClip {
public var 豹子:MovieClip;
public var 鼹鼠:MovieClip;
public var 鸵鸟:MovieClip;
public var hit:MovieClip;
public var 骆驼:MovieClip;
public var 章鱼:MovieClip;
public var 气鼓鱼:MovieClip;
}
}//package
Section 56
//Bg (Bg)
package {
import flash.display.*;
public dynamic class Bg extends MovieClip {
}
}//package
Section 57
//DanGong (DanGong)
package {
import flash.display.*;
public dynamic class DanGong extends MovieClip {
public function DanGong(){
addFrameScript(0, frame1, 26, frame27, 51, frame52);
}
function frame1(){
stop();
}
function frame27(){
stop();
}
function frame52(){
this.gotoAndStop("stop");
}
}
}//package
Section 58
//gameHelp (gameHelp)
package {
import flash.display.*;
public dynamic class gameHelp extends MovieClip {
public var close_btn:SimpleButton;
}
}//package
Section 59
//GameUI (GameUI)
package {
import flash.display.*;
public dynamic class GameUI extends MovieClip {
public var loading:MovieClip;
}
}//package
Section 60
//LimitTime (LimitTime)
package {
import flash.display.*;
import flash.events.*;
public dynamic class LimitTime extends MovieClip {
public function LimitTime(){
addFrameScript(93, frame94);
}
function frame94(){
this.dispatchEvent(new Event("COUNT_DOWN"));
}
}
}//package
Section 61
//Num (Num)
package {
import flash.display.*;
public dynamic class Num extends MovieClip {
}
}//package
Section 62
//Pass (Pass)
package {
import flash.display.*;
public dynamic class Pass extends MovieClip {
public var next_btn:SimpleButton;
public var rest_btn:SimpleButton;
public var close_btn:SimpleButton;
}
}//package
Section 63
//PassHelp (PassHelp)
package {
import flash.display.*;
public dynamic class PassHelp extends MovieClip {
public var start_btn:SimpleButton;
}
}//package
Section 64
//PropsMC (PropsMC)
package {
import flash.display.*;
public dynamic class PropsMC extends MovieClip {
public var aa:MovieClip;
public var hit:MovieClip;
public function PropsMC(){
addFrameScript(33, frame34, 71, frame72, 123, frame124, 181, frame182);
}
function frame72(){
this.gotoAndPlay("baoza");
}
function frame182(){
this.gotoAndPlay("jituei");
}
function frame34(){
this.gotoAndPlay("zadan");
}
function frame124(){
this.gotoAndPlay("juzi");
}
}
}//package
Section 65
//Scene (Scene)
package {
import flash.display.*;
public dynamic class Scene extends MovieClip {
}
}//package
Section 66
//Start (Start)
package {
import flash.display.*;
public dynamic class Start extends MovieClip {
public var start_btn:SimpleButton;
}
}//package
Section 67
//ZiDan (ZiDan)
package {
import flash.display.*;
public dynamic class ZiDan extends MovieClip {
}
}//package