This section will cover the code that is present in this chapter:
Code
PlayerController.cs
Here's the code:
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public static PlayerController instance;
public float jumpForce = 6f;
public float runningSpeed = 1.5f;
public Animator animator;
private Vector3 startingPosition;
private Rigidbody2D rigidBody;
public AudioClip killSound;
void Awake() {
instance = this;
rigidBody = GetComponent<Rigidbody2D>();
startingPosition = this.transform.position;
}
public void StartGame() {
animator.SetBool("isAlive", true);
this.transform...