Tank game in JavaScript