protected void setRevealActivity(bool active) { if (MediumButton != null) { if (!active) { MediumButton.setState(Panel.PanelState.INACTIVE, false); } else if (MediumButton.getState() == Panel.PanelState.INACTIVE) { MediumButton.setState(Panel.PanelState.IDLE, false); } } }
protected void setLaserActivity(bool active) { if (LaserButton != null) { if (!active) { LaserButton.setState(Panel.PanelState.INACTIVE, false); } else if (LaserButton.getState() == Panel.PanelState.INACTIVE) { LaserButton.setState(Panel.PanelState.IDLE, false); } } }
/** * Conducts final initialization of gameplay objects including the current level * Required to begine a game */ internal void newGame(GhostFinderInterface userCode, int LevelNum) { //Background Music backGroundMusic.setVolume(0.1); this.setUpdateState(updateState.INGAME); currentLevel = userCode; LevelNumber = LevelNum; ((LevelButton)transitionMenue.getPanel(0)).setLevel(this, currentLevel, LevelNum); if (mainMenue.getPanel(2).getPanel(0).getPanel(LevelNum + 1) != null) { ((LevelButton)transitionMenue.getPanel(1)).setLevel(this, ((LevelButton)mainMenue.getPanel(2).getPanel(0).getPanel(LevelNumber + 1)).gameLevel, LevelNumber + 1); } else { ((LevelButton)transitionMenue.getPanel(1)).setLevel(this, null); } ((LevelButton)mainMenue.getPanel(0)).setLevel(this, userCode, LevelNum); //endGame(); setHeartHighlight(false); setHeartCount(4); //Enemies enemies.RemoveAllEnemies(); //Player player.setWidth(player.getHeight() / 2); player.setCenterY(BaseCode.worldHeight - (player.getHeight() / 2)); player.setCollumn(1); player.setEnemySet(enemies); player.visible = true; player.getLight().visible = true; BaseCode.activeDrawSet.addToDrawSet(player); player.setPriority(7); //powerBar powerBar.setSize(4.0f, 20.0f); powerBar.setCenter((BaseCode.worldWidth - (powerBar.getWidth()) / 2), (powerBar.getHeight() / 2) + 5f); powerBar.setMaxScore(10.0f); powerBar.setScore(0.0f); powerBar.setToVertical(); powerBar.setVisibility(true); BaseCode.activeDrawSet.addToDrawSet(powerBar); powerBar.setPriority(7); //Animation timer animationDelay = 30; //typeSelectedText typeSelectedText.textPosition.X = 1.0f; //typeSelectedText.textPosition.Y = 3.0f; typeSelectedText.text = ("Score: " + player.getScore()); typeSelectedText.visible = true; typeSelectedText.setPriority(7); userText.textPosition.X = 20f; //userText.textPosition.Y = 3.0f; userText.text = (""); userText.visible = true; //buttons //Reveal mediumButton.getBackGround().setSize(4f, 4f); mediumButton.getBackGround().setCenter(BaseCode.worldWidth - (mediumButton.getBackGround().getWidth() / 2), (BaseCode.worldHeight / 2)); mediumButton.setVisibility(true, true); mediumButton.setState(MenueSystem.Panel.PanelState.IDLE, true); mediumButton.setSparcleVisiblity(false); mediumButton.setPriority(7); BaseCode.activeDrawSet.addToDrawSet(mediumButton); //Wide wideButton.getBackGround().setSize(4f, 4f); wideButton.getBackGround().setCenter(BaseCode.worldWidth - (mediumButton.getBackGround().getWidth() / 2), (BaseCode.worldHeight / 2) + 5f); wideButton.setVisibility(true, true); wideButton.setState(MenueSystem.Panel.PanelState.IDLE, true); wideButton.setSparcleVisiblity(false); wideButton.setPriority(7); BaseCode.activeDrawSet.addToDrawSet(wideButton); //Laser laserButton.getBackGround().setSize(4f, 4f); laserButton.getBackGround().setCenter(BaseCode.worldWidth - (mediumButton.getBackGround().getWidth() / 2), (BaseCode.worldHeight / 2) + 10f); laserButton.setVisibility(true, true); laserButton.setState(MenueSystem.Panel.PanelState.IDLE, true); laserButton.setSparcleVisiblity(false); laserButton.setPriority(7); BaseCode.activeDrawSet.addToDrawSet(laserButton); player.setCollumn(0); if (userCode != null) { InteractableObject.setDefualtsToDefualts(); player.turnLightOnorOff(false); userCode.objectGrid.setObjectGrid(enemies.getGrid()); synkPlayerStateWithTrueState(); if (userCode.objectGrid != null) { userCode.objectGrid.reset(); } if (userCode.primitiveGrid != null) { userCode.primitiveGrid.reset(); } userCode.initialize(); synkTrueStateWithPlayerState(); userCode.light.updateMaxPosition(userCode.objectGrid.getObjectGrid()); StateChange change = enemies.synkGrid(userCode.objectGrid.getObjectGrid(), animationDelay); if (change != null && change.puaseForAnimation) { animationPuaseTimer = animationDelay; enemies.setEnemyAnimations(0); } } state = GameState.EndState.CONTINUE; }