} this.drawLee = function() { this.generatePoints(); //begPoint = {i:188, j:188}; //endPoint = {i:2, j:2}; //context.lineWidth = 1; //context.strokeStyle = "#000"; this.clearField(); this.showBorders(); this.drawField(); //this.drawPoints(); this.drawCurrent(); this.generateObstacle(); this.drawObstacle(); //this.calc(); } this.FPS = function() { //context.font = "bold 14px Sans"; //context.fillStyle = "red"; var elapsed=new Date().getTime()-startTime; //framesDrawn++; document.getElementById("fps").value = Math.round(framesDrawn/(elapsed/1000))+"fps"; //if(bEnd) clearInterval(fps); //context.fillText(Math.round(framesDrawn/(elapsed/1000))+"fps",20,20); //framesDrawn=0; } var fps = null; this.draw = function(settings) { context = settings.mainLayer; wcontext = settings.wayLayer; //context.save(); //fps = setInterval(function() {self.FPS()}, 1000/2); //setTimeout(this.drawLee(),0); this.drawLee(); //context.restore(); } }