s=10;
blur=new flash.filters.BlurFilter(10,10,1);
_root.createEmptyMovieClip("char",1);
char.lineStyle(0,0x0,0);
char.beginFill(0x55575,100);
char.moveTo(200,200);
char.lineTo(200,250);
char.lineTo(250,250);
char.lineTo(250,200);
char.lineTo(200,200);
char.endFill();
blur=new flash.filters.BlurFilter(10,10,1)
_root.char.filters=[blur];
_root.createEmptyMovieClip("wall",2);
wall.lineStyle(0,0x000,0);
wall.beginFill(0x0,100);
wall.moveTo(-20,0);
wall.lineTo(-20,550);
wall.lineTo(100,550);
wall.lineTo(100,0);
wall.lineTo(-20,0);
wall.endFill();
_root.wall.filters=[blur];
_root.createEmptyMovieClip("wall2",3);
wall2.lineStyle(0,0x0,0);
wall2.beginFill(0x0,100);
wall2.moveTo(0,-20);
wall2.lineTo(0,550);
wall2.lineTo(120,550);
wall2.lineTo(120,-20);
wall2.lineTo(0,-20);
wall2.endFill();
_root.wall2.filters=[blur];
_root.createEmptyMovieClip("wall3",4);
wall3.lineStyle(0,0x0,0);
wall3.beginFill(0x0,100);
wall3.moveTo(0,350);
wall3.lineTo(0,420);
wall3.lineTo(550,420);
wall3.lineTo(550,350);
wall3.lineTo(0,350);
wall3.endFill();
_root.wall3.filters=[blur];
_root.createEmptyMovieClip("top",5);
top.lineStyle(0,0x0,100);
top.beginFill(0x0,100);
top.moveTo(0,-20);
top.lineTo(0,50);
top.lineTo(550,50);
top.lineTo(500,-20);
top.lineTo(0,-20);
top.endFill();
_root.top.filters=[blur];
_root.createEmptyMovieClip("enemy",6);
enemy.lineStyle(0,0x0,0);
enemy.beginFill(0x99999,100);
enemy.moveTo(200,200);
enemy.lineTo(200,250);
enemy.lineTo(250,250);
enemy.lineTo(250,200);
enemy.lineTo(200,200);
enemy.endFill();
_root.enemy._y=80;
_root.char._y=-80;
_root.enemy.filters=[blur];
health=100;
this.createTextField("health_txt", 7, 250, 100, 200, 400);
health_txt.multiline = false;
health_txt.embedFonts = false;
health_txt.selectable = false;
health_txt.variable = "health";
health_txt.setTextFormat(format);
onEnterFrame=function(){
_root.wall2._x=450;
if(Key.isDown(Key.RIGHT)){
_root.char._x+=s;
}
if(Key.isDown(Key.LEFT)){
_root.char._x-=s;
}
if(Key.isDown(Key.DOWN)){
_root.char._y+=s;
}
if(Key.isDown(Key.UP)){
_root.char._y-=s;
}
if(_root.char.hitTest(_root.wall)){
_root.char._x+=s;
}
if(_root.char.hitTest(_root.wall2)){
_root.char._x-=s;
}
if(_root.char.hitTest(_root.wall3)){
_root.char._y-=s;
}
if(_root.char.hitTest(_root.top)){
_root.char._y+=s;
}
if(_root.char._x<_root.enemy._x){
_root.enemy._x-=5;
}
if(_root.char._x>_root.enemy._x){
_root.enemy._x+=5;
}
if(_root.char._y<_root.enemy._y){
_root.enemy._y-=5;
}
if(_root.char._y>_root.enemy._y){
_root.enemy._y+=5;
}
if(_root.char.hitTest(_root.enemy)){
_root.char._alpha-=.5;
_root.health-=1;
}
if(_root.health<=0){
_root.char._alpha=0;
_root.enemy._alpha=0;
_root.health="Game Over";
}
}