Permalink
Browse files

moveDrop

  • Loading branch information...
1 parent db316e6 commit 0177754aacc97417a8cab00d70699dab4c21a003 @tj committed Sep 3, 2011
Showing with 9 additions and 5 deletions.
  1. +9 −5 particles/public/game.js
View
@@ -33,9 +33,13 @@ o(function(){
while (drops--) {
drop = o('<div class="rain"></div>');
o('body').append(drop);
- drop.css({
- left: Math.random() * window.innerWidth
- , top: Math.random() * window.innerHeight
- });
+ moveDrop(drop);
}
-});
+});
+
+function moveDrop(drop) {
+ var x = Math.random() * window.innerWidth
+ , y = Math.random() * window.innerHeight;
+
+ drop.css({ left: x, top: y });
+}

0 comments on commit 0177754

Please sign in to comment.