Demo entry 6687365

2d

   

Submitted by anonymous on Dec 28, 2017 at 09:35
Language: JavaScript. Code size: 66.0 kB.

<html>
<head>
	<title>2D Game</title>

<style>
	.stickman_stop{
		position: absolute;
		left:10px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;

	}
	.stickman_run_right{
		position: absolute;
		left:10px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.stickman_run_left{
		position: absolute;
		left:10px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.stickman_jump_right{
		position: absolute;
		left:10px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.stickman_jump_left{
		position: absolute;
		left:10px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.stickman_shooting_right{
		position: absolute;
		left:10px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.stickman_shooting_left{
		position: absolute;
		left:10px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.fire_right1{  /*7*/
		position: absolute;
		left:30px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.fire_left1{ /*8*/
		position: absolute;
		left:30px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.block1{
		position: absolute;
		left:1240px;
		top:2930px;
	}
	.block2{
		position: absolute;
		left:400px;
		top:2810px;
	}
	.block3{
		position: absolute;
		left:100px;
		top:2610px;
	}
	.block4_1{
		position: absolute;
		left:650px;
		top:2510px;
	}
	.block4_2{
		position: absolute;
		left:720px;
		top:2510px;
	}
	.block5{
		position: absolute;
		left:1100px;
		top:2410px;
	}
	.block6_1{
		position: absolute;
		left:650px;
		top:2210px;
	}
	.block6_2{
		position: absolute;
		left:710px;
		top:2210px;
	}
	.block7{
		position: absolute;
		left:100px;
		top:2210px;
	}
	.block8{
		position: absolute;
		left:340px;
		top:2009px;
	}
	.block9{
		position: absolute;
		left:650px;
		top:1860px;
	}
	.block10{
		position: absolute;
		left:1100px;
		top:1860px;
	}
	.block11{
		position: absolute;
		left:900px;
		top:1660px;
	}
	.block12_1{
		position: absolute;
		left:80px;
		top:1560px;
	}
	.block12_2{
		position: absolute;
		left:310px;
		top:1560px;
	}
	.block13{
		position: absolute;
		left:900px;
		top:1360px;
	}
	.block14{
		position: absolute;
		left:80px;
		top:1270px;
	}
	.block15{
		position: absolute;
		left:310px;
		top:1270px;
	}
	.block16{
		position: absolute;
		left:460px;
		top:1270px;
	}
	.block17_1{
		position: absolute;
		left:1200px;
		top:1240px;
	}
	.block17_2{
		position: absolute;
		left:1250px;
		top:1240px;
	}
	.block18_1{
		position: absolute;
		left:1180px;
		top:1020px;
	}
	.block18_2{
		position: absolute;
		left:1240px;
		top:1020px;
	}
	.block19_1{
		position: absolute;
		left:500px;
		top:860px;
	}
	.block19_2{
		position: absolute;
		left:670px;
		top:860px;
	}
	.block20{
		position: absolute;
		left:500px;
		top:640px;
	}
	.block21{
		position: absolute;
		left:100px;
		top:460px;
	}
	.block22{
		position: absolute;
		left:600px;
		top:320px;
	}
	.block23{
		position: absolute;
		left:100px;
		top:160px;
	}
	.block24_1{
		position: absolute;
		left:700px;
		top:160px;
	}
	.block24_2{
		position: absolute;
		left:820px;
		top:160px;
	}
	.block24_3{
		position: absolute;
		left:940px;
		top:160px;
	}
	.block24_4{
		position: absolute;
		left:1060px;
		top:160px;
	}
	.block24_5{
		position: absolute;
		left:1180px;
		top:160px;
	}
	.goal{
		position: absolute;
		left:1250px;
		top:60px;
	}
	.goal2{
		position: absolute;
		left:1370px;
		top:60px;
	}

	.monster1{ /*45*/
		position: absolute;
		left:500px;
		top:2735px;
	}
	.monster2{
		position: absolute;
		left:60px;
		top:2115px;
	}
	.monster3{
		position: absolute;
		left:1200px;
		top:2315px;
	}
	.monster4{
		position: absolute;
		left:750px;
		top:1550px;
	}

	.monster5{
		position: absolute;
		left:100px;
		top:1070px;
	}
	.monster6{
		position: absolute;
		left:1200px;
		top:1794px;
	}
	.monster7{
		position: absolute;
		left:1200px;
		top:1163px;
	}
	.monster8{
		position: absolute;
		left:1200px;
		top:750px;
	}
	.monster9_right{/*53*/
		position: absolute;
		left:600px;
		top:250px;
	}
	
	
	.target1{/*54*/
		position: absolute;
		left:700px;
		top:2000px;
	}
	.target2{/*55*/
		position: absolute;
		left:600px;
		top:50px;
	}

	.monster9_down{/*56*/
		position: absolute;
		left:600px;
		top:250px;
	}
	.monster9_left{
		position: absolute;
		left:600px;
		top:250px;
	}
	.monster9_up{
		position: absolute;
		left:600px;
		top:250px;
	}

	.fire_right2{  /*59*/
		position: absolute;
		left:30px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.fire_left2{ /*60*/
		position: absolute;
		left:30px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}

	.fire_right3{  /*61*/
		position: absolute;
		left:30px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.fire_left3{ /*62*/
		position: absolute;
		left:30px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}

	.fire_right4{  /*63*/
		position: absolute;
		left:30px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}
	.fire_left4{ /*64*/
		position: absolute;
		left:30px;
		top:3040px;
		margin-left: 0px;
		margin-top: 0px;
	}

 .monster_damage1{/*65*/
	 	 position: absolute;
		 top:2740px;
	 	 left:565px;
	 }

 .monster_damage2{/*65*/
	 	 position: absolute;
		 top:2130px;
	 	 left:600px;
	 }

 .monster_damage3{/*65*/
	 	 position: absolute;
		top:2320px;
	 	 left:700px;
	 }

 .monster_damage4{/*65*/
	 	 position: absolute;
		 top:1550px;
	 	 left:565px;
	 }

 .monster_damage5{/*65*/
	 	 position: absolute;
		 top:1100px;
	 	 left:565px;
	 }

 .monster_damage6{/*65*/
	 	 position: absolute;
		 top:1780px;
	 	 left:1500px;
	 }

 .monster_damage7{/*65*/
	 	 position: absolute;
		 top:1100px;
	 	 left:1200px;
	 }

	  .monster_damage8{/*65*/
	 	 position: absolute;
		 top:1000px;
	 	 left:565px;
	 }
	  .monster_damage9{/*65*/
	 	 position: absolute;
		 top:2740px;
	 	 left:565px;
	 }



	


</style>

<style>
	
	.stage1{	
		position: absolute;
		left:0px;
		top:2560px;
		background-image: url(stage1.png);
		background-repeat: no-repeat;
		background-size:1370px 640px;
	}
	.stage2{
		position: absolute;
		left:0px;
		top:1920px;	
		background-image: url(stage2.png);
		background-repeat: no-repeat;
		background-size:1370px 640px;
	}
	.stage3{
		position: absolute;
		left:0px;
		top:1280px;	
		background-image: url(stage2.png);
		background-repeat: no-repeat;
		background-size:1370px 640px;
	}
	.stage4{
		position: absolute;
		left:0px;
		top:640px;	
		background-image: url(stage2.png);
		background-repeat: no-repeat;
		background-size:1370px 640px;
	}
	.stage5{
		position: absolute;
		left:0px;
		top:0px;	
		background-image: url(stage2.png);
		background-repeat: no-repeat;
		background-size:1370px 640px;
	}
	.result_page{
		position: absolute;
		left:1350px;
		top:0px;	
		background-image: url(stage2.png);
		background-repeat: no-repeat;
		background-size:1370px 640px;
	}
	.mark1{
		position: absolute;
		left:0px;
		top:3070px;
		font-size: 30px;
	}
	
	.mark2{
		position: absolute;
		left:0px;
		top:2850px;
		font-size: 30px;
	}
	
	.mark3{
		position: absolute;
		left:0px;
		top:2630px;
		font-size: 30px;
	}
	

	.mark4{
		position: absolute;
		left:0px;
		top:2410px;
		font-size: 30px;
	}
	

	.mark5{
		position: absolute;
		left:0px;
		top:2190px;
		font-size: 30px;
	}
	



	.mark6{
		position: absolute;
		left:0px;
		top:1970px;
		font-size: 30px;
	}
	

	.mark7{
		position: absolute;
		left:0px;
		top:1750px;
		font-size: 30px;
	}
	


	.mark8{
		position: absolute;
		left:0px;
		top:1530px;
		font-size: 30px;
	}
	

	.mark9{
		position: absolute;
		left:0px;
		top:1310px;
		font-size: 30px;
	}
	


	.mark10{
		position: absolute;
		left:0px;
		top:1090px;
		font-size: 30px;
	}
	

	.mark11{
		position: absolute;
		left:0px;
		top:870px;
		font-size: 30px;
	}
	

	.mark12{
		position: absolute;
		left:0px;
		top:650px;
		font-size: 30px;
	}
	

	.mark13{
		position: absolute;
		left:0px;
		top:430px;
		font-size: 30px;
	}

	


	.mark14{
		position: absolute;
		left:0px;
		top:210px;
		font-size: 30px;
	}

	.mark15{
		position: absolute;
		left:0px;
		top:-10px;
		font-size: 30px;
	}

 	
	#Time{
		position: fixed;
 		top:-20px;
 	  	right:15px;
		font-size: 30px;
	}
	.hp1{
		position: fixed;
 		top:5px;
 	  	right:250px;
 	  }
  	.hp2{
		position: fixed;
		top:5px;
  		right:300px;
  	}
  	.hp3{
		position: fixed;
		top:5px;
  		right:350px;
  	}
  	.start_button{
	 	   background-color : #0E73DF;
		  color: white;
		  padding: 20px 50px;
		  border-radius: 50px;
		  border-color: #46b8da;
		  cursor: pointer;
		  font-size:60px;
	 }
	 #start{
	 	  position: absolute;
  		bottom: 270px;
 		 right: 520px;
	 }
	  .start_button:hover{
	 	 background: #AAA;
  		text-decoration: none;
	 }
	.restart_button{
	 	 background-color : #0E73DF;
		  color: white;
		  padding: 20px 50px;
		  border-radius: 50px;
		  border-color: #46b8da;
		  cursor: pointer;
		  font-size:60px;
	 }
	 #restart{
	 	position: fixed;
  		bottom: 150px;
 		 right: 480px;
	 }
	 .restart_button:hover{
	 	 background: #AAA;
  		text-decoration: none;
	 }
	
	 .gameover{
		position: fixed;
 		top:20px;
 	  	left:280px;
		font-size: 70px;
		 color: #151414;
		  text-shadow: 5px 5px #FF0000;
	}
	.result{
		position: absolute;
 		top:250px;
 	  	left:1850px;
	}
	.cong{
		position: absolute;
 		top:70px;
 	  	left:1800px;


	}


	
</style>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
var event;
var clear_time;
var ctx;
var savex_key;
var savey_key;
var x_on=0;
var y_on=0;
var attack_on1=0;
var attack_left_px1=10;
var attack_top_px1=3040;
var attack_on2=0;
var attack_left_px2=10;
var attack_top_px2=3040;
var attack_on3=0;
var attack_left_px3=10;
var attack_top_px3=3040;
var attack_on3=0;
var attack_left_px3=10;
var attack_top_px3=3040;
var attack_on4=0;
var attack_left_px4=10;
var attack_top_px4=3040;
var fire_num=4;
var move_time;
var jump_time;
var left_px=10;
var top_px=3040;
var move_d=2.5;
var jump_d=3.5;
var attack_d=4;
var saveAttack_key;
var g=true;
var bottom=3040;
var fall=false;
var block_on=false;
var jump_ok=true;
var move_block1_x=700;
var move_block1_y=2300; 
var move_block1_left=false;
var move_block1_right=true;
var goal_time;
var playerHP=3;
var time = 0;
var running = 0;
var score;
var mins;
var secs;
var tenths;
var clear_time;
var monster_num=8;
var lastBlock=false;
var fire_direction1;
var fire_direction2;
var fire_direction3;
var fire_direction4;
var scrollinit;
var monster1_x=500;
var monster1_hp=5;
var monster2_x=60;
var monster2_hp=15;
var monster3_x=1200;
var monster3_hp=10;
var monster4_x=750;
var monster4_y=1550;
var monster4_hp=10;
var monster5_x=100;
var monster5_hp=30;
var monster7_y=1163;
var monster7_x=1200;
var monster7_hp=5;
var monster8_x=1200;
var monster8_y=750;
var monster8_hp=4;
var monster9_x=600;
var monster9_y=250;
var monster9_hp=10;
var target1_y=2000;
var target2_y=50;
var monster1_d=1;
var monster2_d=1;
var monster3_d=0.5;
var target1_d=1;
var target2_d=2;
var monster4_d=1;
var monster4_direction="right";
var monster5_d=1;
var monster6_d=0.5;
var monster7_d=0.5;
var monster8_dx=2;
var monster8_dy=1;
var monster9_d=1.5;
var monster9_direction="right";
var monster1_die=false;
var monster2_die=false;
var monster3_die=false;
var monster4_die=false;
var monster5_die=false;
var monster6_die=false;
var monster7_die=false;
var monster8_die=false;
var monster9_die=false;
var monster_damage_ok1=true;
var monster_damage_ok2=true;
var monster_damage_ok3=true;
var monster_damage_ok4=true;
var monster_damage_ok5=true;
var monster_damage_ok6=true;
var monster_damage_ok7=true;
var monster_damage_ok8=true;
var monster_damage_ok9=true;
var damage_ok1=true;
var damage_ok2=true;
var damage_ok3=true;
var damage_ok4=true;
var damage_ok5=true;
var damage_ok6=true;
var damage_ok7=true;
var damage_ok8=true;
var damage_ok9=true;

document.onkeydown=onKeyPress;
document.onkeyup=onKeyClear;

function init(){
	playerAllHidden();
	document.getElementsByClassName("stickman_stop")[0].style.visibility='visible';
	document.getElementsByClassName("start_button")[0].style.visibility='visible';
	document.getElementsByClassName("monster_damage1")[0].style.visibility='hidden';
	document.getElementsByClassName("monster_damage2")[0].style.visibility='hidden';
	document.getElementsByClassName("monster_damage3")[0].style.visibility='hidden';
	document.getElementsByClassName("monster_damage4")[0].style.visibility='hidden';
	document.getElementsByClassName("monster_damage5")[0].style.visibility='hidden';
	document.getElementsByClassName("monster_damage6")[0].style.visibility='hidden';
	document.getElementsByClassName("monster_damage7")[0].style.visibility='hidden';
	document.getElementsByClassName("monster_damage8")[0].style.visibility='hidden';
	document.getElementsByClassName("monster_damage9")[0].style.visibility='hidden';
	document.getElementsByClassName("gameOver")[0].style.visibility='hidden';
	document.getElementsByClassName("restart_button")[0].style.visibility='hidden';
	document.getElementsByClassName("result")[0].style.visibility='hidden';
	document.getElementsByClassName("block24_1")[0].style.visibility='hidden';
	document.getElementsByClassName("block24_2")[0].style.visibility='hidden';
	document.getElementsByClassName("block24_3")[0].style.visibility='hidden';
	document.getElementsByClassName("block24_4")[0].style.visibility='hidden';
	document.getElementsByClassName("block24_5")[0].style.visibility='hidden';
	scrollinit=setInterval(function(){window.scrollTo(0, 3000);},1);
}

function start(){
	clearInterval(scrollinit);
	document.getElementsByClassName("start_button")[0].style.visibility='hidden';
	move_time=setInterval(move,1); 
	clear_time=setInterval(increment,100);  //타이머 시작
}
function changeTopValue(top){
	document.styleSheets[0].rules[0].style.top=top+'px';
	document.styleSheets[0].rules[1].style.top=top+'px';
	document.styleSheets[0].rules[2].style.top=top+'px';
	document.styleSheets[0].rules[3].style.top=top+'px';
	document.styleSheets[0].rules[4].style.top=top+'px';
	document.styleSheets[0].rules[5].style.top=top+'px';
	document.styleSheets[0].rules[6].style.top=top+'px';
	document.styleSheets[0].rules[7].style.top=top+'px';
	document.styleSheets[0].rules[8].style.top=top+'px';
}
var y=20;
function onKeyPress(){ //해당 키가 눌러져 있을 때만 호출이 되는 함수 
   	if(event.keyCode==65||event.keyCode==68){ //키보드에서 A나 D가 눌러지면(좌우)
		savex_key=event.keyCode; //누른 키 코드를 변수에 저장
		if(x_on!=1){ //
			x_on=1;
			
		}
	}
    if(event.keyCode==87&&jump_ok==true){ //jump
    	savey_key=event.keyCode;
    	if(y_on!=1){ 
			y_on=1;	
		}
    }
     if(event.keyCode==75){ 
		saveAttack_key = event.keyCode; //누른 키 코드를 변수에 저장	
		if(attack_on1!=1){ 
			fire_direction1=savex_key;
			attack_on1=1;
			attack_left_px1=left_px; //발사하는 위치를 현재 자신이 있는 위치에 갖다 놓는다
			attack_top_px1=top_px;
		}
		else if(attack_on2!=1){ 
			fire_direction2=savex_key;
			attack_on2=1;
			attack_left_px2=left_px; //발사하는 위치를 현재 자신이 있는 위치에 갖다 놓는다
			attack_top_px2=top_px;
		}
		else if(attack_on3!=1){ 
			fire_direction3=savex_key;
			attack_on3=1;
			attack_left_px3=left_px; //발사하는 위치를 현재 자신이 있는 위치에 갖다 놓는다
			attack_top_px3=top_px;
		}
		else if(attack_on4!=1){ 
			fire_direction4=savex_key;
			attack_on4=1;
			attack_left_px4=left_px; //발사하는 위치를 현재 자신이 있는 위치에 갖다 놓는다
			attack_top_px4=top_px;
		}
	}
}
function onKeyClear(){ //누르고 있었던 키를 놨을 때 호출되는 함수
	if(event.keyCode==65||event.keyCode==68){ //좌우
		playerAllHidden();
		document.getElementsByClassName("stickman_stop")[0].style.visibility='visible';
		x_on=0;
	}
}

function monster1(){
monster1_x=monster1_x+monster1_d;
	document.styleSheets[0].rules[45].style.left=monster1_x+'px';
	document.styleSheets[0].rules[65].style.left=monster1_x+'px';
	if(monster1_x>900){
		monster1_d=-1;
	}
	else if(monster1_x<365){
		monster1_d=1;
	}

	if(((monster1_hp>0&&((monster1_x+10<attack_left_px1+55&&attack_left_px1+55<monster1_x+70&&2730+y<attack_top_px1+35&&attack_top_px1+35<2795+y)||(monster1_x+10<attack_left_px2+55&&attack_left_px2+55<monster1_x+70&&2730+y<attack_top_px2+35&&attack_top_px2+35<2795+y)||(monster1_x+10<attack_left_px3+55&&attack_left_px3+55<monster1_x+70&&2730+y<attack_top_px3+35&&attack_top_px3+35<2795+y)||(monster1_x+10<attack_left_px4+55&&attack_left_px4+55<monster1_x+70&&2730+y<attack_top_px4+35&&attack_top_px4+35<2795+y))))){
		
		  if((monster1_x+10<attack_left_px1+55&&attack_left_px1+55<monster1_x+70&&2730+y<attack_top_px1+35&&attack_top_px1+35<2795+y)==true){
		  		document.getElementsByClassName("fire_right1")[0].style.visibility='hidden';
		  		document.getElementsByClassName("fire_left1")[0].style.visibility='hidden';
		  	}
		
		document.getElementsByClassName("monster_damage1")[0].style.visibility='visible';
		setTimeout(function(){document.getElementsByClassName("monster_damage1")[0].style.visibility='hidden';},250);
		monster1_hp-=0.1;
		if(monster1_hp<=0){
			monster1_die=true;
			document.getElementsByClassName("monster1")[0].style.visibility='hidden';
			monster_num--;
		}
	}
	else if((monster1_hp>0&&!((monster1_x+10<attack_left_px1+55&&attack_left_px1+55<monster1_x+70&&2730+y<attack_top_px1+35&&attack_top_px1+35<2795+y)&&!(monster1_x+10<attack_left_px2+55&&attack_left_px2+55<monster1_x+70&&2730+y<attack_top_px2+35&&attack_top_px2+35<2795+y)&&!(monster1_x+10<attack_left_px3+55&&attack_left_px3+55<monster1_x+70&&2730+y<attack_top_px3+35&&attack_top_px3+35<2795+y)&&!(monster1_x+10<attack_left_px4+55&&attack_left_px4+55<monster1_x+70&&2730+y<attack_top_px4+35&&attack_top_px4+35<2795+y)))){

	}


}

function monster2(){
monster2_x=monster2_x+monster2_d;
	document.styleSheets[0].rules[46].style.left=monster2_x+'px';
	document.styleSheets[0].rules[66].style.left=monster2_x+'px';
	if(monster2_x>255){
		monster2_d=-1;
	}
	else if(monster2_x<60){
		monster2_d=1;
	}
	if(monster2_hp>0&&((monster2_x+10<attack_left_px1+55&&attack_left_px1+55<monster2_x+85&&2115+y<attack_top_px1+35&&attack_top_px1+35<2195+y)||(monster2_x+10<attack_left_px2+55&&attack_left_px2+55<monster2_x+85&&2115+y<attack_top_px2+35&&attack_top_px2+35<2195+y)||(monster2_x+10<attack_left_px3+55&&attack_left_px3+55<monster2_x+85&&2115+y<attack_top_px3+35&&attack_top_px3+35<2195+y)||(monster2_x+10<attack_left_px4+55&&attack_left_px4+55<monster2_x+85&&2115+y<attack_top_px4+35&&attack_top_px4+35<2195+y))){
		document.getElementsByClassName("monster_damage2")[0].style.visibility='visible';
		setTimeout(function(){document.getElementsByClassName("monster_damage2")[0].style.visibility='hidden';},250);
		monster2_hp-=0.1;
		if(monster2_hp<=0){
			monster2_die=true;
			document.getElementsByClassName("monster2")[0].style.visibility='hidden';
			monster_num--;
		}
	}
}

function monster3(){
monster3_x=monster3_x+monster3_d;
	document.styleSheets[0].rules[47].style.left=monster3_x+'px';
	document.styleSheets[0].rules[67].style.left=monster3_x+'px';
	if(monster3_x>1220){
		monster3_d=-0.5;
	}
	else if(monster3_x<1070){
		monster3_d=0.5;
	}
	if(monster3_hp>0&&((monster3_x+10<attack_left_px1+55&&attack_left_px1+55<monster3_x+85&&2330+y<attack_top_px1+35&&attack_top_px1+35<2400+y)||(monster3_x+10<attack_left_px2+55&&attack_left_px2+55<monster3_x+85&&2330+y<attack_top_px2+35&&attack_top_px2+35<2400+y)||(monster3_x+10<attack_left_px3+55&&attack_left_px3+55<monster3_x+85&&2330+y<attack_top_px3+35&&attack_top_px3+35<2400+y)||(monster3_x+10<attack_left_px4+55&&attack_left_px4+55<monster3_x+85&&2330+y<attack_top_px4+35&&attack_top_px4+35<2400+y))){
		document.getElementsByClassName("monster_damage3")[0].style.visibility='visible';
		setTimeout(function(){document.getElementsByClassName("monster_damage3")[0].style.visibility='hidden';},250);
		monster3_hp-=0.1;
		if(monster3_hp<=0){
			monster3_die=true;
			document.getElementsByClassName("monster3")[0].style.visibility='hidden';
			monster_num--;
		}
	}
}

function target1(){
	target1_y=target1_y+target1_d;
	document.styleSheets[0].rules[54].style.top=target1_y+'px';
	if(target1_y>2350){
		target1_d=-1;
	}
	else if(target1_y<2000){
		target1_d=1;
	}	
}
function target2(){
target2_y=target2_y+target2_d;
	document.styleSheets[0].rules[55].style.top=target2_y+'px';
	if(target2_y>500){
		target2_d=-2;
	}
	else if(target2_y<10){
		target2_d=2;
	}
}

function monster4(){	
	if(monster4_direction=="right"){
		monster4_x=monster4_x+monster4_d;
		document.styleSheets[0].rules[48].style.left=monster4_x+'px';
		document.styleSheets[0].rules[68].style.left=monster4_x+'px';
		if(monster4_x>1000){
			monster4_direction="down";
		}
	}
	else if(monster4_direction=="down"){
		
		monster4_y=monster4_y+monster4_d;
		document.styleSheets[0].rules[48].style.top=monster4_y+'px';
		document.styleSheets[0].rules[68].style.top=monster4_y+'px';
		if(monster4_y>1850){
			monster4_direction="left";
		}

	}
	else if(monster4_direction=="left"){
		
		monster4_x=monster4_x-monster4_d;
		document.styleSheets[0].rules[48].style.left=monster4_x+'px';
		document.styleSheets[0].rules[68].style.left=monster4_x+'px';
		if(monster4_x<750){
			monster4_direction="up";
		}
	}
	else if(monster4_direction=="up"){
		monster4_y=monster4_y-monster4_d;
		document.styleSheets[0].rules[48].style.top=monster4_y+'px';
		document.styleSheets[0].rules[68].style.top=monster4_y+'px';
		if(monster4_y<1550){
			monster4_direction="right";
		}
	}


	if(monster4_hp>0&&((monster4_x+10<attack_left_px1+55&&attack_left_px1+55<monster4_x+90&&monster4_y+y<attack_top_px1+35&&attack_top_px1+35<monster4_y+y+75)||(monster4_x+10<attack_left_px2+55&&attack_left_px2+55<monster4_x+90&&monster4_y+y<attack_top_px2+35&&attack_top_px2+35<monster4_y+y+75)||(monster4_x+10<attack_left_px3+55&&attack_left_px3+55<monster4_x+90&&monster4_y+y<attack_top_px3+35&&attack_top_px3+35<monster4_y+y+75)||(monster4_x+10<attack_left_px4+55&&attack_left_px4+55<monster4_x+90&&monster4_y+y<attack_top_px4+35&&attack_top_px4+35<monster4_y+y+75))){
	 	document.getElementsByClassName("monster_damage4")[0].style.visibility='visible';
		setTimeout(function(){document.getElementsByClassName("monster_damage4")[0].style.visibility='hidden';},250);
		monster4_hp-=0.1;
		if(monster4_hp<=0){
			monster4_die=true;
			document.getElementsByClassName("monster4")[0].style.visibility='hidden';
			monster_num--;
		}
	}
}

function monster5(){
	monster5_x=monster5_x+monster5_d;
	document.styleSheets[0].rules[49].style.left=monster5_x+'px';
	document.styleSheets[0].rules[69].style.left=monster5_x+'px';
	if(monster5_x>520){
		monster5_d=-0.5;
	}
	else if(monster5_x<30){
		monster5_d=0.5;
	}
	if(monster5_hp>0&&((monster5_x+25<attack_left_px1+55&&attack_left_px1+55<monster5_x+170&&1060+y<attack_top_px1+35&&attack_top_px1+35<1255+y)||(monster5_x+25<attack_left_px2+55&&attack_left_px2+55<monster5_x+170&&1060+y<attack_top_px2+35&&attack_top_px2+35<1255+y)||(monster5_x+25<attack_left_px3+55&&attack_left_px3+55<monster5_x+170&&1060+y<attack_top_px3+35&&attack_top_px3+35<1255+y)||(monster5_x+25<attack_left_px4+55&&attack_left_px4+55<monster5_x+170&&1060+y<attack_top_px4+35&&attack_top_px4+35<1255+y))){
		document.getElementsByClassName("monster_damage5")[0].style.visibility='visible';
		setTimeout(function(){document.getElementsByClassName("monster_damage5")[0].style.visibility='hidden';},250);
		monster5_hp-=0.1;
		if(monster5_hp<=0){
			monster5_die=true;
			document.getElementsByClassName("monster5")[0].style.visibility='hidden';
			monster_num--;
		}
	}
}

function monster7(){
	monster7_y=monster7_y-monster7_d;
	document.styleSheets[0].rules[51].style.top=monster7_y+'px';
	document.styleSheets[0].rules[71].style.top=monster7_y+'px';
	if(monster7_y<1063){
		monster7_d=-0.5;
	}
	else if(monster7_y>1163){
		monster7_d=0.5;
	}
	if(monster7_hp>0&&((monster7_x+25<attack_left_px1+55&&attack_left_px1+55<monster7_x+60&&monster7_y+y<attack_top_px1+35&&attack_top_px1+35<monster7_y+y+65)||(monster7_x+25<attack_left_px2+55&&attack_left_px2+55<monster7_x+60&&monster7_y+y<attack_top_px2+35&&attack_top_px2+35<monster7_y+y+65)||(monster7_x+25<attack_left_px3+55&&attack_left_px3+55<monster7_x+60&&monster7_y+y<attack_top_px3+35&&attack_top_px3+35<monster7_y+y+65)||(monster7_x+25<attack_left_px4+55&&attack_left_px4+55<monster7_x+60&&monster7_y+y<attack_top_px4+35&&attack_top_px4+35<monster7_y+y+65))){
		document.getElementsByClassName("monster_damage7")[0].style.visibility='visible';
		setTimeout(function(){document.getElementsByClassName("monster_damage7")[0].style.visibility='hidden';},250);
		monster7_hp-=0.1;
		if(monster7_hp<=0){
			monster7_die=true;
			document.getElementsByClassName("monster7")[0].style.visibility='hidden';
			monster_num--;
		}
	}
}

function monster8(){
	monster8_x=monster8_x+monster8_dx;
	monster8_y=monster8_y+monster8_dy;
	document.styleSheets[0].rules[52].style.left=monster8_x+'px';
	document.styleSheets[0].rules[52].style.top=monster8_y+'px';
	document.styleSheets[0].rules[72].style.left=monster8_x+'px';
	document.styleSheets[0].rules[72].style.top=monster8_y+'px';
	if(monster8_x>1300){
		monster8_dx=-2;
	}
	if(monster8_x<10){
		monster8_dx=2;
	}
	if(monster8_y<500){
		monster8_dy=1;
	}
	 if(monster8_y>800){
		monster8_dy=-1;
	}

	if(monster8_hp>0&&((monster8_x+25<attack_left_px1+55&&attack_left_px1+55<monster8_x+55&&monster8_y+y<attack_top_px1+35&&attack_top_px1+35<monster8_y+y+60)||(monster8_x+25<attack_left_px2+55&&attack_left_px2+55<monster8_x+55&&monster8_y+y<attack_top_px2+35&&attack_top_px2+35<monster8_y+y+60)||(monster8_x+25<attack_left_px3+55&&attack_left_px3+55<monster8_x+55&&monster8_y+y<attack_top_px3+35&&attack_top_px3+35<monster8_y+y+60)||(monster8_x+25<attack_left_px4+55&&attack_left_px4+55<monster8_x+55&&monster8_y+y<attack_top_px4+35&&attack_top_px4+35<monster8_y+y+60))){
		document.getElementsByClassName("monster_damage8")[0].style.visibility='visible';
		setTimeout(function(){document.getElementsByClassName("monster_damage8")[0].style.visibility='hidden';},250);
		monster8_hp-=0.1;
		if(monster8_hp<=0){
			monster8_die=true;
			document.getElementsByClassName("monster8")[0].style.visibility='hidden';
			monster_num--;
		}
	}
}

function monster9(){
	if(monster9_hp<=0){return;}
	if(monster9_direction=="right"){
		document.getElementsByClassName("monster9_down")[0].style.visibility='hidden';
		document.getElementsByClassName("monster9_left")[0].style.visibility='hidden';
		document.getElementsByClassName("monster9_up")[0].style.visibility='hidden';
		document.getElementsByClassName("monster9_right")[0].style.visibility='visible';
		monster9_x=monster9_x+monster9_d;
		document.styleSheets[0].rules[53].style.left=monster9_x+'px';
		document.styleSheets[0].rules[56].style.left=monster9_x+'px';
		document.styleSheets[0].rules[57].style.left=monster9_x+'px';
		document.styleSheets[0].rules[58].style.left=monster9_x+'px';
		document.styleSheets[0].rules[73].style.left=monster9_x+'px';
		if(monster9_x>790){
			monster9_direction="down";
		}
	}
	else if(monster9_direction=="down"){
		document.getElementsByClassName("monster9_down")[0].style.visibility='visible';
		document.getElementsByClassName("monster9_left")[0].style.visibility='hidden';
		document.getElementsByClassName("monster9_up")[0].style.visibility='hidden';
		document.getElementsByClassName("monster9_right")[0].style.visibility='hidden';
		monster9_y=monster9_y+monster9_d;
		document.styleSheets[0].rules[53].style.top=monster9_y+'px';
		document.styleSheets[0].rules[56].style.top=monster9_y+'px';
		document.styleSheets[0].rules[57].style.top=monster9_y+'px';
		document.styleSheets[0].rules[58].style.top=monster9_y+'px';
		document.styleSheets[0].rules[73].style.top=monster9_y+'px';
		if(monster9_y>380){
			monster9_direction="left";
		}

	}
	else if(monster9_direction=="left"){
		document.getElementsByClassName("monster9_down")[0].style.visibility='hidden';
		document.getElementsByClassName("monster9_left")[0].style.visibility='visible';
		document.getElementsByClassName("monster9_up")[0].style.visibility='hidden';
		document.getElementsByClassName("monster9_right")[0].style.visibility='hidden';
		monster9_x=monster9_x-monster9_d;
		document.styleSheets[0].rules[53].style.left=monster9_x+'px';
		document.styleSheets[0].rules[56].style.left=monster9_x+'px';
		document.styleSheets[0].rules[57].style.left=monster9_x+'px';
		document.styleSheets[0].rules[58].style.left=monster9_x+'px';
		document.styleSheets[0].rules[73].style.left=monster9_x+'px';
		if(monster9_x<540){
			monster9_direction="up";
		}
	}
	else if(monster9_direction=="up"){
		document.getElementsByClassName("monster9_down")[0].style.visibility='hidden';
		document.getElementsByClassName("monster9_left")[0].style.visibility='hidden';
		document.getElementsByClassName("monster9_up")[0].style.visibility='visible';
		document.getElementsByClassName("monster9_right")[0].style.visibility='hidden';
		monster9_y=monster9_y-monster9_d;
		document.styleSheets[0].rules[53].style.top=monster9_y+'px';
		document.styleSheets[0].rules[56].style.top=monster9_y+'px';
		document.styleSheets[0].rules[57].style.top=monster9_y+'px';
		document.styleSheets[0].rules[58].style.top=monster9_y+'px';
		document.styleSheets[0].rules[73].style.top=monster9_y+'px';
		if(monster9_y<250){
			monster9_direction="right";
		}
	}

	if(monster9_hp>0&&((monster9_x+5<attack_left_px1+55&&attack_left_px1+55<monster9_x+75&&monster9_y+y<attack_top_px1+35&&attack_top_px1+35<monster9_y+y+60)||(monster9_x+5<attack_left_px2+55&&attack_left_px2+55<monster9_x+75&&monster9_y+y<attack_top_px2+35&&attack_top_px2+35<monster9_y+y+60)||(monster9_x+5<attack_left_px3+55&&attack_left_px3+55<monster9_x+75&&monster9_y+y<attack_top_px3+35&&attack_top_px3+35<monster9_y+y+60)||(monster9_x+5<attack_left_px4+55&&attack_left_px4+55<monster9_x+75&&monster9_y+y<attack_top_px4+35&&attack_top_px4+35<monster9_y+y+60))){
		document.getElementsByClassName("monster_damage9")[0].style.visibility='visible';
		setTimeout(function(){document.getElementsByClassName("monster_damage9")[0].style.visibility='hidden';},250);
		monster9_hp-=0.1;
			if(monster9_hp<=0){
				monster9_die=true;
				document.getElementsByClassName("monster9_up")[0].style.visibility='hidden';
				document.getElementsByClassName("monster9_down")[0].style.visibility='hidden';
				document.getElementsByClassName("monster9_right")[0].style.visibility='hidden';
				document.getElementsByClassName("monster9_left")[0].style.visibility='hidden';
				monster_num--;
			}
	}
}

function checkDamage(x1,y1,x2,y2,x3,y3,x4,y4){
	
	if(monster1_die==false){
		if(damage_ok1==true&&((monster1_x+10<x1&&x1<monster1_x+70&&2730+y<y1&&y1<2795+y)||(monster1_x+10<x2&&x2<monster1_x+70&&2730+y<y2&&y2<2795+y)||(monster1_x+10<x3&&x3<monster1_x+70&&2730+y<y3&&y3<2795+y)||(monster1_x+10<x4&&x4<monster1_x+70&&2730+y<y4&&y4<2795+y))){
			damage_ok1=false;
			if(playerHP==3){
				playerHP--;
				document.getElementsByClassName("hp1")[0].style.visibility='hidden';
			}
			else if(playerHP==2){
				playerHP--;
				document.getElementsByClassName("hp2")[0].style.visibility='hidden';
			}
			else{
				playerHP--;
				document.getElementsByClassName("hp3")[0].style.visibility='hidden';
			}

			if(playerHP==0){
				gameOver();
			}
		}
		else if(damage_ok1==false&&!(monster1_x+10<x1&&x1<monster1_x+70&&2730+y<y1&&y1<2795+y)&&!(monster1_x+10<x2&&x2<monster1_x+70&&2730+y<y2&&y2<2795+y)&&!(monster1_x+10<x3&&x3<monster1_x+70&&2730+y<y3&&y3<2795+y)&&!(monster1_x+10<x4&&x4<monster1_x+70&&2730+y<y4&&y4<2795+y)){
			damage_ok1=true;
		}
	}
	if(monster2_die==false){
		if(damage_ok2==true&&((monster2_x+10<x1&&x1<monster2_x+85&&2115+y<y1&&y1<2195+y)||(monster2_x+10<x2&&x2<monster2_x+85&&2115+y<y2&&y2<2195+y)||(monster2_x+10<x3&&x3<monster2_x+85&&2115+y<y3&&y3<2195+y)||(monster2_x+10<x4&&x4<monster2_x+85&&2115+y<y4&&y4<2195+y))){
			damage_ok2=false;
			if(playerHP==3){
				playerHP--;
				document.getElementsByClassName("hp1")[0].style.visibility='hidden';
			}
			else if(playerHP==2){
				playerHP--;
				document.getElementsByClassName("hp2")[0].style.visibility='hidden';
			}
			else{
				playerHP--;
				document.getElementsByClassName("hp3")[0].style.visibility='hidden';
			}

			if(playerHP==0){
				gameOver();
			}
		}
		else if(damage_ok2==false&&!(monster2_x+10<x1&&x1<monster2_x+85&&2115+y<y1&&y1<2195+y)&&!(monster2_x+10<x2&&x2<monster2_x+85&&2115+y<y2&&y2<2195+y)&&!(monster2_x+10<x3&&x3<monster2_x+85&&2115+y<y3&&y3<2195+y)&&!(monster2_x+10<x4&&x4<monster2_x+85&&2115+y<y4&&y4<2195+y)){
			damage_ok2=true;
		}
	}
	if(monster3_die==false){
		if(damage_ok3==true&&((monster3_x+10<x1&&x1<monster3_x+85&&2330+y<y1&&y1<2400+y)||(monster3_x+10<x2&&x2<monster3_x+85&&2330+y<y2&&y2<2400+y)||(monster3_x+10<x3&&x3<monster3_x+85&&2330+y<y3&&y3<2400+y)||(monster3_x+10<x4&&x4<monster3_x+85&&2330+y<y4&&y4<2400+y))){
			damage_ok3=false;
			if(playerHP==3){
				playerHP--;
				document.getElementsByClassName("hp1")[0].style.visibility='hidden';
			}
			else if(playerHP==2){
				playerHP--;
				document.getElementsByClassName("hp2")[0].style.visibility='hidden';
			}
			else{
				playerHP--;
				document.getElementsByClassName("hp3")[0].style.visibility='hidden';
			}

			if(playerHP==0){
				gameOver();
			}
		}
		else if(damage_ok3==false&&!(monster3_x+10<x1&&x1<monster3_x+85&&2330+y<y1&&y1<2400+y)&&!(monster3_x+10<x2&&x2<monster3_x+85&&2330+y<y2&&y2<2400+y)&&!(monster3_x+10<x3&&x3<monster3_x+85&&2330+y<y3&&y3<2400+y)&&!(monster3_x+10<x4&&x4<monster3_x+85&&2330+y<y4&&y4<2400+y)){
			damage_ok3=true;
		}
	}
	if(monster4_die==false){
		if(damage_ok4==true&&((monster4_x+10<x1&&x1<monster4_x+90&&monster4_y+y<y1&&y1<monster4_y+y+75)||(monster4_x+10<x2&&x2<monster4_x+90&&monster4_y+y<y2&&y2<monster4_y+y+75)||(monster4_x+10<x3&&x3<monster4_x+90&&monster4_y+y<y3&&y3<monster4_y+y+75)||(monster4_x+10<x4&&x4<monster4_x+90&&monster4_y+y<y4&&y4<monster4_y+y+75))){
			damage_ok4=false;
			if(playerHP==3){
				playerHP--;
				document.getElementsByClassName("hp1")[0].style.visibility='hidden';
			}
			else if(playerHP==2){
				playerHP--;
				document.getElementsByClassName("hp2")[0].style.visibility='hidden';
			}
			else{
				playerHP--;
				document.getElementsByClassName("hp3")[0].style.visibility='hidden';
			}

			if(playerHP==0){
				gameOver();
			}
		}
		else if(damage_ok4==false&&!(monster4_x+10<x1&&x1<monster4_x+90&&monster4_y+y<y1&&y1<monster4_y+y+75)&&!(monster4_x+10<x2&&x2<monster4_x+90&&monster4_y+y<y2&&y2<monster4_y+y+75)&&!(monster4_x+10<x3&&x3<monster4_x+90&&monster4_y+y<y3&&y3<monster4_y+y+75)&&!(monster4_x+10<x4&&x4<monster4_x+90&&monster4_y+y<y4&&y4<monster4_y+y+75)){
			damage_ok4=true;
		}
	}
	if(monster5_die==false){
		if(damage_ok5==true&&((monster5_x+25<x1&&x1<monster5_x+170&&1060+y<y1&&y1<1255+y)||(monster5_x+25<x2&&x2<monster5_x+170&&1060+y<y2&&y2<1255+y)||(monster5_x+25<x3&&x3<monster5_x+170&&1060+y<y3&&y3<1255+y)||(monster5_x+25<x4&&x4<monster5_x+170&&1060+y<y4&&y4<1255+y))){
			damage_ok5=false;
			if(playerHP==3){
				playerHP--;
				document.getElementsByClassName("hp1")[0].style.visibility='hidden';
			}
			else if(playerHP==2){
				playerHP--;
				document.getElementsByClassName("hp2")[0].style.visibility='hidden';
			}
			else{
				playerHP--;
				document.getElementsByClassName("hp3")[0].style.visibility='hidden';
			}

			if(playerHP==0){
				gameOver();
			}
		}
		else if(damage_ok5==false&&!(monster5_x+25<x1&&x1<monster5_x+170&&1060+y<y1&&y1<1255+y)&&!(monster5_x+25<x2&&x2<monster5_x+170&&1060+y<y2&&y2<1255+y)&&!(monster5_x+25<x3&&x3<monster5_x+170&&1060+y<y3&&y3<1255+y)&&!(monster5_x+25<x4&&x4<monster5_x+170&&1060+y<y4&&y4<1255+y)){
			damage_ok5=true;
		}
	}
	if(monster7_die==false){
		if(damage_ok7==true&&((monster7_x+25<x1&&x1<monster7_x+60&&monster7_y+y<y1&&y1<monster7_y+y+65)||(monster7_x+25<x2&&x2<monster7_x+60&&monster7_y+y<y2&&y2<monster7_y+y+65)||(monster7_x+25<x3&&x3<monster7_x+60&&monster7_y+y<y3&&y3<monster7_y+y+65)||(monster7_x+25<x4&&x4<monster7_x+60&&monster7_y+y<y4&&y4<monster7_y+y+65))){

			damage_ok7=false;
			if(playerHP==3){
				playerHP--;
				document.getElementsByClassName("hp1")[0].style.visibility='hidden';
			}
			else if(playerHP==2){
				playerHP--;
				document.getElementsByClassName("hp2")[0].style.visibility='hidden';
			}
			else{
				playerHP--;
				document.getElementsByClassName("hp3")[0].style.visibility='hidden';
			}

			if(playerHP==0){
				gameOver();
			}
		}
		else if(damage_ok7==false&&!(monster7_x+25<x1&&x1<monster7_x+60&&monster7_y+y<y1&&y1<monster7_y+y+65)&&!(monster7_x+25<x2&&x2<monster7_x+60&&monster7_y+y<y2&&y2<monster7_y+y+65)&&!(monster7_x+25<x3&&x3<monster7_x+60&&monster7_y+y<y3&&y3<monster7_y+y+65)&&!(monster7_x+25<x4&&x4<monster7_x+60&&monster7_y+y<y4&&y4<monster7_y+y+65)){
			damage_ok7=true;
		}
	}

	if(monster8_die==false){
		if(damage_ok8==true&&((monster8_x+25<x1&&x1<monster8_x+55&&monster8_y+y<y1&&y1<monster8_y+y+60)||(monster8_x+25<x2&&x2<monster8_x+55&&monster8_y+y<y2&&y2<monster8_y+y+60)||(monster8_x+25<x3&&x3<monster8_x+55&&monster8_y+y<y3&&y3<monster8_y+y+60)||(monster8_x+25<x4&&x4<monster8_x+55&&monster8_y+y<y4&&y4<monster8_y+y+60))){
			damage_ok8=false;
			if(playerHP==3){
				playerHP--;
				document.getElementsByClassName("hp1")[0].style.visibility='hidden';
			}
			else if(playerHP==2){
				playerHP--;
				document.getElementsByClassName("hp2")[0].style.visibility='hidden';
			}
			else{
				playerHP--;
				document.getElementsByClassName("hp3")[0].style.visibility='hidden';
			}

			if(playerHP==0){
				gameOver();
			}
		}
		else if(damage_ok8==false&&!(monster8_x+25<x1&&x1<monster8_x+55&&monster8_y+y<y1&&y1<monster8_y+y+60)&&!(monster8_x+25<x2&&x2<monster8_x+55&&monster8_y+y<y2&&y2<monster8_y+y+60)&&!(monster8_x+25<x3&&x3<monster8_x+55&&monster8_y+y<y3&&y3<monster8_y+y+60)&&!(monster8_x+25<x4&&x4<monster8_x+55&&monster8_y+y<y4&&y4<monster8_y+y+60)){
			damage_ok8=true;
		}
	}
	if(monster9_die==false){
		if(damage_ok9==true&&((monster9_x+5<x1&&x1<monster9_x+75&&monster9_y+y<y1&&y1<monster9_y+y+60)||(monster9_x+5<x2&&x2<monster9_x+75&&monster9_y+y<y2&&y2<monster9_y+y+60)||(monster9_x+5<x1&&x1<monster9_x+75&&monster9_y+y<y3&&y3<monster9_y+y+60)||(monster9_x+5<x1&&x1<monster9_x+75&&monster9_y+y<y4&&y4<monster9_y+y+60))){
			damage_ok9=false;
			if(playerHP==3){
				playerHP--;
				document.getElementsByClassName("hp1")[0].style.visibility='hidden';
			}
			else if(playerHP==2){
				playerHP--;
				document.getElementsByClassName("hp2")[0].style.visibility='hidden';
			}
			else{
				playerHP--;
				document.getElementsByClassName("hp3")[0].style.visibility='hidden';
			}

			if(playerHP==0){
				gameOver();
			}
		}
		else if(damage_ok9==false&&!(monster9_x+5<x1&&x1<monster9_x+75&&monster9_y+y<y1&&y1<monster9_y+y+60)&&!(monster9_x+5<x2&&x2<monster9_x+75&&monster9_y+y<y2&&y2<monster9_y+y+60)&&!(monster9_x+5<x1&&x1<monster9_x+75&&monster9_y+y<y3&&y3<monster9_y+y+60)&&!(monster9_x+5<x1&&x1<monster9_x+75&&monster9_y+y<y4&&y4<monster9_y+y+60)){
			damage_ok9=true;
		}
	}
}


function gameOver(){
	clearInterval(move_time);
	clearInterval(clear_time);
	document.getElementsByClassName("gameover")[0].style.visibility='visible';
	document.getElementsByClassName("restart_button")[0].style.visibility='visible';
}
function move(){ //자신이 x방향으로 이동할 때 호출 되는 함수
	if(monster_num==0){
		document.getElementsByClassName("block24_1")[0].style.visibility='visible';
		document.getElementsByClassName("block24_2")[0].style.visibility='visible';
		document.getElementsByClassName("block24_3")[0].style.visibility='visible';
		document.getElementsByClassName("block24_4")[0].style.visibility='visible';
		document.getElementsByClassName("block24_5")[0].style.visibility='visible';
		lastBlock=true;
	}
	monster1();
	monster2();
	monster3();
	target1();
	monster4();
	monster5();
	monster7();
	monster8();
	monster9();
	target2();
	check(left_px,top_px,left_px+60,top_px,left_px+28,top_px+50,left_px+28,top_px-10,left_px+65,top_px+20+y,left_px-10,top_px+20+y,left_px,top_px+y+50,left_px+56,top_px+y+50); /*블록 검사 함수*/
	checkDamage(left_px+15,top_px+y,left_px+41,top_px+y,left_px+41,top_px+y+50,left_px+15,top_px+y+50); /**/
	window.scrollTo(0, top_px-300);
	if(savex_key==65&&x_on==1){
		if(y_on==0){
			playerAllHidden();
			document.getElementsByClassName("stickman_run_left")[0].style.visibility='visible';
		}
		document.styleSheets[0].rules[0].style.left=left_px+'px';
		document.styleSheets[0].rules[1].style.left=left_px+'px';
		document.styleSheets[0].rules[2].style.left=left_px+'px';
		document.styleSheets[0].rules[3].style.left=left_px+'px';
		document.styleSheets[0].rules[4].style.left=left_px+'px';
		document.styleSheets[0].rules[5].style.left=left_px+'px';
		document.styleSheets[0].rules[6].style.left=left_px+'px';
		document.styleSheets[0].rules[7].style.left=left_px+'px';//총알 right
		document.styleSheets[0].rules[8].style.left=left_px+'px';//총알 left
		left_px=left_px-move_d;
		if(left_px<-10){
			left_px=-10;
		}
	}
	else if(savex_key==68&&x_on==1){
		if(y_on==0){
			playerAllHidden();
			document.getElementsByClassName("stickman_run_right")[0].style.visibility='visible';
		}
		document.styleSheets[0].rules[0].style.left=left_px+'px';
		document.styleSheets[0].rules[1].style.left=left_px+'px';
		document.styleSheets[0].rules[2].style.left=left_px+'px';
		document.styleSheets[0].rules[3].style.left=left_px+'px';
		document.styleSheets[0].rules[4].style.left=left_px+'px';
		document.styleSheets[0].rules[5].style.left=left_px+'px';
		document.styleSheets[0].rules[6].style.left=left_px+'px';
		document.styleSheets[0].rules[7].style.left=left_px+'px';//총알 right
		document.styleSheets[0].rules[8].style.left=left_px+'px';//총알 left
		left_px=left_px+move_d;
		if(left_px>1310){
			left_px=1310;
		}
	}
			
	if(savey_key==87&&y_on==1){  //jump!!!!!
		block_on=false;
		y_on=1;
		playerAllHidden();
		if(savex_key==65){
			document.getElementsByClassName("stickman_jump_left")[0].style.visibility='visible';
		}
		else if(savex_key==68){
			document.getElementsByClassName("stickman_jump_right")[0].style.visibility='visible';
		}
		document.styleSheets[0].rules[0].style.top=top_px+'px';
		document.styleSheets[0].rules[1].style.top=top_px+'px';
		document.styleSheets[0].rules[2].style.top=top_px+'px';
		document.styleSheets[0].rules[3].style.top=top_px+'px';
		document.styleSheets[0].rules[4].style.top=top_px+'px';
		document.styleSheets[0].rules[5].style.top=top_px+'px';
		top_px=top_px-jump_d;
		jump_d-=0.027;
		if(top_px<(bottom-240)){
			if(g==true){
				jump_d=-3.5;
				g=false;
			}
			jump_d+=0.027;
		}

		else if(top_px>=bottom){
			playerAllHidden();
			document.getElementsByClassName("stickman_stop")[0].style.visibility='visible';
			top_px=bottom;
			jump_d=3.5;
			g=true;
			y_on=0;
			block_on=true;
		}
	}
	
	if(fall==true){
		jump_ok=false;
		playerAllHidden();
		if(savex_key==65){
			document.getElementsByClassName("stickman_jump_left")[0].style.visibility='visible';
		}
		else if(savex_key==68){
			document.getElementsByClassName("stickman_jump_right")[0].style.visibility='visible';
		}
		document.styleSheets[0].rules[0].style.top=top_px+'px';
		document.styleSheets[0].rules[1].style.top=top_px+'px';
		document.styleSheets[0].rules[2].style.top=top_px+'px';
		document.styleSheets[0].rules[3].style.top=top_px+'px';
		document.styleSheets[0].rules[4].style.top=top_px+'px';
		document.styleSheets[0].rules[5].style.top=top_px+'px';
		top_px=top_px+jump_d-2;
		jump_d+=0.027;
		if(top_px>=bottom){
			playerAllHidden();
			document.getElementsByClassName("stickman_stop")[0].style.visibility='visible';
			top_px=bottom;
			jump_d=3.5;
			y_on=0;
			fall=false;
			jump_ok=true;
			peak=false;
		}
	}
	if(attack_on1==1){
		if(fire_direction1==68){
			document.getElementsByClassName("fire_right1")[0].style.visibility='visible';
			attack_left_px1+=attack_d;
			document.styleSheets[0].rules[7].style.left=attack_left_px1+'px';
			document.styleSheets[0].rules[7].style.top=attack_top_px1+'px';
			if(attack_left_px1>1280){
				document.getElementsByClassName("fire_right1")[0].style.visibility='hidden';
				attack_on1=0;
			}
		}
		else if(fire_direction1==65){
			document.getElementsByClassName("fire_left1")[0].style.visibility='visible';
			attack_left_px1-=attack_d;
			document.styleSheets[0].rules[8].style.left=attack_left_px1+'px';
			document.styleSheets[0].rules[8].style.top=attack_top_px1+'px';
			if(attack_left_px1<0){
				document.getElementsByClassName("fire_left1")[0].style.visibility='hidden';
				attack_on1=0;
			}
		}
	}
	if(attack_on2==1){
		if(fire_direction2==68){
			document.getElementsByClassName("fire_right2")[0].style.visibility='visible';
			attack_left_px2+=attack_d;
			document.styleSheets[0].rules[59].style.left=attack_left_px2+'px';
			document.styleSheets[0].rules[59].style.top=attack_top_px2+'px';
			if(attack_left_px2>1280){
				document.getElementsByClassName("fire_right2")[0].style.visibility='hidden';
				attack_on2=0;
			}
		}
		else if(fire_direction2==65){
			document.getElementsByClassName("fire_left2")[0].style.visibility='visible';
			attack_left_px2-=attack_d;
			document.styleSheets[0].rules[60].style.left=attack_left_px2+'px';
			document.styleSheets[0].rules[60].style.top=attack_top_px2+'px';
			if(attack_left_px2<0){
				document.getElementsByClassName("fire_left2")[0].style.visibility='hidden';
				attack_on2=0;
			}
		}
	}
	if(attack_on3==1){
		if(fire_direction3==68){
			document.getElementsByClassName("fire_right3")[0].style.visibility='visible';
			attack_left_px3+=attack_d;
			document.styleSheets[0].rules[61].style.left=attack_left_px3+'px';
			document.styleSheets[0].rules[61].style.top=attack_top_px3+'px';
			if(attack_left_px3>1280){
				document.getElementsByClassName("fire_right3")[0].style.visibility='hidden';
				attack_on3=0;
			}
		}
		else if(fire_direction3==65){
			document.getElementsByClassName("fire_left3")[0].style.visibility='visible';
			attack_left_px3-=attack_d;
			document.styleSheets[0].rules[62].style.left=attack_left_px3+'px';
			document.styleSheets[0].rules[62].style.top=attack_top_px3+'px';
			if(attack_left_px3<0){
				document.getElementsByClassName("fire_left3")[0].style.visibility='hidden';
				attack_on3=0;
			}
		}
	}
	if(attack_on4==1){
		
		if(fire_direction4==68){
			document.getElementsByClassName("fire_right4")[0].style.visibility='visible';
			attack_left_px4+=attack_d;
			document.styleSheets[0].rules[63].style.left=attack_left_px4+'px';
			document.styleSheets[0].rules[63].style.top=attack_top_px4+'px';
			if(attack_left_px4>1280){
				document.getElementsByClassName("fire_right4")[0].style.visibility='hidden';
				attack_on4=0;
			}
		}
		else if(fire_direction4==65){
			document.getElementsByClassName("fire_left4")[0].style.visibility='visible';
			attack_left_px4-=attack_d;
			document.styleSheets[0].rules[64].style.left=attack_left_px4+'px';
			document.styleSheets[0].rules[64].style.top=attack_top_px4+'px';
			if(attack_left_px4<0){
				document.getElementsByClassName("fire_left4")[0].style.visibility='hidden';
				attack_on4=0;
			
			}
		}
	}
}

var peak=false;
function check(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8){  /*블록 검사*/
	/*1*/
	if((1240<x3&&x3<1300&&2920<y3&&y3<2980)&&!(1240<x1&&x1<1300&&2920<y1&&y1<2980)&&!(1240<x2&&x2<1300&&2920<y2&&y2<2980)){
		changeTopValue((2920-50));
		block_on=true;
		bottom=2920-50+1;
	}
	else if(1240<x4&&x4<1300&&2920<y4&&y4<2980){y_on=0;fall=true;peak=true;}
	else if((400<x3&&x3<950&&2800<y3&&y3<2870)&&!(400<x1&&x1<950&&2800<y1&&y1<2870)&&!(400<x2&&x2<950&&2800<y2&&y2<2870)){
		changeTopValue((2800-50));
		block_on=true;
		bottom=2800-50+1;
	}
	else if(400<x4&&x4<950&&2800<y4&&y4<2870){y_on=0;fall=true;peak=true;}
	else if((100<x3&&x3<170&&2600<y3&&y3<2670)&&!(100<x1&&x1<170&&2600<y1&&y1<2670)&&!(100<x2&&x2<170&&2600<y2&&y2<2670)){
		changeTopValue((2600-50));
		block_on=true;
		bottom=2600-50+1;
	}
	else if(100<x4&&x4<170&&2600<y4&&y4<2670){y_on=0;fall=true;peak=true;}
	else if((650<x3&&x3<800&&2500<y3&&y3<2570)&&!(650<x1&&x1<800&&2500<y1&&y1<2570)&&!(650<x2&&x2<800&&2500<y2&&y2<2570)){
		changeTopValue((2500-50));
		block_on=true;
		bottom=2500-50+1;
	}
	else if(650<x4&&x4<800&&2500<y4&&y4<2570){y_on=0;fall=true;peak=true;}
	else if((1100<x3&&x3<1300&&2400<y3&&y3<2470)&&!(1100<x1&&x1<1300&&2400<y1&&y1<2470)&&!(1100<x2&&x2<1300&&2400<y2&&y2<2470)){
		changeTopValue((2400-50));
		block_on=true;
		bottom=2400-50+1;
	}
	else if(1100<x4&&x4<1300&&2400<y4&&y4<2470){y_on=0;fall=true;peak=true;}
	else if((100<x3&&x3<300&&2200<y3&&y3<2270)&&!(100<x1&&x1<300&&2200<y1&&y1<2270)&&!(100<x2&&x2<300&&2200<y2&&y2<2270)){
		changeTopValue((2200-50));
		block_on=true;
		bottom=2200-50+1;
	}
	else if(100<x4&&x4<300&&2200<y4&&y4<2270){y_on=0;fall=true;peak=true;}
	else if((650<x3&&x3<780&&2200<y3&&y3<2250)&&!(650<x1&&x1<780&&2200<y1&&y1<2250)&&!(650<x2&&x2<780&&2200<y2&&y2<2250)){
		changeTopValue((2200-50));
		block_on=true;
		bottom=2200-50+1;
	}
	else if(650<x4&&x4<780&&2200<y4&&y4<2250){y_on=0;fall=true;peak=true;}
	else if((340<x3&&x3<380&&2000<y3&&y3<2010)&&!(340<x1&&x1<380&&2000<y1&&y1<2010)&&!(340<x2&&x2<380&&2000<y2&&y2<2010)){
		changeTopValue((2000-50));
		block_on=true;
		bottom=2000-50+1;
	}	
	else if(340<x4&&x4<380&&2000<y4&&y4<2010){y_on=0;fall=true;peak=true;peak=true;}
	else if((650<x3&&x3<700&&1850<y3&&y3<1880)&&!(650<x1&&x1<700&&1850<y1&&y1<1880)&&!(650<x2&&x2<700&&1850<y2&&y2<1880)){
		changeTopValue((1850-50));
		block_on=true;
		bottom=1850-50+1;
	}
	else if(650<x4&&x4<700&&1850<y4&&y4<1880){y_on=0;fall=true;peak=true;}
	else if((1100<x3&&x3<1330&&1850<y3&&y3<1880)&&!(1100<x1&&x1<1330&&1850<y1&&y1<1880)&&!(1100<x2&&x2<1330&&1850<y2&&y2<1880)){
		changeTopValue((1850-50));
		block_on=true;
		bottom=1850-50+1;
	}
	else if(1100<x4&&x4<1330&&1850<y4&&y4<1880){y_on=0;fall=true;peak=true;}		
	else if((900<x3&&x3<950&&1650<y3&&y3<1680)&&!(900<x2&&x2<950&&1650<y2&&y2<1680)&&!(900<x1&&x1<950&&1650<y1&&y1<1680)){
		changeTopValue((1650-50));
		block_on=true;
		bottom=1650-50+1;
	}
	else if(900<x4&&x4<950&&1650<y4&&y4<1680){y_on=0;fall=true;peak=true;}
	else if((80<x3&&x3<550&&1550<y3&&y3<1580)&&!(80<x2&&x2<550&&1550<y2&&y2<1580)&&!(80<x1&&x1<550&&1550<y1&&y1<1580)){
		changeTopValue((1550-50));
		block_on=true;
		bottom=1550-50+1;
	}
	else if(80<x4&&x4<550&&1550<y4&&y4<1580){y_on=0;fall=true;peak=true;}
	else if((80<x3&&x3<300&&1260<y3&&y3<1320)&&!(80<x2&&x2<300&&1260<y2&&y2<1320)&&!(80<x1&&x1<300&&1260<y1&&y1<1320)){
		changeTopValue((1260-50));
		block_on=true;
		bottom=1260-50+1;
	}
	else if(80<x4&&x4<300&&1260<y4&&y4<1320){y_on=0;fall=true;peak=true;}
	else if((310<x3&&x3<450&&1260<y3&&y3<1320)&&!(310<x2&&x2<450&&1260<y2&&y2<1320)&&!(310<x1&&x1<450&&1260<y1&&y1<1320)){
		changeTopValue((1260-50));
		block_on=true;
		bottom=1260-50+1;
	}
	else if(310<x4&&x4<450&&1260<y4&&y4<1320){y_on=0;fall=true;peak=true;}
	else if((460<x3&&x3<680&&1260<y3&&y3<1320)&&!(460<x2&&x2<680&&1260<y2&&y2<1320)&&!(460<x1&&x1<680&&1260<y1&&y1<1320)){
		changeTopValue((1260-50));
		block_on=true;
		bottom=1260-50+1;
	}	
	else if(460<x4&&x4<680&&1260<y4&&y4<1320){y_on=0;fall=true;peak=true;}
	else if((900<x3&&x3<950&&1350<y3&&y3<1380)&&!(900<x2&&x2<950&&1350<y2&&y2<1380)&&!(900<x1&&x1<950&&1350<y1&&y1<1380)){
		changeTopValue((1350-50));
		block_on=true;
		bottom=1350-50+1;
	}	
	else if(900<x4&&x4<950&&1350<y4&&y4<1380){y_on=0;fall=true;peak=true;}
	else if((1200<x3&&x3<1300&&1230<y3&&y3<1270)&&!(1200<x2&&x2<1300&&1230<y2&&y2<1270)&&!(1200<x1&&x1<1300&&1230<y1&&y1<1270)){
		changeTopValue((1230-50));
		block_on=true;
		bottom=1230-50+1;
	}	
	else if(1200<x4&&x4<1300&&1230<y4&&y4<1270){y_on=0;fall=true;peak=true;}
	else if((1180<x3&&x3<1300&&1010<y3&&y3<1040)&&!(1180<x2&&x2<1300&&1010<y2&&y2<1040)&&!(1180<x1&&x1<1300&&1010<y1&&y1<1040)){
		changeTopValue((1010-50));
		block_on=true;
		bottom=1010-50+1;
	}	
	else if(1180<x4&&x4<1300&&1010<y4&&y4<1040){y_on=0;fall=true;peak=true;}
	else if((500<x3&&x3<850&&850<y3&&y3<890)&&!(500<x2&&x2<850&&850<y2&&y2<890)&&!(500<x1&&x1<850&&850<y1&&y1<890)){
		changeTopValue((850-50));
		block_on=true;
		bottom=850-50+1;
	}	
	else if(500<x4&&x4<850&&850<y4&&y4<890){y_on=0;fall=true;peak=true;}
	else if((500<x3&&x3<550&&630<y3&&y3<670)&&!(500<x2&&x2<550&&630<y2&&y2<670)&&!(500<x1&&x1<550&&630<y1&&y1<670)){
		changeTopValue((630-50));
		block_on=true;
		bottom=630-50+1;
	}	
	else if(500<x4&&x4<550&&630<y4&&y4<670){y_on=0;fall=true;peak=true;}
	else if((100<x3&&x3<250&&450<y3&&y3<490)&&!(100<x2&&x2<250&&450<y2&&y2<490)&&!(100<x1&&x1<250&&450<y1&&y1<490)){
		changeTopValue((450-50));
		block_on=true;
		bottom=450-50+1;
	}	
	else if(100<x4&&x4<250&&450<y4&&y4<490){y_on=0;fall=true;peak=true;}
	else if((600<x3&&x3<800&&310<y3&&y3<370)&&!(600<x2&&x2<800&&310<y2&&y2<370)&&!(600<x2&&x2<800&&310<y2&&y2<370)){
		changeTopValue((310-50));
		block_on=true;
		bottom=310-50+1;
	}	
	else if(600<x4&&x4<800&&310<y4&&y4<370){y_on=0;fall=true;peak=true;}
	else if((100<x3&&x3<250&&150<y3&&y3<200)&&!(100<x2&&x2<250&&150<y2&&y2<200)&&!(100<x1&&x1<250&&150<y1&&y1<200)){
		changeTopValue((150-50));
		block_on=true;
		bottom=150-50+1;
	}	
	else if(100<x4&&x4<250&&150<y4&&y4<200){y_on=0;fall=true;peak=true;}
	else if((lastBlock==true)&&(700<x3&&x3<1300&&150<y3&&y3<180)&&!(700<x2&&x2<1300&&150<y2&&y2<180)&&!(700<x1&&x1<1300&&150<y1&&y1<180)){
		changeTopValue((150-50));
		block_on=true;
		bottom=150-50+1;
	}	
	else if(lastBlock==true&&700<x4&&x4<1300&&150<y4&&y4<180){y_on=0;fall=true;peak=true;}
	else if(peak==true){
		bottom=3040;
		fall=true;
		block_on=false;
	}
	else if(block_on==true){
		bottom=3040;
		fall=true;
		block_on=false;
	}
	/*goal*/
	if((monster_num==0)&&(1200<x2&&x2<1300&&20<y2&&y2<140||1200<x1&&x1<1300&&20<y1&&y1<140||1200<x3&&x3<1300&&20<y3&&y3<140||1200<x4&&x4<1300&&20<y4&&y4<140)){
		clearInterval(move_time);
		goal_time=setInterval(goal,1);	
	}
}

var goal_position=-500;
var goal_player_time;
function goal(){
	document.getElementsByClassName("time")[0].style.visibility='hidden';
	playerAllHidden();
	window.scrollTo(goal_position+=3,0);
	if(goal_position>=1375){
		left_px=1500;
		top_px=80;
		clearInterval(goal_time);	
		goal_player_time=setInterval(goalPlayer,10);
	}
}
var x=5.5;
var y=0.01;
function goalPlayer(){
		y+=0.1;	
		left_px+=x;
		top_px+=y;
		document.styleSheets[0].rules[0].style.left=left_px+'px';
		document.styleSheets[0].rules[1].style.left=left_px+'px';
		document.styleSheets[0].rules[2].style.left=left_px+'px';
		document.styleSheets[0].rules[3].style.left=left_px+'px';
		document.styleSheets[0].rules[4].style.left=left_px+'px';
		document.styleSheets[0].rules[5].style.left=left_px+'px';
		document.styleSheets[0].rules[6].style.left=left_px+'px';
		document.styleSheets[0].rules[7].style.left=left_px+'px';//총알 right
		document.styleSheets[0].rules[8].style.left=left_px+'px';//총알 left
		document.styleSheets[0].rules[0].style.top=top_px+'px';
		document.styleSheets[0].rules[1].style.top=top_px+'px';
		document.styleSheets[0].rules[2].style.top=top_px+'px';
		document.styleSheets[0].rules[3].style.top=top_px+'px';
		document.styleSheets[0].rules[4].style.top=top_px+'px';
		document.styleSheets[0].rules[5].style.top=top_px+'px';
		document.getElementsByClassName("stickman_jump_right")[0].style.visibility='visible';
		if(top_px>=500){
			document.getElementsByClassName("stickman_jump_right")[0].style.visibility='hidden';
			document.getElementsByClassName("stickman_stop")[0].style.visibility='visible';
			clearInterval(goal_player_time);
			document.getElementById('result_id').innerHTML ="Time["+mins + ":" + secs + ":" + "0" + tenths+"]"; //시간 표시
			document.getElementsByClassName("result")[0].style.visibility='visible';
		}
}

function increment(){ //타이머의 시간을 증가시켜 나가면서 분 초 밀리초를 계산하여 표시하는 함수
	 time++;
	 mins = Math.floor(time/10/60);
	 if(mins==0){secs = Math.floor(time/10);}
	 else{secs = Math.floor((time-(mins*600))/10);} //60초가 되었을때 secs부분을 00으로 초기화 시킨다
	 tenths = time % 10;
	 if(mins <10){mins = "0" + mins;}
	 if(secs <10){secs = "0" + secs;}
	 document.getElementById('Time').innerHTML ="Time["+mins + ":" + secs + ":" + "0" + tenths+"]"; //시간 표시
}

function playerAllHidden(){
	document.getElementsByClassName("stickman_stop")[0].style.visibility='hidden';
	document.getElementsByClassName("stickman_jump_left")[0].style.visibility='hidden';
	document.getElementsByClassName("stickman_jump_right")[0].style.visibility='hidden';
	document.getElementsByClassName("stickman_run_left")[0].style.visibility='hidden';
	document.getElementsByClassName("stickman_run_right")[0].style.visibility='hidden';
	document.getElementsByClassName("stickman_shooting_left")[0].style.visibility='hidden';
	document.getElementsByClassName("stickman_shooting_right")[0].style.visibility='hidden';
	document.getElementsByClassName("fire_right1")[0].style.visibility='hidden';
	document.getElementsByClassName("fire_right2")[0].style.visibility='hidden';
	document.getElementsByClassName("fire_right3")[0].style.visibility='hidden';
	document.getElementsByClassName("fire_right4")[0].style.visibility='hidden';
	document.getElementsByClassName("fire_left1")[0].style.visibility='hidden';
	document.getElementsByClassName("fire_left2")[0].style.visibility='hidden';
	document.getElementsByClassName("fire_left3")[0].style.visibility='hidden';
	document.getElementsByClassName("fire_left4")[0].style.visibility='hidden';

}
</script>
</head>
<body onLoad="init();">
	<img src="stage1.png" class="stage1"  width="1370" height="640">
	<img src="stage2.png" class="stage2"  width="1370" height="640">
	<img src="stage2.png" class="stage3"  width="1370" height="640">
	<img src="stage2.png" class="stage4"  width="1370" height="640">
	<img src="stage2.png" class="stage5"  width="1370" height="640">
	<img src="stage2.png" class="result_page"  width="1370" height="640">
	<img src="stop.png" class="stickman_stop" width="60" height="65">
	<img src="jump_left.png" class="stickman_jump_left">
	<img src="jump_right.png" class="stickman_jump_right">
	<img src="run_left.png" class="stickman_run_left">
	<img src="run_right.png" class="stickman_run_right">
	<img src="shooting_left.png" class="stickman_shooting_left">
	<img src="shooting_right.png" class="stickman_shooting_right">
	<img src="fire_left.png" class="fire_left1"width="60" height="50">
	<img src="fire_right.png" class="fire_right1"width="60" height="50">
	<img src="fire_left.png" class="fire_left2"width="60" height="50">
	<img src="fire_right.png" class="fire_right2"width="60" height="50">
	<img src="fire_left.png" class="fire_left3"width="60" height="50">
	<img src="fire_right.png" class="fire_right3"width="60" height="50">
	<img src="fire_left.png" class="fire_left4"width="60" height="50">
	<img src="fire_right.png" class="fire_right4"width="60" height="50">
	<img src="block.png" class="block1" width="60" height="60">
	<img src="long_block.png" class="block2" width="550" height="70">
	<img src="block.png" class="block3" width="70" height="69">
	<img src="block.png" class="block4_1" width="70" height="69">
	<img src="block.png" class="block4_2" width="80" height="69">
	<img src="long_block.png" class="block5" width="200" height="70">
	<img src="block.png" class="block6_1" width="70" height="50">
	<img src="block.png" class="block6_2" width="70" height="50">
	<img src="long_block.png" class="block7" width="200" height="70">
	<img src="block.png" class="block8" width="40" height="11">
	<img src="block.png" class="block9" width="50" height="30">
	<img src="long_block.png" class="block10" width="230" height="30">
	<img src="block.png" class="block11" width="50" height="30">
	<img src="long_block.png" class="block12_1" width="230" height="30">
	<img src="long_block.png" class="block12_2" width="240" height="30">
	<img src="block.png" class="block13" width="50" height="30">
	<img src="long_block.png" class="block14" width="220" height="60">
	<img src="long_block.png" class="block15" width="140" height="60">
	<img src="long_block.png" class="block16" width="220" height="60">
	<img src="block.png" class="block17_1" width="50" height="40">
	<img src="block.png" class="block17_2" width="50" height="40">
	<img src="block.png" class="block18_1" width="60" height="30">
	<img src="block.png" class="block18_2" width="60" height="30">
	<img src="long_block.png" class="block19_1" width="170" height="40">
	<img src="long_block.png" class="block19_2" width="180" height="40">
	<img src="block.png" class="block20" width="50" height="40">
	<img src="long_block.png" class="block21" width="150" height="40">
	<img src="long_block.png" class="block22" width="200" height="60">
	<img src="long_block.png" class="block23" width="150" height="50">
	<img src="long_block.png" class="block24_1" width="120" height="30">
	<img src="long_block.png" class="block24_2" width="120" height="30">
	<img src="long_block.png" class="block24_3" width="120" height="30">
	<img src="long_block.png" class="block24_4" width="120" height="30">
	<img src="long_block.png" class="block24_5" width="120" height="30">
	<img id="monster1" src="monster1.png" class="monster1" width="80" height="80">
	<img src="monster2.png" class="monster2" width="100" height="100">
	<img src="monster3.png" class="monster3" width="100" height="100">
	<img src="monster4.png" class="monster4" width="100" height="100">
	<img src="monster5.png" class="monster5"width="200" height="200">
	<img src="monster7.png" class="monster7"width="80" height="80">
	<img src="monster8.png" class="monster8"width="80" height="80">
	<img src="monster9_right.png" class="monster9_right"width="80" height="80">
	<img src="monster9_down.png" class="monster9_down"width="80" height="80">
	<img src="monster9_left.png" class="monster9_left"width="80" height="80">
	<img src="monster9_up.png" class="monster9_up"width="80" height="80">
	<img src="damage.png" class="monster_damage1" width="70" height="70">
	<img src="damage.png" class="monster_damage2" width="70" height="70">
	<img src="damage.png" class="monster_damage3" width="70" height="70">
	<img src="damage.png" class="monster_damage4" width="70" height="70">
	<img src="damage.png" class="monster_damage5" width="70" height="70">
	<img src="damage.png" class="monster_damage6" width="70" height="70">
	<img src="damage.png" class="monster_damage7" width="70" height="70">
	<img src="damage.png" class="monster_damage8" width="70" height="70">
	<img src="damage.png" class="monster_damage9" width="70" height="70">
	<img src="goal.png" class="goal"width="120" height="100">
	<img src="goal2.png" class="goal2"width="150" height="100">
	<img src="hp.png" class="hp1" id='hp1' width="40" height="40">
	<img src="hp.png" class="hp2" id='hp2' width="40" height="40">
	<img src="hp.png" class="hp3" id='hp3' width="40" height="40">
	<img src="Congratulation.gif" class="cong" width="650" height="200">
	<font face="Comic Sans MS"><a name="1" class="mark1">0m</font>
	<font face="Comic Sans MS"><a name="2" class="mark2">5m</font>
	<font face="Comic Sans MS"><a name="3" class="mark3">10m</font>
	<font face="Comic Sans MS"><a name="4" class="mark4">15m</font>
	<font face="Comic Sans MS"><a name="5" class="mark5">20m</font>
	<font face="Comic Sans MS"><a name="6" class="mark6">25m</font>
	<font face="Comic Sans MS"><a name="7" class="mark7">30m</font>
	<font face="Comic Sans MS"><a name="8" class="mark8">35m</font>
	<font face="Comic Sans MS"><a name="9" class="mark9">40m</font>
	<font face="Comic Sans MS"><a name="10" class="mark10">45m</font>
	<font face="Comic Sans MS"><a name="11" class="mark11">50m</font>
	<font face="Comic Sans MS"><a name="12" class="mark12">55m</font>
	<font face="Comic Sans MS"><a name="13" class="mark13">60m</font>
	<font face="Comic Sans MS"><a name="14" class="mark14">65m</font>
	<font face="Comic Sans MS"><a name="15" class="mark15">70m</font>
	<canvas id="canvas" width="1360" height="3180"></canvas>
	
	<div class="gameover">
		<h1><b>GAME OVER</b></h1>
	</div>
	
	<h1 class="time" id="Time">Time[00:00:00]</h1>

</body>

<body>
	<div id="start">
		<button class="start_button"  onClick="start();">START</button>
	</div>
	<div id="restart">
	    <button class="restart_button"  onClick="window.location.reload();">RESTART</button>      
	</div>
	<h1 id="result_id"class="result">Time:</h1>	
</body>
</html>

This snippet took 0.24 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).