コード例 #1
0
ファイル: PlayerLives.cs プロジェクト: Shad0X/Asteroids
 private void OnPlayerLostLive() //mainly or ONLY stuff for PlayerManager... not rly relevent to GameLogic BESIDES Player LIFE count...
 {
     livesLeft -= 1;
     OnPlayerLivesChanged?.Invoke(livesLeft);
     if (livesLeft > 0)
     {
         OnRespawnPlayer?.Invoke();
     }
 }
コード例 #2
0
ファイル: PlayerLives.cs プロジェクト: Shad0X/Asteroids
    void AddLive()
    {
        livesLeft += 1;

        if (livesLeft > 250) // https://en.wikipedia.org/wiki/Asteroids_(video_game)#:~:text=Asteroids%20contains%20several%20bugs.,than%20250%20lives%20are%20collected.
        {
            livesLeft = 0;
        }

        OnPlayerLivesChanged?.Invoke(livesLeft);
        AudioSource.PlayClipAtPoint(playerGainedLive, gameObject.transform.position);
    }
コード例 #3
0
ファイル: PlayerLives.cs プロジェクト: Shad0X/Asteroids
 private void ResetPlayerLiveCount()
 {
     livesLeft = GameConfig.PlayerLiveCountAtStart;
     OnPlayerLivesChanged?.Invoke(livesLeft);
 }