changeset 50:1cba7ddd0e74

update and add missing graphics
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Tue, 09 Aug 2011 23:35:46 +0200
parents 652df90a431e
children 4af42930a7c9
files back.png bars.png bat.png beast.png brain.png dw.js eye.png jack.png jello.png ladder.png robot.png tree.png wall.png water.png weed.png white.png
diffstat 16 files changed, 10 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
Binary file back.png has changed
Binary file bars.png has changed
Binary file bat.png has changed
Binary file beast.png has changed
Binary file brain.png has changed
--- a/dw.js	Sun Mar 21 14:43:15 2010 +0100
+++ b/dw.js	Tue Aug 09 23:35:46 2011 +0200
@@ -432,17 +432,6 @@
         return false;
     };
 
-    module.loop = function () {
-        // The main game loop.
-
-        module.player.control();
-        for (var i=0; i<module.sprites.length; ++i) {
-            var sprite = module.sprites[i];
-            sprite.update();
-        }
-        setTimeout(module.loop, 50);
-    };
-    
     module.init = function () {
         document.onkeydown = module.keydown;
         document.onkeyup = module.keyup;
@@ -458,6 +447,15 @@
             y = pos[1]; 
         }
         module.player = module.Player(x, y);
+        setInterval(function () {
+            // The main game loop.
+
+            module.player.control();
+            for (var i=0; i<module.sprites.length; ++i) {
+                var sprite = module.sprites[i];
+                sprite.update();
+            }
+        }, 50);
     };
 
     module.init();
@@ -466,5 +464,5 @@
 };
 
 
-Game().loop();
+Game()
 
Binary file eye.png has changed
Binary file jack.png has changed
Binary file jello.png has changed
Binary file ladder.png has changed
Binary file robot.png has changed
Binary file tree.png has changed
Binary file wall.png has changed
Binary file water.png has changed
Binary file weed.png has changed
Binary file white.png has changed