private var mainFunc:Function;
function mainloop():void{ if(thisInvaderIsDeadFlag==true){ return; } if(areWeDyingFlag==true){ if(sprite.currentframe==endOfExplosionsFrame){ thisInvaderIsDeadFlag=true; } return; } moveInvader(); testForShootingAtPlayer(); testForBeingHitByPlayersBullet();}
mainFunc=mainloop_normal;function mainloop():void{ mainFunc();}function mainloop_normal():void{ moveInvader(); testForShootingAtPlayer(); testForBeingHitByPlayersBullet();}
function testForBeingHitByPlayersBullet():void{ if(playerBullet.hitTest(thisInvaderSprite)){ thisInvaderSprite.gotoAndPlay("firstExplodingFrame"); mainFunc=mainloop_waitingToDie; }}
function mainloop_waitingToDie():void{ if(sprite.currentframe==endOfExplosionsFrame){//Kill this invader totally, ie remove the mc mainFunc=null; }}
Remember Me
Powered by: newtelligence dasBlog 1.9.6264.0
Disclaimer The opinions expressed herein are our personal opinions and do not represent our customer's view in anyway.
© Copyright 2009, gaming your way
E-mail