コード例 #1
0
ファイル: GameScene.cs プロジェクト: cmark89/AsteroidRebuttal
        public IEnumerator<float> SpawnPlayer()
        {
            // Ensure that the last player object was destroyed if it ever existed
            if (player != null)
                player.Destroy();

            // Respawn the player at the set coordinates, with phasing.
            player = new PlayerShip(this, new Vector2(350, 550));
            player.Phasing = true;

            float timeElapsed = 0f;
            while (timeElapsed < 2.1f)
            {
                player.Color = new Color(.35f, .35f, .35f, .35f);
                yield return .06f;

                player.Color = new Color(1f, 1f, 1f, 1f);
                yield return .06f;

                timeElapsed += .12f;
            }

            player.Phasing = false;
        }
コード例 #2
0
ファイル: GameScene.cs プロジェクト: cmark89/AsteroidRebuttal
        public override void Initialize()
        {
            scriptManager = new ScriptManager();
            gameObjects = new List<GameObject>();
            animations = new List<Animation>();

            ExtendValues = new List<int>()
            {
                10000,
                25000,
                50000,
                100000,
                200000,
                400000,
                800000,
                1600000,
                3200000,
                6400000,
                12800000,
                25600000,

            };

            if (AsteroidRebuttal.HardcoreMode)
            {
                ExtendValues.Clear();
                Lives = 0;
            }

            // Set the game area to 700 x 650.
            ScreenArea = new Rectangle(0, 0, 700, 650);
            fader = new Fader(this);

            // Set the UI window to 150 x 650, beginning after the ScreenArea.
            GUIArea = new Rectangle(700, 0, 225, 650);

            quadtree = new QuadTree(0, ScreenArea);
            collisionDetection = new CollisionDetection(this);

            levelManager = new LevelManager(this);

            // Test
            levelManager.SetLevel(1);

            //new FinalBoss(this, new Vector2(350, -300));
            player = new PlayerShip(this, new Vector2(350, 550));
        }