This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |