コード例 #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (SpaceShooterGame game = new SpaceShooterGame())
     {
         game.Run();
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: NaterTots/SpaceShooter
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (SpaceShooterGame game = new SpaceShooterGame())
     {
         game.Run();
     }
 }
コード例 #3
0
        public LineRenderer(SpaceShooterGame game)
        {
            _gameInstance = game;

            freeIndex = 0;
            lineItems = new LineItem[1024]; //MAX NUMBER OF LINE ELEMENTS

            for (int i = 0; i < lineItems.Length; i++)
            {
                lineItems[i] = new LineItem();
            }
        }
コード例 #4
0
        public DiscRenderer(SpaceShooterGame game)
        {
            _gameInstance = game;

            freeIndex = 0;
            discItems = new DiscItem[32]; //MAX NUMBER OF ELEMENTS

            for (int i = 0; i < discItems.Length; i++)
            {
                discItems[i] = new DiscItem();
            }
        }
コード例 #5
0
        public SphereRenderer(SpaceShooterGame game)
        {
            _gameInstance = game;

            freeIndex = 0;
#if DEBUG
            sphereItems = new SphereItem[2048]; //MAX NUMBER OF ELEMENTS
#else
            sphereItems = new SphereItem[256];  //MAX NUMBER OF ELEMENTS
#endif

            for (int i = 0; i < sphereItems.Length; i++)
            {
                sphereItems[i] = new SphereItem();
            }
        }
コード例 #6
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
#if SDL2
            string baseFolder = GetStorageRoot();
            string oldFolder  = System.IO.Path.Combine(baseFolder, "AllPlayers");
            string newFolder  = System.IO.Path.Combine(baseFolder, "Flotilla", "AllPlayers");
            if (System.IO.Directory.Exists(oldFolder) &&
                !System.IO.Directory.Exists(newFolder))
            {
                try
                {
                    Console.Write("MIGRATING XNA3 SAVES TO XNA4...");
                    System.IO.Directory.CreateDirectory(newFolder);
                    System.IO.File.Copy(
                        System.IO.Path.Combine(oldFolder, "saveinfo.dat"),
                        System.IO.Path.Combine(newFolder, "saveinfo.dat")
                        );
                    System.IO.File.Copy(
                        System.IO.Path.Combine(oldFolder, "scores.dat"),
                        System.IO.Path.Combine(newFolder, "scores.dat")
                        );
                    System.IO.File.Copy(
                        System.IO.Path.Combine(oldFolder, "settings.xml"),
                        System.IO.Path.Combine(newFolder, "settings.xml")
                        );
                    Console.WriteLine(" COMPLETE!");
                }
                catch
                {
                    SDL2.SDL.SDL_ShowSimpleMessageBox(
                        SDL2.SDL.SDL_MessageBoxFlags.SDL_MESSAGEBOX_ERROR,
                        "XNA3->XNA4 Migration Failed!",
                        "We just tried to copy your old XNA3 saves over to the new location,\n" +
                        "but something caused it to fail. We don't know what though.\n\n" +
                        "To migrate by hand, go to this folder...\n\n" + baseFolder + "\n\n" +
                        "... make an extra \"Flotilla\" folder inside, then move the \"AllPlayers\"\n" +
                        "folder inside that extra folder. Your old save data should load after that!",
                        IntPtr.Zero
                        );
                }
            }
#endif

#if WINDOWS
#if !DEBUG
            try
            {
#endif
            using (SpaceShooterGame game = new SpaceShooterGame())
            {
                game.Run();
            }
#if !DEBUG
        }

        catch (Exception e)
        {
            string userVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() +
                                 "." + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString();

            string registered = string.Empty;
            if (System.IO.File.Exists(@"WindowsContent/splash.bmp"))
            {
                registered = "Registered";
            }
            else
            {
                registered = "Demo";
            }

            string finalString = registered + " version " + userVersion + "\n\n" + e.ToString();

#if SDL2
            Console.WriteLine(finalString);
            if (YesNoPopup.Show("Flotilla Critical Error", "Flotilla has encountered a catastrophic error:\n\n" + finalString + "\n\n\nSend this crash report to BlendoGames.com?"))
            {
                SendCrashReport(finalString);
            }
#else
            if (MessageBox.Show(
                    "Flotilla has encountered a catastrophic error:\n\n" + finalString + "\n\n\nSend this crash report to BlendoGames.com?",
                    "Flotilla Critical Error", MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Error) == DialogResult.Yes)
            {
                SendCrashReport(finalString);
            }
#endif
        }
#endif
#else
            using (SpaceShooterGame game = new SpaceShooterGame())
            {
                game.Run();
            }
#endif
        }