code systems



  • MoneyManagerTMP tracks currentMoney, lets you spend or lose funds and displays texts for your balance, and inventory list. It uses a singleton pattern for global,  and SceneManager.LoadScene triggers you to go to detention when you run out of money.

  • ClothesMoney reads its price, shows it on a  price label, and hooks into its Button.onClick event. When clicked, it calls MoneyManagerTMP.instance.SpendMoney(...), disabling the button on success or showing “Not enough money!” feedback on failure.
  • ZombieAI uses Rigidbody2D.MovePosition  to chase the player at moveSpeed. On collision with the player , it calls MoneyManagerTMP to deduct cash.
  • ZombieCollisionHandler sits on the player and checks OnCollisionEnter2D against  the Zombie. 
  • PlayerShooter listens for("Fire1"), converts the mouse position to world coordinates, and uses Physics2D to find a  collider. If that object has SceneTransitionOnShot, it triggers the user to go to the the next scend.

Leave a comment

Log in with itch.io to leave a comment.