예제 #1
0
        public override void Open()
        {
            // create the seeker ("hero"/"attacker")
            CtfSeeker = new CtfSeeker(this, Annotations, _arrive);
            _all.Add(CtfSeeker);

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

            // initialize camera
            Demo.Init2dCamera(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(BaseRadius, _obstacles);
        }
예제 #2
0
        public override void HandleFunctionKeys(Keys key)
        {
            switch (key)
            {
            case Keys.F1: CtfBase.AddOneObstacle(BaseRadius); break;

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