Browse Source

Fix butterflies and physics2d

Josh Engebretson 9 years ago
parent
commit
2a85bde6de

+ 7 - 0
Butterflies/CSharp/Resources/Scripts/AtomicMain.cs

@@ -3,5 +3,12 @@ using AtomicPlayer;
 
 
 public class AtomicMain : AppDelegate
 public class AtomicMain : AppDelegate
 {
 {
+    public override void Start()
+    {
+        var scene = GetSubsystem<Player>().LoadScene("Scenes/TheScene.scene");
+        var camera = scene.GetChild("Camera").GetComponent<Camera>();
+        var graphics = GetSubsystem<Graphics>();
+        camera.SetOrthoSize(graphics.Height * .7f * Constants.PIXEL_SIZE);
+    }
 
 
 }
 }

+ 0 - 6
Butterflies/CSharp/Resources/Scripts/main.js

@@ -1,6 +0,0 @@
-// This script is the main entry point of the game
-
-
-var scene = Atomic.player.loadScene("Scenes/TheScene.scene");
-var camera = scene.getChild("Camera").getComponent("Camera");
-camera.setOrthoSize(Atomic.graphics.height * .7 * Atomic.PIXEL_SIZE);

+ 0 - 7
Butterflies/CSharp/Resources/Scripts/main.js.asset

@@ -1,7 +0,0 @@
-{
-	"version": 1,
-	"guid": "eca179757c676750cf21705aac3161ad",
-	"JavascriptImporter": {
-		"IsComponentFile": false
-	}
-}

+ 10 - 0
Physics2D/CSharp/Resources/Scripts/AtomicMain.cs

@@ -1,7 +1,17 @@
+using System;
 using AtomicEngine;
 using AtomicEngine;
 using AtomicPlayer;
 using AtomicPlayer;
 
 
 public class AtomicMain : AppDelegate
 public class AtomicMain : AppDelegate
 {
 {
+    public override void Start()
+    {
+        var scene = GetSubsystem<Player>().LoadScene("Scenes/TheScene.scene");
+        var camera = scene.GetChild("Camera").GetComponent<Camera>();
+        var graphics = GetSubsystem<Graphics>();
+        camera.SetOrthoSize(graphics.Height * Constants.PIXEL_SIZE);
+        camera.SetZoom(.75f * Math.Min(graphics.Width / 1280.0f, graphics.Height / 800.0f));
+
+    }
 
 
 }
 }

+ 0 - 7
Physics2D/CSharp/Resources/Scripts/main.js

@@ -1,7 +0,0 @@
-// This script is the main entry point of the game
-
-
-var scene = Atomic.player.loadScene("Scenes/TheScene.scene");
-var camera = scene.getChild("Camera").getComponent("Camera");
-camera.setOrthoSize(Atomic.graphics.height * Atomic.PIXEL_SIZE);
-camera.setZoom(.75 * Math.min(Atomic.graphics.width / 1280.0, Atomic.graphics.height / 800.0));

+ 0 - 7
Physics2D/CSharp/Resources/Scripts/main.js.asset

@@ -1,7 +0,0 @@
-{
-	"version": 1,
-	"guid": "eca179757c676750cf21705aac3161ad",
-	"JavascriptImporter": {
-		"IsComponentFile": false
-	}
-}