mirror of https://github.com/dirtbags/tanks.git
jstanks: wrap angle/width like ctanks does
This commit is contained in:
parent
655c7408eb
commit
9c0699c6e2
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue