using UnityEngine; using System; public class PlayerAttributes : MonoBehaviour [SerializeField] private float maxHealth = 100f; [SerializeField] private float oxygenDepletionRate = 1.5f; public float CurrentHealth get; private set; public float CurrentOxygen get; private set; public static event Action OnPlayerDeath; void Start() CurrentHealth = maxHealth; CurrentOxygen = maxHealth; void Update() DepleteOxygen(); private void DepleteOxygen() if (CurrentOxygen > 0) CurrentOxygen -= oxygenDepletionRate * Time.deltaTime; else TakeDamage(5f * Time.deltaTime); public void TakeDamage(float amount) CurrentHealth -= amount; if (CurrentHealth <= 0) CurrentHealth = 0; OnPlayerDeath?.Invoke(); public void ReplenishOxygen(float amount) CurrentOxygen = Mathf.Min(CurrentOxygen + amount, maxHealth); Use code with caution. 2. Collectible Oxygen Canisters Create a 2D Sprite GameObject named OxygenCanister . Add a CircleCollider2D set to . Create a script called Collectible.cs :
Note: This build is a public release and contains mature content intended for adult audiences.
By the end of Day 3, the game was significantly polished, with a solid foundation for further development. malevolent planet unity2d day1 to day3 public link
Note: If the link is not yet live, check the project’s official Discord or Itch.io page for updates.
: Add a Post-Process Volume with a heavy vignette effect to simulate claustrophobia and isolation. : Add a Post-Process Volume with a heavy
The main physical terrain, fitted with a Tilemap Collider 2D and a Composite Collider 2D set to Used By Composite . This minimizes collider vertices, optimizing physics calculations. Character Controller Foundations
One of the biggest challenges on Day 1 was getting used to Unity's interface and learning the basic navigation. However, with the help of Unity's extensive documentation and tutorials, our developer was able to quickly get up to speed. optimizing physics calculations.
Day 2: Dynamic Atmospheric Visuals and Environmental Hazards
Implementation of the "Hub" centric exploration model, inspired by the Citadel from Mass Effect.
Add a custom script HazardZone.cs to drain health when the player stays inside:
What kind of (melee, shooting, or avoidance) do you want to implement?