Browse Source

Updates and Cleanups

Josh Engebretson 9 years ago
parent
commit
f478184e44

+ 0 - 5
AtomicNET/AtomicBlaster/Resources/Components.asset

@@ -1,5 +0,0 @@
-{
-	"version": 1,
-	"guid": "c79581855f9e7e35c50930013ae80449",
-	"FolderImporter": {}
-}

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/Art.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/BlackHole.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/Bullet.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/ColorUtil.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 10 - 9
AtomicNET/AtomicBlaster/Resources/Scripts/CustomRenderer.cs

@@ -1,10 +1,12 @@
 
+
+// Custom Renderer 
+
 using System;
 using System.Collections.Generic;
 using System.Runtime.InteropServices;
 using AtomicEngine;
 
-
 namespace AtomicBlaster
 {
 
@@ -23,6 +25,13 @@ namespace AtomicBlaster
         public PositionColorUVVertex[] Vertices = new PositionColorUVVertex[256];
     }
 
+    struct DrawItem
+    {
+        public Texture2D Texture;
+        public uint StartVertex;
+        public uint VertexCount;
+    }
+
     static class CustomRenderer
     {
 
@@ -67,14 +76,6 @@ namespace AtomicBlaster
             
         }
 
-        struct DrawItem
-        {
-            public Texture2D Texture;
-            public uint StartVertex;
-            public uint VertexCount;
-        }
-
-
         unsafe public static void End()
         {
             

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/Enemy.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/EnemySpawner.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/Entity.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 5 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/EntityManager.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 
@@ -124,6 +125,9 @@ namespace AtomicBlaster
 
         private static void KillPlayer()
         {
+            if (GameRoot.GodMode)
+                return;
+
             PlayerShip.Instance.Kill();
             enemies.ForEach(x => x.WasShot());
             blackHoles.ForEach(x => x.Kill());

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/Extensions.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 31 - 25
AtomicNET/AtomicBlaster/Resources/Scripts/GameRoot.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 
@@ -10,19 +11,8 @@ using AtomicPlayer;
 namespace AtomicBlaster
 {
 
-    class GameRoot : NETScriptObject
+    public class GameRoot : NETScriptObject  
     {
-        public static Scene Scene { get; private set; }
-
-        public static float ElapsedTime { get; private set; }
-
-        public static Vector2 ScreenSize { get; private set; }
-        public static IntRect ScreenBounds { get; private set; }
-
-        public static Grid Grid { get; private set; }
-        public static ParticleManager<ParticleState> ParticleManager { get; private set; }
-
-        bool paused = false;
 
         public GameRoot()
         {
@@ -35,15 +25,6 @@ namespace AtomicBlaster
             ScreenSize = new Vector2(width, height);
             ScreenBounds = new IntRect(0, 0, (int)ScreenSize.X, (int)ScreenSize.Y);
 
-            ParticleManager = new ParticleManager<ParticleState>(1024 * 20, ParticleState.UpdateParticle);
-
-            const int maxGridPoints = 1600;
-            float amt = (float)Math.Sqrt(ScreenBounds.Width * ScreenBounds.Height / maxGridPoints);
-            Vector2 gridSpacing = new Vector2(amt, amt);
-            Grid = new Grid(ScreenBounds, gridSpacing);
-
-            EntityManager.Add(PlayerShip.Instance);
-
             var renderer = AtomicNET.GetSubsystem<Renderer>();
             var viewport = renderer.GetViewport(0);
 
@@ -56,8 +37,8 @@ namespace AtomicBlaster
 
             Scene = new Scene();
             Scene.CreateComponent<Octree>();
+
             var camera = Scene.CreateChild("Camera").CreateComponent<Camera>();
-                        
             camera.Node.Position = new Vector3(width / 2.0f, height / 2.0f, 0.0f);
             camera.Orthographic = true;
             camera.OrthoSize = height;
@@ -67,13 +48,22 @@ namespace AtomicBlaster
 
             CustomRenderer.Initialize();
 
+            ParticleManager = new ParticleManager<ParticleState>(1024 * 20, ParticleState.UpdateParticle);
+
+            const int maxGridPoints = 1600;
+            float amt = (float)Math.Sqrt(ScreenBounds.Width * ScreenBounds.Height / maxGridPoints);
+            Vector2 gridSpacing = new Vector2(amt, amt);
+            Grid = new Grid(ScreenBounds, gridSpacing);
+
+            EntityManager.Add(PlayerShip.Instance);
+
             SubscribeToEvent("Update", HandleUpdate);
             SubscribeToEvent("RenderPathEvent", HandleRenderPathEvent);
-
         }
 
         void HandleRenderPathEvent(uint eventType, ScriptVariantMap eventData)
         {
+
             if (eventData.GetString("name") != "customrender")
                 return;
 
@@ -89,6 +79,7 @@ namespace AtomicBlaster
 
         void HandleUpdate(uint eventType, ScriptVariantMap eventData)
         {
+            
             float time = eventData.GetFloat("timestep");
 
             deltaTime += time;
@@ -114,13 +105,28 @@ namespace AtomicBlaster
         }
 
         void Draw()
-        {                        
+        {
             EntityManager.Draw();
             Grid.Draw();
             ParticleManager.Draw();
 
         }
 
+        // GodMode by default as the game is really hard :)
+        public static bool GodMode = true;
+
+        public static Scene Scene { get; private set; }
+
+        public static float ElapsedTime { get; private set; }
+
+        public static Vector2 ScreenSize { get; private set; }
+        public static IntRect ScreenBounds { get; private set; }
+
+        public static Grid Grid { get; private set; }
+        public static ParticleManager<ParticleState> ParticleManager { get; private set; }
+
+        bool paused = false;
+
 
     }
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/Grid.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/MathUtil.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/ParticleManager.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/ParticleState.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/PlayerShip.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/PlayerStatus.cs

@@ -1,5 +1,6 @@
 //---------------------------------------------------------------------------------
-// Written by Michael Hoffman
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
 // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
 //----------------------------------------------------------------------------------
 

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/Program.cs

@@ -11,8 +11,10 @@ namespace AtomicBlaster
         static void Main(string[] args)
         {
 
-            new GameRoot();
+            gameroot = new GameRoot();
             
         }
+
+        public static GameRoot gameroot;
     }
 }

+ 6 - 0
AtomicNET/AtomicBlaster/Resources/Scripts/ShipInput.cs

@@ -1,3 +1,9 @@
+//---------------------------------------------------------------------------------
+// Ported to the Atomic Game Engine
+// Originally written for XNA by Michael Hoffman
+// Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
+//----------------------------------------------------------------------------------
+
 using System;
 using AtomicEngine;