// If the ray hits something within the repack distance if (hit.collider != null)
using UnityEngine; using UnityEngine.Events; public class PlayerVitals : MonoBehaviour, IDamageable [Header("Health Settings")] [SerializeField] private float maxHealth = 100f; public float CurrentHealth get; private set; [Header("Oxygen Settings")] [SerializeField] private float maxOxygen = 100f; [SerializeField] private float oxygenDepletionRate = 2f; public float CurrentOxygen get; private set; [Header("Events")] public UnityEvent OnPlayerDeath; private void Awake() CurrentHealth = maxHealth; CurrentOxygen = maxOxygen; private void Update() HandleOxygen(); private void HandleOxygen() if (CurrentOxygen > 0) CurrentOxygen -= oxygenDepletionRate * Time.deltaTime; else // Deplete health if oxygen runs completely dry TakeDamage(5f * Time.deltaTime); public void TakeDamage(float damageAmount) CurrentHealth -= damageAmount; if (CurrentHealth <= 0) CurrentHealth = 0; Die(); public void ReplenishOxygen(float amount) CurrentOxygen = Mathf.Min(CurrentOxygen + amount, maxOxygen); private void Die() OnPlayerDeath?.Invoke(); gameObject.SetActive(false); Use code with caution. Data-Driven Environmental Hazards ( HazardData.cs )
Stay tuned for our next post, where we'll be covering day 4 to day 6 of development. We'll be sharing more updates, tips, and tricks, and showing off our progress on the Malevolent Planet Unity2D tutorial series. malevolent planet unity2d day1 to day3 public repack
Malevolent Planet 2D Demo - April 2025 Public Build - Patreon
The public repack is an excellent opportunity for gamers to get a sneak peek into the game's development and provide valuable feedback to the developers. For game developers, the repack offers a unique chance to study the game's mechanics, level design, and programming techniques, and learn from the developers' experiences. // If the ray hits something within the
The to see what changed between the Day 1-3 repack and current versions.
void Update()
This guide provides a basic foundation for creating a malevolent planet game in Unity 2D. You can build upon this foundation by adding more features, mechanics, and polish to create a engaging and challenging game.
If you experience frame drops during nighttime pixel-particle rendering, lower the lighting quality in the video options. For game developers, the repack offers a unique
You enjoy Iron Lung , Faith: The Unholy Trinity , or World of Horror . You like debugging games yourself. You aren't afraid of pink texture squares.
Plant the seeds gathered on Day 1 to initiate a renewable food source. Mapping the Local Sector