public void RaiseLevelCompleted() { if (!GameObjects.GetGameState().LevelEditor) { LevelCompleted.Invoke(); } }
void OnTriggerEnter2D(Collider2D col) { if (col.CompareTag("Player")) { LevelCompleted?.Invoke(); } }
/// <summary> /// Triggers the Game Over State /// </summary> private void TriggerLevelComplete() { //Set it to be nobody's turn CurrentTurn = GameTurn.TURN_NONE; //Send Level Failed Event LevelCompleted?.Invoke(); }
public bool CheckLevelCompleted() { if (objectivesFilled.AllFilled()) { LevelCompleted.Invoke(); return(true); } return(false); }
public void LoadSongs() { MenuSong = _content.Load <Song>(SoundPath + "menu"); IngameSong = _content.Load <Song>(SoundPath + "ingame"); StorySong = _content.Load <Song>(SoundPath + "story_song"); GameOver = _content.Load <SoundEffect>(SoundPath + "game_over"); LevelCompleted = _content.Load <SoundEffect>(SoundPath + "level_completed"); Pickaxe = _content.Load <SoundEffect>(SoundPath + "pickaxe"); PickKey = _content.Load <SoundEffect>(SoundPath + "pick_key"); InteractDoor = _content.Load <SoundEffect>(SoundPath + "interact_door"); Dying = _content.Load <SoundEffect>(SoundPath + "dying"); gameOverInstance = GameOver.CreateInstance(); levelCompletedInstance = LevelCompleted.CreateInstance(); }
void Start() { player = GameObject.FindWithTag("Player"); facingRight = true; soundManager = FindObjectOfType <SoundManager>(); levelTransition = FindObjectOfType <LevelTransition>(); levelCompleted = FindObjectOfType <LevelCompleted>(); gameCompleted = FindObjectOfType <GameCompleted>(); gameOver = FindObjectOfType <GameOver>(); playerDied = FindObjectOfType <PlayerDied>(); collectiblesManager = FindObjectOfType <CollectiblesManager>(); lifeManager = FindObjectOfType <LifeManager>(); saveData = FindObjectOfType <SaveData>(); rigidBody = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); }
public static void CallLevelCompleted() { LevelCompleted?.Invoke(); }
/// <summary> /// Trigger actions to end the current game with a success state /// </summary> private void TriggerLevelComplete() { LevelCompleted?.Invoke(); gameRunning = false; }
/// <summary> /// Trigger actions to end the current game with a success state /// </summary> private void TriggerLevelComplete() { LevelCompleted?.Invoke(); }
/// <summary> /// Trigger that the level has failed /// </summary> public void TriggerLevelFailed() { LevelCompleted?.Invoke(); }
public static void TriggerLevelComplete() => LevelCompleted?.Invoke();