Exemple #1
0
        public override void Open()
        {
            // create the seeker ("hero"/"attacker")
            Globals.CtfSeeker = new CtfSeeker();
            all.Add(Globals.CtfSeeker);

            // create the specified number of enemies,
            // storing pointers to them in an array.
            for (int i = 0; i < Globals.CtfEnemyCount; i++)
            {
                Globals.CtfEnemies[i] = new CtfEnemy();
                all.Add(Globals.CtfEnemies[i]);
            }

            // initialize camera
            Demo.Init2dCamera(Globals.CtfSeeker);
            Demo.Camera.Mode            = Camera.CameraMode.FixedDistanceOffset;
            Demo.Camera.FixedTarget     = Vector3.Zero;
            Demo.Camera.FixedTarget.X   = 15;
            Demo.Camera.FixedPosition.X = 80;
            Demo.Camera.FixedPosition.Y = 60;
            Demo.Camera.FixedPosition.Z = 0;

            CtfBase.InitializeObstacles();
        }
Exemple #2
0
        public override void HandleFunctionKeys(Keys key)
        {
            switch (key)
            {
            case Keys.F1: CtfBase.AddOneObstacle(); break;

            case Keys.F2: CtfBase.RemoveOneObstacle(); break;
            }
        }