示例#1
0
 public FaceChaser(Game game)
     : base(game)
 {
     playerFace      = ((Game1)game).FaceTracker;
     this.scaleSpeed = .02f;
     this.scaleMin   = .2f;
 }
示例#2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            fMan = new FoodManager(this, "20px_1trans", new Point(10, 10));
            //graphics.ToggleFullScreen();
            //graphics.PreferredBackBufferWidth = 1024;
            //graphics.PreferredBackBufferHeight = 768;
            graphics.PreferredBackBufferWidth  = 1280;
            graphics.PreferredBackBufferHeight = 720;
            Content.RootDirectory = "Content";

            #region Library Components
            input = new InputHandler(this);
            this.Components.Add(input);

            gameConsole = new GameConsole(this);
            //gameConsole.ToggleState();
            this.Components.Add(gameConsole);

            fps = new FPS(this);
            this.Components.Add(fps);


            #endregion

            FaceTracker             = new PlayerFace(this);
            FaceTracker.ShowMarkers = false;
            FaceTracker.Scale       = 1.0f;
            FaceTracker.Visible     = false;
            this.Components.Add(FaceTracker);

            FBM = new FoatingBallManager(this);
            this.Components.Add(FBM);

            faceChaser             = new FaceChaser(this);
            faceChaser.Location    = new Vector2(10, 10);
            faceChaser.ChaseSpeed  = new Vector2(1.4f, 1.4f);
            faceChaser.ShowMarkers = false;
            this.Components.Add(faceChaser);
            faceChaser.Enabled = true;
            faceChaser.Visible = true;

            Bball = new BasketBall(this);
            this.Components.Add(Bball);
        }