GAME 1303 — Tier 1 Shared Script Kit

Thirteen C# scripts that give every 2D project in the class a working player, damage, respawn, collectibles, camera, scene flow, audio, HUD, moving platforms and parallax. Written for Unity 6 with the Input System package, Cinemachine 3, and TextMeshPro.

Requirements (Package Manager)

Folder layout

Scripts/

Drop the whole Scripts folder into Assets/.

Tags and layers to create first

15-minute scene checklist

  1. Player: Sprite + Rigidbody2D (Freeze Rotation Z, Gravity Scale 3, Continuous) + Collider2D + PlayerInput (Behavior = Send Messages, use the default actions asset) + PlayerController2D + Health + Animator + PlayerAnimatorBridge. Tag it Player. Add an empty child GroundCheck at the feet and assign it. Set Ground Layer = Ground.
  2. Ground: Tilemap or sprites with colliders on layer Ground.
  3. Camera: GameObject → Cinemachine → 2D Camera. Add CameraTargetAssigner to the CinemachineCamera. Add CinemachineConfiner2D and a PolygonCollider2D bounds object if the level has edges.
  4. Managers: one empty object each — GameManager, RespawnManager, CollectionTracker, AudioManager, SceneLoader (the last two survive scene loads on their own).
  5. Wire events (Inspector, click +):
    • Player Health.OnDied → RespawnManager.OnPlayerDied
    • Player Health.OnHealthChanged → HUDController.UpdateHealth
    • RespawnManager.OnLivesChanged → HUDController.UpdateLives
    • RespawnManager.OnGameOver → GameManager.GameOver
    • CollectionTracker.OnCountChanged → HUDController.UpdateItemCount
    • Player PlayerController2D.OnJumped → AudioManager.PlaySFX (string) "jump"
  6. Hazards: any sprite + collider + DamageOnContact. Tick Instant Kill for pits and acid.
  7. Pickups: create an ItemType asset (Create → GAME1303 → Item Type), make a prefab with sprite + trigger collider + Collectible, assign the asset.
  8. Checkpoints: empty + trigger collider + Checkpoint.
  9. Level exit: trigger with a tiny script or UnityEvent that calls GameManager.Instance.LevelComplete() then SceneLoader.Instance.LoadNext().

Animator parameters expected by PlayerAnimatorBridge

Speed (float), IsGrounded (bool), YVelocity (float), Jump / Hurt / Dead (triggers).

Which games skip which scripts

Notes for the instructor