Exemplo n.º 1
0
 private void MouseJustClickedSprite(MouseClickEntityEventArgs e)
 {
     if (_mouseClicked != null)
     {
         _mouseClicked(this, e);
     }
 }
Exemplo n.º 2
0
 private void MouseClickSprite(MouseClickEntityEventArgs e)
 {
     if (_mouseClick != null)
     {
         _mouseClick(this, e);
     }
 }
Exemplo n.º 3
0
        protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e)
        {
            MenuItem item = (sender as MenuItem);

            if (item != null)
            {
                switch (item.ItemPosition)
                {
                case 0: YnG.SwitchState(new SelectShipState()); break;

                case 1:
                    Registry.AudioManager.SpeakAsync("This section is disabled at this time");
                    //YnG.SwitchState(new MultiPlayerState(2));
                    break;

                case 2: YnG.SwitchState(new ScoreState()); break;

                case 3: YnG.SwitchState(new OptionsState()); break;

                case 4: YnG.SwitchState(new CreditsState()); break;

                case 5: YnG.Exit(); break;
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Action when a button is pressed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void Pad_Click(object sender, MouseClickEntityEventArgs e)
        {
            YnSprite button = sender as YnSprite;

            if (button != null)
            {
                PadButtons direction = GetDirection(button.Name);
                VirtualPadPressedEventArgs vpEvent = new VirtualPadPressedEventArgs(direction);

                OnPressed(vpEvent);
            }
        }
Exemplo n.º 5
0
        protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e)
        {
            YnEntity levelScreen = sender as YnEntity;

            if (levelScreen != null)
            {
                YnG.AudioManager.PlaySound(Assets.SoundCrystal);

                int levelId = int.Parse(levelScreen.Name.Split(new char[] { '_' })[1].ToString());
                GameConfiguration.SetStartLevel(levelId);
                (YnG.Game as MazeGame).PrepareNewLevel(levelId, true);
            }
        }
Exemplo n.º 6
0
        protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e)
        {
            MenuItem item = (sender as MenuItem);

            if (item != null)
            {
                if (item.ItemPosition == 2)
                {
                    YnG.SwitchState(new SelectShipState());
                }
                else
                {
                    _selectedLevel = item.ItemPosition;
                    Registry.AudioManager.StopMusic();
                    YnG.SwitchState(new SoloPlayerState((SpaceShipType)_selectedShip, (LevelType)_selectedLevel));
                }
            }
        }
Exemplo n.º 7
0
        private void Pad_Click(object sender, MouseClickEntityEventArgs e)
        {
            YnSprite button = sender as YnSprite;

            if (button != null)
            {
                string [] temp  = button.Name.Split(new char [] { '_' });
                int       index = int.Parse(temp [1].ToString());

                ControlDirection           direction = (ControlDirection)index;
                VirtualPadPressedEventArgs vpEvent   = new VirtualPadPressedEventArgs(direction);

                if (e.JustClicked)
                {
                    OnJustPressed(vpEvent);
                }
                else
                {
                    OnPressed(vpEvent);
                }
            }
        }
Exemplo n.º 8
0
        protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e)
        {
            MenuItem item = (sender as MenuItem);

            if (item != null)
            {
                if (item.ItemPosition < 4)
                {
                    DesactiveAllShipProfile(shipProfileItem[item.ItemPosition]);
                    shipProfileItem[item.ItemPosition].Active = true;
                    _selectedShip = item.ItemPosition;

                    Registry.AudioManager.SpeakAsync(shipProfileItem[item.ItemPosition].SpaceShipDescription.Model + ". " + shipProfileItem[item.ItemPosition].SpaceShipDescription.Description);
                }
                else if (item.ItemPosition == 4)
                {
                    YnG.SwitchState(new MenuState());
                }
                else if (item.ItemPosition == 5)
                {
                    YnG.SwitchState(new SelectLevelState(_selectedShip));
                }
            }
        }
Exemplo n.º 9
0
 protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e)
 {
 }
Exemplo n.º 10
0
 // Lorsqu'on click sur un item du menu
 protected virtual void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e)
 {
 }
Exemplo n.º 11
0
 void MenuState_MouseClicked(object sender, MouseClickEntityEventArgs e)
 {
     _checkForNext = true;
     menuItemIndex = GetIndex(sender as YnText);
 }
Exemplo n.º 12
0
 protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e)
 {
     YnG.SwitchState(new MenuState());
 }
Exemplo n.º 13
0
 // Lorsqu'on click sur un item du menu
 protected abstract void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e);