var self = this;
self.canvas = document.getElementById("myCanvas");
self.context = self.canvas.getContext("2d");
var drawGrid = function(w, h) {
ctx.canvas.width = w;
ctx.canvas.height = h;
for (x=0;x<=w;x+=20) {
for (y=0;y<=h;y+=20) {
ctx.moveTo(x, 0);
ctx.lineTo(x, h);
ctx.stroke();
ctx.moveTo(0, y);
ctx.lineTo(w, y);
ctx.stroke();
}
}
};
drawGrid(1200, 700, "grid");
self.key = false;
self.randomDirection = false;
self.startGame = function() {
setInterval(self.updateGameArea, 1.955);
setInterval(self.text, 0.8555);
setInterval(enemyTank.getRandomDirection, 1000);