Explorar o código

change starting frames of physicists

Kevin Heinicke %!s(int64=10) %!d(string=hai) anos
pai
achega
a856064ec8
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      js/views/physicist.js

+ 3 - 3
js/views/physicist.js

@@ -1,21 +1,21 @@
 (function(window) {
 (function(window) {
     function PhysicistView(modelObject){
     function PhysicistView(modelObject){
         // this.graphics.beginFill("red").drawCircle(0, 0, window.cell_size * 0.9 / 2);
         // this.graphics.beginFill("red").drawCircle(0, 0, window.cell_size * 0.9 / 2);
+        // TODO: read those values from json/whatever
         var width = 131;
         var width = 131;
         var height = 135;
         var height = 135;
         var spriteSheet = new createjs.SpriteSheet({
         var spriteSheet = new createjs.SpriteSheet({
             framerate: 15,
             framerate: 15,
             images: ["img/physicist/physicist-spritesheet.png"],
             images: ["img/physicist/physicist-spritesheet.png"],
             frames: {regX: height/2, height: height, count: 8, regY: width/2, width: width},
             frames: {regX: height/2, height: height, count: 8, regY: width/2, width: width},
-            animations: {
-                run: [0, 7]
-            }
+            animations: {run: [0, 7]}
         });
         });
         var scale = width > height ? cell_size / width : cell_size / height;
         var scale = width > height ? cell_size / width : cell_size / height;
         this.scaleX = scale;
         this.scaleX = scale;
         this.scaleY = scale;
         this.scaleY = scale;
         this.spriteSheet = spriteSheet;
         this.spriteSheet = spriteSheet;
         this.gotoAndPlay("run");
         this.gotoAndPlay("run");
+        this.currentAnimationFrame = Math.floor(Math.random() * 7);
         this.model = modelObject;
         this.model = modelObject;
     }
     }