Skip to content

Instantly share code, notes, and snippets.

View GameDevMix's full-sized avatar
💻
Playing games? Or making games? An eternal struggle...

GameDevMix GameDevMix

💻
Playing games? Or making games? An eternal struggle...
View GitHub Profile
@GameDevMix
GameDevMix / PlayerMovementController.cs
Last active October 16, 2023 17:43
A simple 2D movement controller for a platformer player character in Unity
using UnityEngine;
// A simple 2D movement controller for a player in Unity
public class PlayerMovementController : MonoBehaviour
{
#region Gameplay properties
// Horizontal player keyboard input
// -1 = Left
// 0 = No input
@GameDevMix
GameDevMix / PlayerHealthController.cs
Last active January 27, 2024 13:47
A simple health and death controller for a player character in Unity
using UnityEngine;
// A simple health controller for a player in Unity
public class PlayerHealthController : MonoBehaviour
{
#region Properties
// The player's health at the start
[SerializeField] private int healthInitial = 3;