Esempio n. 1
0
 protected void setWideHighLight(bool highlighted)
 {
     if (WideButton != null)
     {
         WideButton.setSparcleVisiblity(highlighted);
     }
 }
Esempio n. 2
0
 protected void setLaserHighLight(bool highlighted)
 {
     if (LaserButton != null)
     {
         LaserButton.setSparcleVisiblity(highlighted);
     }
 }
Esempio n. 3
0
 protected void setMediumHighLight(bool highlighted)
 {
     if (MediumButton != null)
     {
         MediumButton.setSparcleVisiblity(highlighted);
     }
 }
Esempio n. 4
0
        /**
         * Will change the update state to the given update state
         * This will Determine what objects receive updates and which objects are visible
         * @param newState
         */
        internal void setUpdateState(updateState newState)
        {
            if (active != newState)
            {
                //In Game
                if (newState == updateState.INGAME)
                {
                    player.visible = true;
                    player.getLight().visible = true;
                    powerBar.setVisibility(true);
                    laserButton.setVisibility(true, true);
                    wideButton.setVisibility(true, true);
                    mediumButton.setVisibility(true, true);
                    userText.visible         = true;
                    typeSelectedText.visible = true;

                    mainMenue.setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                    mainMenue.setVisibility(false, true);
                    escapeMenue.setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                    escapeMenue.setVisibility(false, true);
                    transitionMenue.setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                    transitionMenue.setVisibility(false, true);
                    active = newState;
                }
                //Main Menue
                else if (newState == updateState.MAINMENUE)
                {
                    player.visible = false;
                    player.getLight().visible = false;
                    powerBar.setVisibility(false);
                    laserButton.setVisibility(false, true);
                    wideButton.setVisibility(false, true);
                    mediumButton.setVisibility(false, true);
                    userText.visible         = false;
                    typeSelectedText.visible = false;
                    enemies.RemoveAllEnemies();
                    mediumButton.setSparcleVisiblity(false);
                    wideButton.setSparcleVisiblity(false);
                    laserButton.setSparcleVisiblity(false);
                    if (currentLevel != null)
                    {
                        currentLevel.end();
                    }
                    EnemySoundManager.clear();

                    mainMenue.setVisibility(true, true);
                    mainMenue.setState(MenueSystem.Panel.PanelState.IDLE, true);

                    escapeMenue.setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                    escapeMenue.setVisibility(false, true);
                    transitionMenue.setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                    transitionMenue.setVisibility(false, true);
                    active = newState;
                    setHeartCount(0);
                }
                //Transition Menue
                else if (newState == updateState.TRANSITION)
                {
                    if (state == GameState.EndState.LOSE || state == GameState.EndState.WIN)
                    {
                        transitionMenue.setVisibility(true, true);
                        transitionMenue.setState(MenueSystem.Panel.PanelState.IDLE, true);

                        mainMenue.setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                        mainMenue.setVisibility(false, true);
                        escapeMenue.setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                        escapeMenue.setVisibility(false, true);
                        active = newState;

                        if (state == GameState.EndState.LOSE)
                        {
                            transitionMenue.getPanel(1).setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                            ((MenueSystem.Label)transitionMenue.getPanel(2)).setText(((LevelButton)mainMenue.getPanel(2).getPanel(0).getPanel(LevelNumber)).loseMessage);
                        }
                        else
                        {
                            if (((LevelButton)transitionMenue.getPanel(1)).gameLevel != null)
                            {
                                transitionMenue.getPanel(1).setState(MenueSystem.Panel.PanelState.IDLE, true);
                            }
                            else
                            {
                                transitionMenue.getPanel(1).setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                            }
                            ((MenueSystem.Label)transitionMenue.getPanel(2)).setText(((LevelButton)mainMenue.getPanel(2).getPanel(0).getPanel(LevelNumber)).winMessage);
                        }
                    }
                    else
                    {
                        setUpdateState(updateState.ESC);
                    }
                }
                //Escape Menu
                else if (newState == updateState.ESC)
                {
                    escapeMenue.setVisibility(true, true);
                    escapeMenue.setState(MenueSystem.Panel.PanelState.IDLE, true);

                    mainMenue.setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                    mainMenue.setVisibility(false, true);
                    transitionMenue.setState(MenueSystem.Panel.PanelState.INACTIVE, true);
                    transitionMenue.setVisibility(false, true);
                    active = newState;
                }
            }
        }