public PvZSunSystem(Game game, int money, IGestureDispatcher gestureDispatcher)
            : base(game)
        {
            this.CurrentMoney = money;
            _collectionPoint = new Vector2(20, 430);
            _gestureDispatcher = gestureDispatcher;

            _soundSunCreate = SCSServices.Instance.ResourceManager.GetResource<Sound>("Sounds/CreateSun");
            this.DrawOrder = 2;
        }
        public override void Initialize()
        {
            SetSceneComponents();
            this.backgroundMusic = SCSServices.Instance.ResourceManager.GetResource<Song>(BACKGROUND_MUSICNAME);
            this.buttonOKSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(BUTTON_TOUCHED_OK_SOUNDNAME);
            this.buttonFailSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(BUTTON_TOUCHED_FAIL_SOUNDNAME);
            this.exitGameSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(EXIT_SOUNDNAME);
            this.playGameSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(PLAYGAME_TOUCHED_SOUNDNAME);

            base.Initialize();
        }
        public override void Initialize()
        {
            this.spriteBatch = SCSServices.Instance.SpriteBatch;

            background = SCSServices.Instance.ResourceManager.GetResource<Texture2D>(@"Images\Controls\Loading");
            alpha = 0;

            this.timer = FADE_TIME;
            this.state = FadeState.FadeIn;

            this.backgroundSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(BACKGROUND_SOUNDNAME);

            base.Initialize();
        }
 public P_NormalLogicBehavior()
     : base()
 {
     _soundShoot = SCSServices.Instance.ResourceManager.GetResource<Sound>("Sounds/PeaShot");
 }
 public B_SunLogicBehavior()
     : base()
 {
     SunState = eSunState.STAND;
     _soundCollectSun = SCSServices.Instance.ResourceManager.GetResource<Sound>("Sounds/SunClicked");
 }
        // Button event do
        protected void SetSceneComponents()
        {
            this.spriteBatch = SCSServices.Instance.SpriteBatch;
            this.background = SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\ExitMenu");
            this.buttonTouchedSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(BUTTON_TOUCHED_OK_SOUNDNAME);

            this.uiManager = new UIControlManager(this.Game, DefaultGestureHandlingFactory.Instance);
            gm.AddDispatcher(this.uiManager);
            this.Components.Add(this.uiManager);

            this.Yes = new Button(this.Game, spriteBatch,
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\Yes"),
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\YesOver"));
            this.Yes.FitSizeByImage();
            this.Yes.Canvas.Bound.Position = new Vector2(130f, 310f);
            this.Yes.OnTouched += this.Yes_Clicked;
            this.uiManager.Add(Yes);

            this.No = new Button(this.Game, spriteBatch,
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\No"),
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\NoOver"));
            this.No.FitSizeByImage();
            this.No.Canvas.Bound.Position = new Vector2(440f, 310f);
            this.No.OnTouched += this.No_Clicked;
            uiManager.Add(No);
        }
        // Button event do
        protected void SetSceneComponents()
        {
            this.spriteBatch = SCSServices.Instance.SpriteBatch;

            this.backgrounds.Add(SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\HelpScene_1"));
            this.backgrounds.Add(SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\HelpScene_2"));

            this.buttonTouchedSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(BUTTON_TOUCHED_OK_SOUNDNAME);

            this.currentTexture = backgrounds[currentPage];

            this.uiManager = new UIControlManager(this.Game, DefaultGestureHandlingFactory.Instance);
            gm.AddDispatcher(this.uiManager);
            this.Components.Add(this.uiManager);

            this.next = new Button(this.Game, spriteBatch,
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\Next"),
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\NextOver"));
            this.next.FitSizeByImage();
            this.next.Canvas.Bound.Position = new Vector2(710f, 450f);
            this.next.OnTouched += this.next_Clicked;
            this.uiManager.Add(next);

            this.back = new Button(this.Game,  spriteBatch,
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\Back"),
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Images\\Controls\\BackOver"));
            this.back.FitSizeByImage();
            this.back.Canvas.Bound.Position = new Vector2(0f, 450f);
            this.back.OnTouched += this.back_Clicked;
            this.uiManager.Add(back);
        }
 public P_IcePlantLogicBehavior()
     : base()
 {
     _soundShoot = SCSServices.Instance.ResourceManager.GetResource<Sound>("Sounds/Shot");
 }
 public B_NormalLogicBehavior()
     : base()
 {
     _sound = SCSServices.Instance.ResourceManager.GetResource<Sound>("Sounds/IceBulletCollide");
 }
        public override void Initialize()
        {
            this.waitList = new PvZChooseList(this.Game, ButtonWidth, ButtonHeight, ButtonPadding,
                this.uiManager);
            this.chosenList = new PvZChooseList(this.Game, ButtonWidth, ButtonHeight, ButtonPadding,
                this.uiManager);
            this.waitList.Canvas.Bound.Position = new Vector2(outsidePosition, 150);
            this.waitList.Canvas.Bound.Size = new Vector2(480, 200);
            this.waitList.Canvas.Content.Position = new Vector2(20, 40);
            this.waitList.Canvas.Content.Size = new Vector2(430, 150);
            this.waitList.Background = SCSServices.Instance.ResourceManager.GetResource<ISprite>("ChoosePlant");

            this.chosenList.Canvas.Bound.Position = new Vector2(outsidePosition, 400);
            this.chosenList.Canvas.Bound.Size = new Vector2(460, 70);
            this.chosenList.Canvas.Content.Position = new Vector2(90, 5);
            this.chosenList.Canvas.Content.Size = new Vector2(440, 56);
            this.chosenList.MaxButtons = this.maxButtons;
            this.chosenList.Background = SCSServices.Instance.ResourceManager.GetResource<ISprite>("BuyPlant");

            foreach (var buttonF in this.buttonFB)
            {
                var chButton = buttonF.Value.CreateChooseButton(this.Game);
                chButton.OnTap += this.OnChooseButtonInWaitListTapped;
                this.waitList.AddChooseButton(chButton);
            }
            this.waitList.ReArrange();

            this.uiManager.Add(this.waitList);
            this.uiManager.Add(this.chosenList);

            this.readyButton = new Button(this.Game, SCSServices.Instance.SpriteBatch,
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("Ready"),
                SCSServices.Instance.ResourceManager.GetResource<Texture2D>("ReadyOver"));
            readyButton.IsOverlay = true;
            readyButton.FitSizeByImage();
            readyButton.Canvas.Bound.Position = new Vector2(outsidePosition + readyButtonMargin, 360f);
            readyButton.OnTouched += this.OnReadyButtonTouched;
            this.uiManager.Add(readyButton);

            this.state = ChooseSystemState.OUTSIDE;

            this.buttonChoosedSound = SCSServices.Instance.ResourceManager.GetResource<Sound>(BUTTONCHOOSED_SOUNDNAME);
            this.buttonTouchedFail = SCSServices.Instance.ResourceManager.GetResource<Sound>(BUTTON_TOUCHED_FAIL_SOUNDNAME);

            base.Initialize();
        }