Browse Source

Updating Physics Platformer

Josh Engebretson 10 years ago
parent
commit
938a5deed5

+ 5 - 5
PhysicsPlatformer/Resources/Components/Background.js

@@ -7,11 +7,11 @@ var component = function(self) {
 
     self.postUpdate = function() {
 
-        //var pos = cameraNode.position2D;
-        //pos[1] -= 4;
-        //self.node.position2D = pos;
-        //var zoom = 4.0 - camera.zoom;
-        //self.node.scale2D = [zoom , zoom];
+        var pos = cameraNode.position2D;
+        pos[1] -= 4;
+        self.node.position2D = pos;
+        var zoom = 4.0 - camera.zoom;
+        self.node.scale2D = [zoom , zoom];
 
     }
 

+ 3 - 1
PhysicsPlatformer/Resources/Components/Player.js

@@ -69,11 +69,13 @@ exports.component = function(self) {
 
     }
 
+    cameraNode.position = node.position;
+
   }
 
   self.postUpdate = function() {
 
-    cameraNode.position = node.position;
+
   }
 
   function setAnimation(animName) {

+ 6 - 6
PhysicsPlatformer/Resources/Scenes/Scene.scene

@@ -5,10 +5,10 @@
 	<attribute name="Smoothing Constant" value="50" />
 	<attribute name="Snap Threshold" value="5" />
 	<attribute name="Elapsed Time" value="0" />
-	<attribute name="Next Replicated Node ID" value="23439" />
-	<attribute name="Next Replicated Component ID" value="29963" />
-	<attribute name="Next Local Node ID" value="16778740" />
-	<attribute name="Next Local Component ID" value="16777402" />
+	<attribute name="Next Replicated Node ID" value="26319" />
+	<attribute name="Next Replicated Component ID" value="33451" />
+	<attribute name="Next Local Node ID" value="16778764" />
+	<attribute name="Next Local Component ID" value="16777422" />
 	<attribute name="Variables" />
 	<attribute name="Variable Names" value="" />
 	<component type="Octree" id="2" />
@@ -34,7 +34,7 @@
 			<attribute name="Near Clip" value="0" />
 			<attribute name="Orthographic" value="true" />
 			<attribute name="Orthographic Size" value="8" />
-			<attribute name="Zoom" value="0.5" />
+			<attribute name="Zoom" value="0.9" />
 		</component>
 	</node>
 	<node id="370">
@@ -76,7 +76,7 @@
 		<component type="DirectionalLight2D" id="18606">
 			<attribute name="Color" value="1 1 1 0.15" />
 			<attribute name="Cast Shadows" value="true" />
-			<attribute name="Num Rays" value="256" />
+			<attribute name="Num Rays" value="512" />
 		</component>
 	</node>
 	<node id="19834">