#define functions
int main(){
int movex=getLocal("movex");
int movey=getLocal("movey");
int life=getLocal("life");
int explode=getLocal("explode");
int parent=getLocal("parent");
int damage=getLocal("damage");
explode(life,explode,parent);
setLocal("life",life+1);
if(damage==1){
while(getCollidedCount()>0){
int target=collidedWith();
string type=getLocal(target,"type");
if(type!="explode"&&type!="headmine"&&type!="mine"){
messageSprite(target,"damage",5);
}
nextCollided();
}
setLocal("damage",0);
}
}
int explode(int life,int explodestart,int parent){
if(life<explodestart+3){
setFrame(2);
}else if(life<explodestart+6){
setFrame(3);
}else if(life<explodestart+9){
setFrame(4);
}else if(life<explodestart+12){
setFrame(5);
}else if(life<explodestart+15){
setFrame(6);
}else if(life<explodestart+18){
setFrame(7);
}else if(life>explodestart+18){
destroySprite();
messageSprite(parent,"damagedone",0);
}
}