jstanks: wrap angle/width like ctanks does

This commit is contained in:
Alyssa Milburn 2014-07-28 21:47:25 +02:00
parent 655c7408eb
commit 9c0699c6e2
1 changed files with 2 additions and 2 deletions

View File

@ -687,8 +687,8 @@ var resetTanks = function() {
tank.color = document.getElementsByName('color')[0].value; tank.color = document.getElementsByName('color')[0].value;
for (var i = 0; i < 10; i++) { for (var i = 0; i < 10; i++) {
var range = 1*document.getElementsByName('s'+i+'r')[0].value; var range = 1*document.getElementsByName('s'+i+'r')[0].value;
var angle = 1*document.getElementsByName('s'+i+'a')[0].value; var angle = (1*document.getElementsByName('s'+i+'a')[0].value) % 360;
var width = 1*document.getElementsByName('s'+i+'w')[0].value; var width = (1*document.getElementsByName('s'+i+'w')[0].value) % 360;
var turret = 1*document.getElementsByName('s'+i+'t')[0].checked; var turret = 1*document.getElementsByName('s'+i+'t')[0].checked;
if (range) { if (range) {
tank.addSensor(range, angle, width, turret); tank.addSensor(range, angle, width, turret);