self.collision = function () {
if(collisions(this.x, this..y, this.width, this..height)) {
console.log("detected");
}
}
function collisions (rect1, rect2) {
var rect1 = tank;
var rect2 = enemyTank;
return (rect1.x < rect2.x + rect2.width &&
rect1.x + rect1.width > rect2.x &&
rect1.y < rect2.y + rect2.height &&
rect1.height + rect1.y > rect2.y)
}