Browse Source

Formatting

Josh Engebretson 11 years ago
parent
commit
8e2ef0b980

+ 6 - 6
Light2DExample/Resources/Components/Background.js

@@ -8,14 +8,14 @@ function start() {
     var sprite2D = node.createComponent("StaticSprite2D");
     var sprite2D = node.createComponent("StaticSprite2D");
     sprite2D.sprite = game.cache.getResource("Sprite2D", "Backgrounds/background.jpg");
     sprite2D.sprite = game.cache.getResource("Sprite2D", "Backgrounds/background.jpg");
     sprite2D.layer = -100;
     sprite2D.layer = -100;
-    
+
     var width = sprite2D.texture.width;
     var width = sprite2D.texture.width;
     var height = sprite2D.texture.height;
     var height = sprite2D.texture.height;
-    
+
     var viewWidth = game.viewport.width;
     var viewWidth = game.viewport.width;
-    var viewHeight = game.viewport.height;       
-    
-    node.scale2D = [viewWidth/width, viewHeight/height];
+    var viewHeight = game.viewport.height;
+
+    node.scale2D = [viewWidth / width, viewHeight / height];
 
 
 }
 }
 
 
@@ -23,4 +23,4 @@ function start() {
 // fixme must have an update
 // fixme must have an update
 function update(timeStep) {
 function update(timeStep) {
 
 
-}
+}

+ 1 - 1
Light2DExample/Resources/Components/Light.js

@@ -36,7 +36,7 @@ function update(timeStep) {
         node.position2D = prev;
         node.position2D = prev;
         movex = -movex;
         movex = -movex;
     }
     }
-    
+
     if (p[1] < -Light2DExample.halfHeight || p[1] > Light2DExample.halfHeight) {
     if (p[1] < -Light2DExample.halfHeight || p[1] > Light2DExample.halfHeight) {
         node.position2D = prev;
         node.position2D = prev;
         movey = -movey;
         movey = -movey;

+ 2 - 2
Light2DExample/Resources/Components/ShadowCaster.js

@@ -15,10 +15,10 @@ node.position2D = [x, y];
 
 
 function start() {
 function start() {
 
 
-	
+
 }
 }
 
 
-function update(timeStep) {	
+function update(timeStep) {
 
 
 
 
 }
 }

+ 28 - 29
Light2DExample/Resources/Scripts/main.js

@@ -1,4 +1,3 @@
-
 // This script is the main entry point of the game
 // This script is the main entry point of the game
 
 
 Light2DExample = {};
 Light2DExample = {};
@@ -6,46 +5,46 @@ Light2DExample = {};
 // called at the start of play
 // called at the start of play
 function Start() {
 function Start() {
 
 
-	var game = Atomic.game;
-	
-	Light2DExample.halfWidth = game.graphics.width * Atomic.PIXEL_SIZE * 0.5;
+    var game = Atomic.game;
+
+    Light2DExample.halfWidth = game.graphics.width * Atomic.PIXEL_SIZE * 0.5;
     Light2DExample.halfHeight = game.graphics.height * Atomic.PIXEL_SIZE * 0.5;
     Light2DExample.halfHeight = game.graphics.height * Atomic.PIXEL_SIZE * 0.5;
 
 
-	// create a 2D scene
-	game.createScene2D();
-		
-	var scene = game.scene;
-	
-    var physicsWorld = scene.createComponent("PhysicsWorld2D");        
+    // create a 2D scene
+    game.createScene2D();
+
+    var scene = game.scene;
+
+    var physicsWorld = scene.createComponent("PhysicsWorld2D");
     physicsWorld.continuousPhysics = false;
     physicsWorld.continuousPhysics = false;
     physicsWorld.subStepping = false;
     physicsWorld.subStepping = false;
-    
+
     var lightGroupNode = scene.createChild("LightGroup");
     var lightGroupNode = scene.createChild("LightGroup");
-    
+
     var lightGroup = lightGroupNode.createComponent("Light2DGroup");
     var lightGroup = lightGroupNode.createComponent("Light2DGroup");
     lightGroup.setPhysicsWorld(physicsWorld);
     lightGroup.setPhysicsWorld(physicsWorld);
     lightGroup.ambientColor = [.8, .8, .8, .5];
     lightGroup.ambientColor = [.8, .8, .8, .5];
-    
+
     Light2DExample.lightGroup = lightGroup;
     Light2DExample.lightGroup = lightGroup;
-    
-	var node = game.scene.createChild();
-	node.createJSComponent("Background");
-	node.createJSComponent("Physics");
-	
-	for (var i = 0; i < 4; i++) {
-	
-	    var lightNode = scene.createChild("LightNode");
+
+    var node = game.scene.createChild();
+    node.createJSComponent("Background");
+    node.createJSComponent("Physics");
+
+    for (var i = 0; i < 4; i++) {
+
+        var lightNode = scene.createChild("LightNode");
         lightNode.createJSComponent("Light");
         lightNode.createJSComponent("Light");
 
 
-	}
-	
-	for (var i = 0; i < 16; i++) {
-	
-	    var shadowCasterNode = scene.createChild("ShadowCaster");
+    }
+
+    for (var i = 0; i < 16; i++) {
+
+        var shadowCasterNode = scene.createChild("ShadowCaster");
         shadowCasterNode.createJSComponent("ShadowCaster");
         shadowCasterNode.createJSComponent("ShadowCaster");
 
 
-	}
-	
+    }
+
 
 
 }
 }
 
 
@@ -54,4 +53,4 @@ function Update(timeStep) {
 
 
     physicsWorld.drawDebugGeometry();
     physicsWorld.drawDebugGeometry();
 
 
-}
+}