Browse Source

Updates (PhysicsPlatformer will be rewritten)

Josh Engebretson 11 years ago
parent
commit
6d54575442

+ 4 - 0
PhysicsPlatformer/Resources/Components/Background.js

@@ -25,3 +25,7 @@ function postUpdate() {
     
 
 }
+
+// fixme must have an update
+function update(timeStep) {
+}

+ 4 - 0
PhysicsPlatformer/Resources/Components/Level.js

@@ -231,6 +231,10 @@ function parsePhysics() {
     }
 }
 
+// fixme must have an update
+function update(timeStep) {
+}
+
 function start() {
     self.listenToEvent(null, "PhysicsBeginContact2D", self.onPhysicsBeginContact2D);
     parsePhysics();

+ 6 - 2
PhysicsPlatformer/Resources/Components/Vine.js

@@ -55,5 +55,9 @@ function start() {
     constraintRope.otherBody = prevBody;
     constraintRope.ownerBodyAnchor = [x, y];
     constraintRope.maxLength = (NUM_OBJECTS + 0.01);
-
-}
+    
+    
+}
+    // fixme must have an update
+function update(timeStep) {
+}

+ 15 - 22
PhysicsPlatformer/Resources/PhysicsPlatformer.js → PhysicsPlatformer/Resources/Script/Main.js

@@ -1,10 +1,9 @@
-cache = GetResourceCache();
-graphics = GetGraphics();
-renderer = GetRenderer();
-engine = GetEngine();
-input = GetInput();
-ui = GetUI();
-gameui = GetGameUI();
+var game = Atomic.game
+cache = game.cache;
+graphics = game.graphics;
+renderer = game.renderer;
+engine = game.engine;
+input = game.input;
 
 
 var halfWidth = graphics.width * Atomic.PIXEL_SIZE * 0.5;
@@ -25,7 +24,7 @@ function Start() {
 
 function Update() {
     
-    // physicsWorld.drawDebugGeometry();
+   //physicsWorld.drawDebugGeometry();
 
 }
 
@@ -34,24 +33,18 @@ function CreateScene() {
 
     daytime = false;
 
-    scene = new Atomic.Scene();
-    scene.createComponent("Octree");
-    scene.createComponent("DebugRenderer");
+    game.createScene2D();
+    scene = game.scene;
+    cameraNode = game.cameraNode;
+    camera = game.camera;
+
     
     physicsWorld = scene.createComponent("PhysicsWorld2D");
     
     physicsWorld.continuousPhysics = false;
     physicsWorld.subStepping = false;
-        
-    cameraNode = scene.createChild("Camera");
-    cameraNode.position = [0.0, 0.0, -10.0];
-    camera = cameraNode.createComponent("Camera");
-    camera.orthographic = true;
-    camera.orthoSize = graphics.height * Atomic.PIXEL_SIZE;       
-    
-    var viewport = new Atomic.Viewport(scene, camera);
-    renderer.setViewport(0, viewport);
 
+        
     // currently lightgroup must be created after viewport 0 is set
     lightGroupNode = scene.createChild("LightGroup");
     lightGroup = lightGroupNode.createComponent("Light2DGroup");
@@ -72,8 +65,8 @@ function CreateScene() {
         lightGroup.addLight(TheSun);
     }
     
-    uiNode = scene.createChild("UI");
-    uiNode.createJSComponent("UI");
+    //uiNode = scene.createChild("UI");
+    //uiNode.createJSComponent("UI");
  
     levelNode = scene.createChild("Level");
     levelNode.createJSComponent("Level");

+ 30 - 30
PhysicsPlatformer/SourceArt/Hero/Hero.scml

@@ -1,36 +1,36 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <spriter_data scml_version="1.0" generator="BrashMonkey Spriter" generator_version="r2">
     <folder id="0" name="Frames">
-        <file id="0" name="Idle__009.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="1" name="Idle__000.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="2" name="Idle__001.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="3" name="Idle__002.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="4" name="Idle__003.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="5" name="Idle__004.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="6" name="Idle__005.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="7" name="Idle__006.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="8" name="Idle__007.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="9" name="Idle__008.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
-        <file id="10" name="Run__009.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="11" name="Run__000.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="12" name="Run__001.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="13" name="Run__002.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="14" name="Run__003.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="15" name="Run__004.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="16" name="Run__005.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="17" name="Run__006.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="18" name="Run__007.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="19" name="Run__008.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
-        <file id="20" name="Jump__005.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
-        <file id="21" name="Jump__000.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
-        <file id="22" name="Jump__001.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
-        <file id="23" name="Jump__002.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
-        <file id="24" name="Jump__003.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
-        <file id="25" name="Jump__004.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
-        <file id="26" name="Jump__006.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
-        <file id="27" name="Jump__007.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
-        <file id="28" name="Jump__008.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
-        <file id="29" name="Jump__009.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="0" name="Frames/Idle__009.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="1" name="Frames/Idle__000.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="2" name="Frames/Idle__001.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="3" name="Frames/Idle__002.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="4" name="Frames/Idle__003.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="5" name="Frames/Idle__004.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="6" name="Frames/Idle__005.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="7" name="Frames/Idle__006.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="8" name="Frames/Idle__007.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="9" name="Frames/Idle__008.png" width="319" height="486" pivot_x="0" pivot_y="1"/>
+        <file id="10" name="Frames/Run__009.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="11" name="Frames/Run__000.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="12" name="Frames/Run__001.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="13" name="Frames/Run__002.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="14" name="Frames/Run__003.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="15" name="Frames/Run__004.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="16" name="Frames/Run__005.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="17" name="Frames/Run__006.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="18" name="Frames/Run__007.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="19" name="Frames/Run__008.png" width="415" height="507" pivot_x="0" pivot_y="1"/>
+        <file id="20" name="Frames/Jump__005.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="21" name="Frames/Jump__000.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="22" name="Frames/Jump__001.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="23" name="Frames/Jump__002.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="24" name="Frames/Jump__003.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="25" name="Frames/Jump__004.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="26" name="Frames/Jump__006.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="27" name="Frames/Jump__007.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="28" name="Frames/Jump__008.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
+        <file id="29" name="Frames/Jump__009.png" width="407" height="536" pivot_x="0" pivot_y="1"/>
     </folder>
     <entity id="0" name="Hero">
         <animation id="0" name="Run" length="750" interval="100">