public override void Update() { if (!_activationStarted) { if (Random.Range(1, 100) <= DifficultLevel.PercentChanceForActivatingNextMachine() && Random.Range(1, 100) > 75) { ActiveMachines.AddActiveMachine(); _activationStarted = true; float activationTime = Random.Range(machine.activationInterval / 3, machine.activationInterval); Invoke("ActivateMachine", activationTime); } } if (!_helmMinigameReadyToStart && !_helmMinigameStarted && _periscopeInteractable.GetState() == InteractableState.Blocked && GetState() == InteractableState.Blocked) { _helmMinigameReadyToStart = true; } if (_helmMinigameReadyToStart && !_helmMinigameStarted) { _helmMinigameStarted = true; RunMinigame(); } }
public void DifficultChange(DifficultLevel difficultLevel) { _fieldSize = difficultLevel.GameFieldSize; _startOffset = difficultLevel.StatrtOffset; _platformSize = difficultLevel.PlatformSize; _platformsVisibleRange = difficultLevel.PlatformsVisibleRange; }
public void OnClickNormalDifficulLevel() { SoundBase.Instance.GetComponent <AudioSource>().PlayOneShot(SoundBase.Instance.click); difficultLevel = DifficultLevel.Normal; SoundBase.Instance.GetComponent <AudioSource>().PlayOneShot(SoundBase.Instance.click); LoadGame(gameMode, difficultLevel); }
private void IncreaseLevel() { _difficultCounter = _difficultCounter + 1; if (_difficultCounter == difficultIncreaseFrequency) { DifficultLevel.IncreaseDifficultLevel(); _difficultCounter = 0; } }
void SetDifficultLevel() { try{ if (difficultLevels[indexDifficultLevel + 1].startDistance < distance) { currentDifficultLevel = difficultLevels[indexDifficultLevel + 1]; indexDifficultLevel++; } } catch (System.IndexOutOfRangeException) {} }
public static void Load() { _gameData = new VirusGameData(); CurDifficultLevel = DifficultLevel.Difficult; InitCoinValue(); if (VirusGameMrg.Instance.m_UIMrg.m_MapManage != null) { VirusGameMrg.Instance.m_UIMrg.m_MapManage.Init(); } }
public virtual void Update() { if (!_activationStarted) { if (Random.Range(1, 100) <= DifficultLevel.PercentChanceForActivatingNextMachine() && Random.Range(1, 100) > 75) { ActiveMachines.AddActiveMachine(); _activationStarted = true; float activationTime = Random.Range(machine.activationInterval / 3, machine.activationInterval); Invoke("ActivateMachine", activationTime); } } }
public GuiController() { _difficultLevel = FileOperations.LoadSettings(EasyLevel); Field = new Field(_difficultLevel.Width, _difficultLevel.Height, _difficultLevel.MinesCount); var dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Tick += TickTimer; dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 10); dispatcherTimer.Start(); HighScores = FileOperations.LoadScores(EasyLevel); UserName = Environment.UserName; }
public void LoadSavedGame() { SoundBase.Instance.GetComponent <AudioSource>().PlayOneShot(SoundBase.Instance.click); if (Settings.HasSave == 0) { return; } Settings.HasSave = 0; GameMode gameMode = (GameMode)Settings.GameMode; DifficultLevel difficultLevel = (DifficultLevel)Settings.DifficultLevel; LoadGame(gameMode, difficultLevel, true); //LoadGame(GameMode.Time,DifficultLevel.Hard); }
void Start() { _ball.ballInZone += ballInZone => { _ballInZone = ballInZone; if (!ballInZone) { _pressReady = true; } }; requiredSuccess = 3 + DifficultLevel.GetDifficultLevel() / 5; Debug.Log("Required success: " + requiredSuccess); }
public void PissQueen() { if (_satisfactionLevel > 1) { if (_satisfactionLevel == 2) { DifficultLevel.AddDifficultLevel(pissLevel); } _satisfactionLevel -= 1; _wasPissedOnce = true; Score.SetMultiplier(1); } RenderSatisfaction(); }
private void EndDrinking() { foreach (var playerController in _playerControllers) { playerController.StopDrinking(); playerController.SetPlayerStatus(PlayerStatus.Free); } _spriteRenderer.sprite = tableWithCups; DeactivateMachine(); _text.text = ""; _textbox.SetActive(false); IncreaseLevel(); Score.AddScore(DifficultLevel.GetDifficultLevel() * 5); _audioController.PlayNormalMusic(); _quunOMeter.SatisfyQueen(); }
private void SetupRowColOfBoard(DifficultLevel difficultLevel) { switch (difficultLevel) { case DifficultLevel.Normal: row = 7; col = 12; // row = 6; // col = 8; break; case DifficultLevel.Hard: row = 9; col = 16; break; } }
void Awake() { if (SaveManager.instance.state.levelAI == 0) { difLevel = DifficultLevel.Easy; } else if (SaveManager.instance.state.levelAI == 1) { difLevel = DifficultLevel.Normal; } else if (SaveManager.instance.state.levelAI == 2) { difLevel = DifficultLevel.Hard; } else if (SaveManager.instance.state.levelAI == 3) { difLevel = DifficultLevel.WhatTheFuckIamPlaying; } else if (SaveManager.instance.state.levelAI == 4) { difLevel = DifficultLevel.Tor1; } else if (SaveManager.instance.state.levelAI == 5) { difLevel = DifficultLevel.Tor2; } else if (SaveManager.instance.state.levelAI == 6) { difLevel = DifficultLevel.Tor3; } else if (SaveManager.instance.state.levelAI == 7) { difLevel = DifficultLevel.Tor4; } if (left) { fingerAILeft = finger.GetComponent <FingerLeftControl> (); } else if (right) { fingerAIRight = finger.GetComponent <FingerRightControl> (); } }
protected virtual void RunMinigame() { MiniGamePanel miniGamePanel = Instantiate(_minigamePanelPrefab, transform.position, transform.rotation).GetComponent <MiniGamePanel>(); miniGamePanel.InitialiseGame(_playerControllers, machine.gameType); miniGamePanel.OnSuccess += success => { if (success) { DeactivateMachine(); Score.AddScore(DifficultLevel.GetDifficultLevel()); } else { _shipHitpoints.RecieveDamage(machine.damageOnExplode); DeactivateMachine(); } }; }
// Use this for initialization public virtual void Initialize(GeneralOptions options, GameScene gameScene) { this.gameScene = gameScene; difficultLevel = (DifficultLevel)options["difficultLevel"]; gameMode = (GameMode)options["gameMode"]; isSavedGame = (bool)options ["isSavedGame"]; SetupRowColOfBoard(difficultLevel); // setup custom fsm fsm = gameObject.AddComponent <CustomFSMManager> (); fsm.Initialize(typeof(GameState), this, false); StateMachineChange = new StateMachineChangeDelegate(fsm.StateMachineChange); if (isSavedGame) { StateMachineChange(GameState.LoadSavedGame); } else { StateMachineChange(GameState.StartGame); } }
public void SatisfyQueen() { if (_satisfactionLevel < 3) { if (_satisfactionLevel == 1) { DifficultLevel.SubstractDifficultLevel(pissLevel); } if (!_wasPissedOnce) { _satisfactionLevel += 1; } else if (_wasPissedOnce && _satisfactionLevel < 2) { _satisfactionLevel += 1; } } RenderSatisfaction(); }
public void LoadGame(GameMode gameMode, DifficultLevel difficultLevel, bool isSavedGame = false) { switch (gameMode) { case GameMode.Leisure: TaskRunner.Instance.Run(SceneManager.Instance.LoadSceneAsync("LeisureModeScene", GeneralOptions.Create("difficultLevel", difficultLevel, "gameMode", GameMode.Leisure, "isSavedGame", isSavedGame))); return; case GameMode.Time: TaskRunner.Instance.Run(SceneManager.Instance.LoadSceneAsync("TimeModeScene", GeneralOptions.Create("difficultLevel", difficultLevel, "gameMode", GameMode.Time, "isSavedGame", isSavedGame))); return; case GameMode.Challenge: TaskRunner.Instance.Run(SceneManager.Instance.LoadSceneAsync("ChallengeModeScene", GeneralOptions.Create("difficultLevel", difficultLevel, "gameMode", GameMode.Challenge, "isSavedGame", isSavedGame))); return; case GameMode.Survival: TaskRunner.Instance.Run(SceneManager.Instance.LoadSceneAsync("SurvivalModeScene", GeneralOptions.Create("difficultLevel", difficultLevel, "gameMode", GameMode.Survival, "isSavedGame", isSavedGame))); return; } }
public void DifficultChange(DifficultLevel difficultLevel) { _pooledObject = difficultLevel.Platform; isNeedToReCreatePool = true; }
void Start() { currentDifficultLevel = difficultLevels[0]; }
public static void Load() { _gameData = new VirusGameData(); CurDifficultLevel = DifficultLevel.Difficult; }
private void HandlePressingButtons() { if (Input.GetKeyDown(_playerControllers[0].activateButton)) { _valveSliders[0].value += (valveProgressOnButtonPress / 100) - (valveProgressOnButtonPress / 10000 * DifficultLevel.GetDifficultLevel()); _audioSource.Play(); } if (Input.GetKeyDown(_playerControllers[1].activateButton)) { _valveSliders[1].value += (valveProgressOnButtonPress / 100) - (valveProgressOnButtonPress / 10000 * DifficultLevel.GetDifficultLevel()); _audioSource.Play(); } }
void SetNextDifficultLevel() { indexDifficultLevel++; currentDifficultLevel = difficultLevels[indexDifficultLevel]; }
public void DifficultChange(DifficultLevel difficultLevel) { _placeRule = difficultLevel.DiamonPlace; _maxPlacesInStack = difficultLevel.MaxPlacesInStack; }
void Update() { float currentSpeed = rockSpeed + (rockSpeed * (DifficultLevel.GetDifficultLevel() / 50)); transform.Translate(0, currentSpeed * Time.deltaTime, 0); }
public GameManager(DifficultLevel level, GameAreaManager areaManager) { Level = level; _areaManager = areaManager; }
private void ReloadText() { _text.text = "Difficult: " + DifficultLevel.GetDifficultLevel(); }