New graphics and general polish
Also fixed visual pickup bugs Sets up bloom effects and materials UI and ux adjustments/polish
This commit is contained in:
@@ -39,6 +39,9 @@ public class ScoreboardManager : MonoBehaviour
|
||||
//set current score
|
||||
currentScore.text = gm.score.ToString();
|
||||
playerScore = gm.score;
|
||||
|
||||
//disable gamemanager
|
||||
gm.enabled = false;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
||||
@@ -7,10 +7,14 @@ using TMPro;
|
||||
public class UIManager : MonoBehaviour
|
||||
{
|
||||
public TextMeshProUGUI playerHealthLabel;
|
||||
public TextMeshProUGUI gameOverLabel;
|
||||
public GameObject gameOverPanel;
|
||||
public TextMeshProUGUI scoreLabel;
|
||||
public TextMeshProUGUI waveLabel;
|
||||
|
||||
public GameObject healthContainer;
|
||||
|
||||
public Image healthBar;
|
||||
|
||||
public Button restartButton;
|
||||
public Button scoreboardButton;
|
||||
private GameManager gameManager;
|
||||
@@ -24,6 +28,7 @@ public class UIManager : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
healthBar.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, gameManager.player.health * 3);
|
||||
//round player health
|
||||
playerHealthLabel.text = "Health: " + Mathf.Round(gameManager.player.health).ToString();
|
||||
|
||||
@@ -33,9 +38,18 @@ public class UIManager : MonoBehaviour
|
||||
|
||||
if (gameManager.player.health <= 0)
|
||||
{
|
||||
gameOverLabel.gameObject.SetActive(true);
|
||||
Debug.Log("Game Over");
|
||||
gameOverPanel.SetActive(true);
|
||||
restartButton.gameObject.SetActive(true);
|
||||
scoreboardButton.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
if (gameManager.player.health <= 15)
|
||||
{
|
||||
//play animation on healthContainer
|
||||
healthContainer.GetComponent<Animation>().Play();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ public class NoTrail : Pickup
|
||||
|
||||
public override void OnPickup()
|
||||
{
|
||||
//hide sprite renderer
|
||||
gameObject.GetComponent<SpriteRenderer>().enabled = false;
|
||||
|
||||
player.trail.SetActive(false);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ public class Slowmotion : Pickup
|
||||
Debug.Log("Slowmotion");
|
||||
isSlow = true;
|
||||
Time.timeScale = Time.timeScale * slowFactor;
|
||||
|
||||
//disable sprite renderer
|
||||
GetComponent<SpriteRenderer>().enabled = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ public class Player : MonoBehaviour
|
||||
public float rotationSpeed;
|
||||
public float direction;
|
||||
public List<ParticleCollisionEvent> collisionEvents;
|
||||
public float speedIncrease;
|
||||
public bool isLit;
|
||||
|
||||
public Camera camera;
|
||||
@@ -58,8 +59,10 @@ public class Player : MonoBehaviour
|
||||
//mousePos.y = transform.position.y;
|
||||
//transform.LookAt(mousePos);
|
||||
|
||||
|
||||
//if isLit decrease health
|
||||
if (isLit)
|
||||
//Invincible for the first 2 seconds to avoid particle collision bug
|
||||
if (isLit && Time.timeSinceLevelLoad > 2)
|
||||
{
|
||||
health -= 100.0f * Time.deltaTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user