From 64f9faf277fcda47ef04084b6b304da5268c231d Mon Sep 17 00:00:00 2001
From: Gnieark
Date: Wed, 29 Jun 2016 12:55:45 +0200
Subject: [PATCH] try to draw 1000*1000 svg grig
---
src/arenas/tron/js.js | 14 +++++++++-----
src/arenas/tron/public.php | 5 ++---
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/arenas/tron/js.js b/src/arenas/tron/js.js
index 24cf07d..489740b 100644
--- a/src/arenas/tron/js.js
+++ b/src/arenas/tron/js.js
@@ -13,10 +13,14 @@ function createElemNS(type,attributes){
function tron(bot1,bot2,xdcheck){
+ //empty
+ while (document.getElementById('fightResult').firstChild) {
+ document.getElementById('fightResult').removeChild(document.getElementById('fightResult').firstChild);
+ }
+ // draw border;
+ var svg = createElem('svg',{'id':'map','width':'1000','height':'1000'});
+ var rect=createElemNS('rect',{'x':'0','y':'0','width':'1000','height':'1000','style':'stroke:#000000; fill:none;'});
+ svg.appendChild(rect);
- //var svgDoc = svg.contentDocument;
- var rect=createElemNS('rect',{'x':'10','y':'10','width':'50','height':'80','style':'stroke:#000000; fill:none;'});
-
- document.getElementById("map").appendChild(rect);
-
+ document.getElementById("fightResult").appendChild(svg);
}
diff --git a/src/arenas/tron/public.php b/src/arenas/tron/public.php
index 1ceb7ca..e6f3618 100644
--- a/src/arenas/tron/public.php
+++ b/src/arenas/tron/public.php
@@ -34,7 +34,6 @@ $bots=get_Bots_Array('tron');
-
+
+
\ No newline at end of file