Created
January 8, 2012 15:08
-
-
Save nathanpc/1578631 to your computer and use it in GitHub Desktop.
Non-Working Movement Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var basketx = 0; | |
var basket = 4; | |
var t; | |
function loaded() { | |
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false); | |
var s = (window.innerWidth / 2) - (128 / 2); | |
t = self.setInterval("moveBasket('" + s + "')", 10); | |
} | |
function moveBasket(x) { | |
if (basketx != x) { | |
$("#basket").css("left", basket * 16 + "px"); | |
basket = basketx++ /8; | |
console.log("basketx: " + basketx + " - basket: " + basket); | |
} else if (basketx == x) { | |
t = window.clearInterval(t); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment