Options for collision

This commit is contained in:
Thomas FORGIONE
2015-04-22 11:02:54 +02:00
parent 7b5b94947a
commit 8a486cd723
3 changed files with 15 additions and 11 deletions

17
prototype/js/main.js vendored
View File

@@ -22,19 +22,18 @@ function init() {
// Add the listener on the button
document.getElementById('reset').onclick = function() { cameras.mainCamera().reset(); };
var fullarrow = document.getElementById('fullarrow');
fullarrow.onclick = function() {
if (fullarrow.innerHTML === 'Full arrow') {
fullarrow.innerHTML = "Half arrow";
} else {
fullarrow.innerHTML = "Full arrow";
}
fullarrow.onchange = function() {
cameras.map(function(camera) {
if (camera instanceof FixedCamera) {
camera.fullArrow = !camera.fullArrow;
camera.fullArrow = fullarrow.checked;
}
});
};
}
var collisions = document.getElementById('collisions');
collisions.onchange = function() {
cameras.mainCamera().collisions = collisions.checked;
}
// on initialise le moteur de rendu
container = document.getElementById('container');