stop();
var sp=7;
var grleft=0,grtop=40,grright=400,grbottom=300;
var score=0;
var intTime=90;
var laserNum=9;
var fruitNum=13;
function timer(){
intTime--;
if(intTime==0){
clearInterval(idTimer);
gotoAndStop("end",1);
}
txtTime.text=string(intTime);
}
_root.onEnterFrame =function(){
if(Key.isDown (Key.DOWN )){
if((zapper._y+sp)<(grbottom-zapper._height/2)){
zapper._y+=sp;
}else{
zapper._y=grbottom-zapper._height/2;
}
zapper._rotation=180;
}
if(Key,isDown(Key.UP)){
if((zapper._y-sp)>(grtop+zapper._height/2)){
}else{
zapper._y=grtop+zapper.height/2;
}
zapper._rotation=0;
if(Key.isDown(Key.LEFT)){
if((zapper._x-sp)>(grleft+zapper._width/2)){
zapper._x-=sp;
}else{
zapper._x=grleft+zapper._width/2;
}
zapper._rotation=270;
}
if(Key.isDown (Key.RIGHT )){
if((zapper._x+sp)<(grright-zapper._width/2)){
zapper._x+=sp;
}else{
zappper._x=grright-zapper.width/2;
}
zapper._rotation=90;
}
checkHit();
};
int();←← ←←←← ← ← ← ← ← ← ← 就这儿 一直说少个参数
function int(){
zapper._x=zapper.width/2;
zapper._y=zapper.height/2+40;
zapper._rotation=180;
for(i=1;i<=fruitNum;i++){
var theTmp=eval("f"+i);
theTmp.flag=false;
theTmp._visible=true;
}
txtTime.text=String(intTime);
intTime=90;
clearInterval(idTimer);
idTimer=setInterval(timer,1000);
}
function checkHit(){
for(i=1;i<=laserNum;i++){
var theBadMC=eval("p"+i);
if(zapper.hitTest(theBadMC)&&zapper._currentframe==1){
_root.onEnterFrame =null;
zapper.gotoAndPlay(7);
score-=100;
txtScore.text=score;
break;
}
}
for(i=1;i<=fruitNum;i++){
var theGoodMC=eval("f"+i);
if(zapper.hitTest(theGoodMC)&&theGoodMC.flag==false){
zapper.gotoAndPlay(2);
theGoodMC._visible=false;
theGoodMC.flag=true;
score+=100;
txtScore.text=score;
break;
}
}
}
zapper.onEnterFrame=function(){
if(this._currentframe==10){
clearInterval(idTimer);
idTimer=0;
gotoAndStop("end",1);
}
if(this._currentframe==5){
for(i=1;i<=fruitNum;i++){
var theGoodMC=eval("f"+i);
if(theGoodMC.flag==false){
break;
}
}
if(i>fruitNum){
clearInterval(idTimer);
gotoAndStop("end",1);
}
}
};
var sp=7;
var grleft=0,grtop=40,grright=400,grbottom=300;
var score=0;
var intTime=90;
var laserNum=9;
var fruitNum=13;
function timer(){
intTime--;
if(intTime==0){
clearInterval(idTimer);
gotoAndStop("end",1);
}
txtTime.text=string(intTime);
}
_root.onEnterFrame =function(){
if(Key.isDown (Key.DOWN )){
if((zapper._y+sp)<(grbottom-zapper._height/2)){
zapper._y+=sp;
}else{
zapper._y=grbottom-zapper._height/2;
}
zapper._rotation=180;
}
if(Key,isDown(Key.UP)){
if((zapper._y-sp)>(grtop+zapper._height/2)){
}else{
zapper._y=grtop+zapper.height/2;
}
zapper._rotation=0;
if(Key.isDown(Key.LEFT)){
if((zapper._x-sp)>(grleft+zapper._width/2)){
zapper._x-=sp;
}else{
zapper._x=grleft+zapper._width/2;
}
zapper._rotation=270;
}
if(Key.isDown (Key.RIGHT )){
if((zapper._x+sp)<(grright-zapper._width/2)){
zapper._x+=sp;
}else{
zappper._x=grright-zapper.width/2;
}
zapper._rotation=90;
}
checkHit();
};
int();←← ←←←← ← ← ← ← ← ← ← 就这儿 一直说少个参数
function int(){
zapper._x=zapper.width/2;
zapper._y=zapper.height/2+40;
zapper._rotation=180;
for(i=1;i<=fruitNum;i++){
var theTmp=eval("f"+i);
theTmp.flag=false;
theTmp._visible=true;
}
txtTime.text=String(intTime);
intTime=90;
clearInterval(idTimer);
idTimer=setInterval(timer,1000);
}
function checkHit(){
for(i=1;i<=laserNum;i++){
var theBadMC=eval("p"+i);
if(zapper.hitTest(theBadMC)&&zapper._currentframe==1){
_root.onEnterFrame =null;
zapper.gotoAndPlay(7);
score-=100;
txtScore.text=score;
break;
}
}
for(i=1;i<=fruitNum;i++){
var theGoodMC=eval("f"+i);
if(zapper.hitTest(theGoodMC)&&theGoodMC.flag==false){
zapper.gotoAndPlay(2);
theGoodMC._visible=false;
theGoodMC.flag=true;
score+=100;
txtScore.text=score;
break;
}
}
}
zapper.onEnterFrame=function(){
if(this._currentframe==10){
clearInterval(idTimer);
idTimer=0;
gotoAndStop("end",1);
}
if(this._currentframe==5){
for(i=1;i<=fruitNum;i++){
var theGoodMC=eval("f"+i);
if(theGoodMC.flag==false){
break;
}
}
if(i>fruitNum){
clearInterval(idTimer);
gotoAndStop("end",1);
}
}
};