touch smi-working

This commit is contained in:
garrettdreyfus 2014-05-18 11:43:49 -04:00
parent 990fb5c6e8
commit c5f8bfc216
3 changed files with 25 additions and 1 deletions

9
hammer.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -21,12 +21,15 @@
<div style='margin: 0 auto; width: 100%;text-align: center; margin-top: 20px;'><h1 style='color:#ecf0f1; font-size:50px;'>Hextris</h1>
<span id="score">0 (x1)</span>
</div>
<canvas id="canvas" width = '700' height = '700' style='background-color:#2c3e50; position:absolute;left:50%;margin-left:-350px'></canvas>
<div id="leftTap" style="position:absolute; left:0; top:0; height:100%;width:50%"></div>
<div id="rightTap" style="position:absolute; left:50%; top:0; height:100%;width:50%"></div>
<script src="math.js"></script>
<script src="entities.js"></script>
<script src="math.js"></script>
<script src="hammer.min.js"></script>
<script src="keypress.min.js"></script>
<script src="input.js"></script>
<script src="checking.js"></script>

View file

@ -17,7 +17,19 @@ keypress.register_combo({
}
},
});
var tapLeft = Hammer(document.getElementById("leftTap")).on("tap", function(event) {
if (gameState != 1) {
init();
}
MainClock.rotate(1)
});
var tapRight = Hammer(document.getElementById("rightTap")).on("tap", function(event) {
if (gameState != 1) {
init();
}
MainClock.rotate(-1)
});
keypress.register_combo({
keys: "space",
on_keyup: function(){