You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
950 B
JavaScript

function createElem(type,attributes){
var elem=document.createElement(type);
for (var i in attributes)
{elem.setAttribute(i,attributes[i]);}
return elem;
}
function createElemNS(type,attributes){
var elem=document.createElementNS("http://www.w3.org/2000/svg",type);
for (var i in attributes)
{elem.setAttributeNS(null,i,attributes[i]);}
return elem;
}
function tron(bot1,bot2,xdcheck){
//empty
while (document.getElementById('fightResult').firstChild) {
document.getElementById('fightResult').removeChild(document.getElementById('fightResult').firstChild);
}
// draw border;
var svg = createElemNS('svg',{'id':'map','width':'200','height':'200','viewBox':'0 0 1000 1000'});
var rect=createElemNS('rect',{'x':'0','y':'0','width':'1000','height':'1000','style':'stroke:#000000; fill:none;'});
svg.appendChild(rect);
document.getElementById("fightResult").appendChild(svg);
}