datenspuren stupsable clouds

This commit is contained in:
Astro 2011-09-17 02:58:58 +02:00
parent 5a1d71a07e
commit 8a5ce0f7f0

View File

@ -86,6 +86,14 @@ function Cloud() {
this.y = Math.floor(Math.random() * screen.height);
this.el = $('<img class="backgroundcloud" src="images/pixelcloud.png"/>');
$('body').append(this.el);
var that = this;
this.el.mousemove(function(ev) {
if (ev.offsetX < 36)
that.speedX += 10;
else
that.speedX -= 10;
});
}
Cloud.prototype.update = function() {