This commit is contained in:
meadowstream 2014-05-25 01:12:06 -04:00
commit 63d33c7e11
3 changed files with 25 additions and 36 deletions

View file

@ -145,7 +145,7 @@ var colorSounds = {"#e74c3c": new Audio("../sounds/lowest.ogg"),
function Clock(sideLength) {
this.fillColor = '#2c3e50';
this.angularVelocity = 0;
this.position = 0;
this.position = 1;
this.dy = 0;
this.sides = 6;
this.blocks = [];
@ -252,12 +252,7 @@ function Clock(sideLength) {
else {
history[count].rotate += steps;
}
while (this.position < 0) {
this.position += 6;
}
this.position = this.position % this.sides;
this.position = (this.position + this.sides) % this.sides;
this.blocks.forEach(function(blocks) {
blocks.forEach(function(block) {
block.targetAngle = block.targetAngle - steps * 60;

View file

@ -17,22 +17,6 @@ keypress.register_combo({
}
});
keypress.register_combo({
keys: "enter",
on_keydown: function() {
var shouldAnimLoop = 0;
if (gameState === -1) {
shouldAnimLoop = 1;
}
init();
if (shouldAnimLoop) {
requestAnimFrame(animLoop);
}
}
});
keypress.register_combo({
keys: "p",
on_keydown: function() {
@ -66,18 +50,28 @@ keypress.register_combo({
importHistory();
}
});
var tapLeft = Hammer(document.getElementById("leftTap")).on("tap", function(event) {
if (gameState != 1) {
init();
keypress.register_combo({
keys: "enter",
on_keydown: function() {
if (gameState != 1 && gameState != -2) {
init();
}
}
MainClock.rotate(1);
});
var tapRight = Hammer(document.getElementById("rightTap")).on("tap", function(event) {
if (gameState != 1) {
init();
}
MainClock.rotate(-1);
});
document.body.addEventListener('touchstart', function(e){
if( e.changedTouches[0].pageX<window.innerWidth/2){
if (gameState != 1 && gameState != -2) {
init();
}
MainClock.rotate(1);
}
if( e.changedTouches[0].pageX>window.innerWidth/2){
if (gameState != 1 && gameState != -2) {
init();
}
MainClock.rotate(-1);
}
}, false)

View file

@ -364,4 +364,4 @@ function checkGameOver() {
window.onblur = function (e) {
if (gameState == 1) gameState = -1;
};
};