<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="0">
<meta http-equiv="last-modified" content="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://l2gj.gev1.ru/jquery-1.8.0.min.js"></script>
<script type="text/javascript">
var _units=new Array();
var _xunits=new Array();
var _xhostile=new Array(0,40,80,120,160);
var count=0;
var stick;
var new_input;
var new_unit;
document.ready=function(){
stick = document.createElement("INPUT");
stick.setAttribute("value",count);
var new_put=document.getElementById('stick');
new_put.appendChild(stick);
}
function UnitMov(){
for(var i=0;i<=count;i++)
{ stick.value=i;
_xunits[i]=_xunits[i]+2;
_units[i].style.top=_xunits[i]+'px';
if(_xunits[i]>400){
count=count-1;
new_input.removeChild(_units[i]);
//alert("A")
_units[i]=_units[count];
//alert("И")
_xunits[i]=_xunits[count];
//alert("B")
}
}
}
function UnitCr(){
var round = Math.round(Math.random() * 4);
new_unit=document.createElement('div');
new_unit.innerHTML='<img src="http://l2gj.gev1.ru/img/sq.png" />';
new_unit.setAttribute("style","left:"+_xhostile[round]+"px;top:0px;position:absolute;");
new_unit.setAttribute("id",count);
_units[count]=new_unit;
_xunits[count]=0;
new_input=document.getElementById('hostile');
new_input.appendChild(_units[count]);
count=count+1;
}
var _unitmovetimer=setInterval(UnitMov, 10);
var _unitcrtimer=setInterval(UnitCr, 1000);
</script>
<style type="text/css">
body{background-color:#000000;}
.ground{border:1px solid #ffffff;margin: 1px auto;width:200px;height:400px;position:relative;}
#as{position: absolute; top: 320px; left: 160px; box-shadow: 1px 1px 5px #000000; }
#hostile{width:200px;height:400px;position:relative;}
#unit{background:url(http://l2gj.gev1.ru/img/sq.png);width:40px;height:40px;position:absolute;left:0px;right:0px;display:inline;}
#stick{border:1px solid #ffffff;margin: 1px auto;width:100px;height:50px;position:absolute;background-color:#ffffff;color:#000000;left:200px;top:0px;}
</style>
<body>
<div class="ground">
<div id="stick"></div>
<div id="hostile"></div>
</div>
</body></html>