Add new retro theme & fix touch input problem

This commit is contained in:
Marcel
2018-02-18 12:45:54 +01:00
parent a289edaae9
commit d5cd080aba
9 changed files with 122 additions and 35 deletions

View File

@@ -1,27 +1,27 @@
const hammertime = new Hammer(document.getElementById("tetris"));
hammertime.on('swipeleft', (e) => {
keys.left.action();
game.g.keys.left.action();
});
hammertime.on('swiperight', (e) => {
keys.right.action();
game.g.keys.right.action();
});
hammertime.on('swipeup', () => {
keys.holdTile.action();
game.g.keys.holdTile.action();
});
hammertime.on('pandown swipedown', (e) => {
keys.down.action();
game.g.keys.down.action();
});
hammertime.on('tap', (e) => {
if (e.tapCount >= 2) {
keys.rotateRight.action();
game.g.keys.rotateRight.action();
}
});
hammertime.on('press', () => {
keys.down.action();
game.g.keys.down.action();
});