コード例 #1
0
ファイル: Scene.cs プロジェクト: doanhtdpl/pvz-the-birds
        /// <summary>
        /// Comtructor method of Scene class
        /// </summary>
        /// <param name="game">Provides a snapshot of timing values</param>
        /// <param name="managerScene">Scene Manager</param>
        public Scene(SceneManager managerScene)
            : base(managerScene.Game)
        {
            this.components = new List<GameComponent>();
            this.SceneManager = managerScene;

            Visible = false;
            Enabled = false;

            this.Initialize();
        }
コード例 #2
0
ファイル: GameScene.cs プロジェクト: doanhtdpl/pvz-the-birds
        public GameScene(SceneManager manager)
            : base(manager)
        {
            //Test:
            this.Background = SpriteBank.GetSprite(@"Images\Controls\Background_Forest");

            this.moveTimer = new Counter.Timer(this.Game, 20);
            this.state = GameSceneState.MoveIn;
            this.moveTimer.OnMeet += new Counter.EventOnCounterMeet(this.MoveIn);
            this.moveTimer.Start();

            this.playButton = new Controls.Button(this.Game, SpriteBank.GetSprite(@"Images\Controls\Ready"), SpriteBank.GetSprite(@"Images\Controls\ReadyOver"), Vector2.Zero);
            this.playButton.Position = new Vector2(-315f, 220f);
            this.playButton.Clicked += new EventHandler(this.PlayButtonOnClick);

            this.Grid = new Griding.Griding(this.Game, new Rectangle(0, 60, 760, 380), 5, 9);
            this.PlantManager = new Plants_Bullets.Plant.PlantManager(this.Game, this.Grid);
            this.GrowManager = new Hospital.Hospital_GrowManager(this.PlantManager);
            this.PlantManager.GetSunManager.OnSunChanged += new SunManager.OnSunChangedProc(this.GrowManager.OnSunChanged);
            this.PlantManager.GetSunManager.NumberOfSuns = 100;

            this.ZombiesManager = new Zombies.Managers.ZombiesManager(this.Grid);
            this.ZombiesManager.Generator = new Hospital.Hospital_ZombiesGenerator(this.ZombiesManager);
        }