コード例 #1
0
        public void Init()
        {
            // set singleton
            if (Singleton == null)
            {
                Singleton = this;
            }
            else
            {
                IO.Debug.LogError("TheWorld Singleton was not null");
            }

            // init the main world objects
            /// bullet manager
            bulletManager = new Managers.BulletManager();
            bulletManager.Init();

            /// EntityManager
            entityManager = new EntityManager();
            entityManager.Init();

            /// player object
            player = new Player();
            player.Init();

            /// test level
            level = new TestLevelB();
            level.Init();
        }
コード例 #2
0
        public void Exit()
        {
            // remove singleton
            if (Singleton == this)
            {
                Singleton = null;
            }

            // Call Exit on world objects
            level?.Exit();             /// if it's null then it wont call the function
            player.Exit();
            entityManager.Exit();
            bulletManager.Exit();
        }
コード例 #3
0
ファイル: Game1.cs プロジェクト: ARAMODODRAGON/project_astro
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public Game1()
        {
            if (Singleton == null)
            {
                Singleton = this;
            }
            else
            {
                IO.Debug.LogError("Game1 Singlon was not null");
            }
            //renderer = new Renderer(this, new Point(1600, 900));
            renderer              = new Renderer(this, new Point(1280, 720));
            camera                = new Camera(new Point(0, 0), new Point(1920, 1080));
            Camera.Center         = Point.Zero;
            Content.RootDirectory = "Content";
            debug    = new IO.Debug();
            input    = new IO.Input();
            theWorld = new TheWorld();
        }