public void SucceedDanceSequence() { currentGamePhase = "move"; currentDanceTargetTile.SetVisited(); currentDanceTargetTile.GetWorldObject().GetComponent <DV_EnemyAnimation>().WakeUp(); currentDanceTargetTile.GetWorldObject().GetComponent <Ennemy>().StartDancingImpactVFX(); wokeEnemies.Add(currentDanceTargetTile.GetWorldObject().GetComponent <DV_EnemyAnimation>()); discoController.AddDisco(3); discoController.AddBoogie(3); successfulDanceOnThisPlate++; bPaneCleared = successfulDanceOnThisPlate >= world.GetEnnemyCount(); AddScore(50); if (bPaneCleared) { world.ActivateEndColumn(); world.PlayAnimationWaveLeftToRight(); foreach (DV_EnemyAnimation anim in wokeEnemies) { anim.Done(); } } }
private void Move(Vector2 dir) { if (bInputDetectionActive) { bool valid = (gameManager.musicHandler.ValidateBeat() && gameManager.bBeatInput == false); bool obstruction = false; bool enemy = false; bool successfulInput = false; if (gameManager.currentGamePhase == "move") { if (valid) { ITileInfo tileInfo = m_player.DoMove(dir); switch (tileInfo.GetState()) { case TileState.Occupied: obstruction = true; break; case TileState.Ennemy: enemy = true; break; } if (!obstruction) { successfulInput = true; if (enemy) { if (!tileInfo.GetWorldObject().GetComponent <DV_EnemyAnimation>().bWokenUp) { gameManager.BeginDanceSequence(tileInfo); } } } else { gameManager.discoController.OnFailBeat(); } } else { gameManager.discoController.OnFailBeat(); } } else { string moveDirection; if (dir.x == 0f) { if (dir.y > 0f) { moveDirection = "Up"; } else { moveDirection = "Down"; } } else { if (dir.x > 0f) { moveDirection = "Right"; } else { moveDirection = "Left"; } } successfulInput = valid && gameManager.danceSequence.CheckStepValidityAgainstInput(moveDirection, danceStepIndex); if (successfulInput) { gameManager.danceSequence.ValidateStep(danceStepIndex); danceStepIndex++; if (danceStepIndex >= 4) { gameManager.SucceedDanceSequence(); } } else { gameManager.danceSequence.ResetDanceSequence(); danceStepIndex = 0; gameManager.discoController.OnFailBeat(); } } if (successfulInput) { anim.AnimationStep(); } else { gameManager.MissBeatDamage(); } gameManager.ValidateBeat(successfulInput); } }