Skip to content

Instantly share code, notes, and snippets.

View Templar2020's full-sized avatar
🤠
Yeeeha!

Templar2020

🤠
Yeeeha!
View GitHub Profile
@Templar2020
Templar2020 / Controller2D.cs
Last active November 17, 2015 01:26
Basic 2D Controller
using UnityEngine;
using System.Collections;
public class Controller2D : MonoBehaviour {
// Player Movement
public float moveSpeed;
public float jumpHeight;
// No Stick
@Templar2020
Templar2020 / PlayerController.cs
Created September 14, 2015 23:53
2D Player Controller
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
//Player movement variables
public float moveSpeed;
public float jumpHeight;
private bool doubleJump;
using UnityEngine;
using System.Collections;
public class DeathBox : MonoBehaviour {
void OnTriggerEnter2D (Collider2D other){
if(other.name == "Player")
{
Debug.Log("Player Enters Death Zone");
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class ScoreManager : MonoBehaviour {
public static int score;
Text text;
// Use this for initialization
using UnityEngine;
using System.Collections;
public class CoinPickup : MonoBehaviour {
public int pointsToAdd;
void OnTriggerEnter2D (Collider2D other)
{
if(other.GetComponent<PlayerController>()== null)
using UnityEngine;
using System.Collections;
public class CheckPoint : MonoBehaviour {
public LevelManager levelManager;
// Use this for initialization
void Start () {
levelManager = FindObjectOfType <LevelManager>();
using UnityEngine;
using System.Collections;
public class KillPlayer : MonoBehaviour {
public LevelManager levelManager;
// Use this for initialization
void Start () {
using UnityEngine;
using System.Collections;
public class LevelManager : MonoBehaviour {
public GameObject currentCheckPoint;
private Controller2D player;
// Particles
public GameObject deathParticle;
using UnityEngine;
using System.Collections;
public class DestroyFinishedParticle : MonoBehaviour {
private ParticleSystem thisParticleSystem;
// Use this for initialization
void Start () {
thisParticleSystem = GetComponent<ParticleSystem>();
using UnityEngine;
using System.Collections;
public class CoinPickup : MonoBehaviour {
public int pointsToAdd;
void OnTriggerEnter2D (Collider2D other){
if (other.GetComponent<Controller2D> () == null)
return;