<commit_before>﻿using UnityEngine;
using System.Collections;

public class playerControler : MonoBehaviour {

    public float maxSpeed = 10f;
    bool facingRight = true;

    Animator anim;

    bool grounded = false;
    public Transform GroundCheck;
    public float groundRadius = 0.2f;
    public LayerMask whatIsGround;
    public float jumpForce = 700f;
    public bool upright = false;
    GameObject uprightCollider;
    GameObject quadrupedalCollider;
	GameObject crouchCollider;
	bool doJump = false;
	bool crouch = false;
	bool frozen = false;
	bool fireball = false;

    // Use this for initialization
    void Start()
    {
        anim = GetComponent<Animator>();
        uprightCollider = transform.Find("uprightCollider").gameObject;
        quadrupedalCollider = transform.Find("quadrupedalCollider").gameObject;
		crouchCollider = transform.Find ("crouchCollider").gameObject;
        uprightCollider.SetActive(false);
		crouchCollider.SetActive (false);
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        grounded = Physics2D.OverlapCircle(GroundCheck.position, groundRadius, whatIsGround);
        anim.SetBool("grounded", grounded);
		if (!frozen) {
			float move = Input.GetAxis ("Horizontal");
			float speed = move * maxSpeed;
			if (upright) {
				speed = speed / 2;
			}
			anim.SetFloat ("speed", Mathf.Abs (move));
			GetComponent<Rigidbody2D> ().velocity = new Vector2 (speed, GetComponent<Rigidbody2D> ().velocity.y);
			if (speed != 0) {
				crouch = false;
			}
			if (move > 0 && !facingRight) {
				Flip ();
			} else if (move < 0 && facingRight) {
				Flip ();
			}
			Crouch ();
			if (upright && !crouch) {
				uprightCollider.SetActive (true);
				quadrupedalCollider.SetActive (false);
				anim.SetBool ("upright", true);
			} else if (!crouch) {
				uprightCollider.SetActive (false);
				quadrupedalCollider.SetActive (true);
				anim.SetBool ("upright", false);
			}
		}
//		if (fireball) {
//			fireball = false;
//			anim.SetBool ("fireball", false);
//			frozen = false;
//		}
//		if (Input.GetKeyDown (KeyCode.Space)) {
//			fireball = true;
//			anim.SetBool ("fireball", true);
//			frozen = true;
//		}
    }


    void Update()
    {
		if (Input.GetKeyDown (KeyCode.Space)) {
			fireball = true;
			anim.SetBool ("fireball", true);
			frozen = true;
		}
		float jump = jumpForce;
		if (upright) {
			jump = jump / 3;<commit_msg>Fixed Player Freezing Problem<commit_after>﻿using UnityEngine;
using System.Collections;

public class playerControler : MonoBehaviour {

    public float maxSpeed = 10f;
    bool facingRight = true;

    Animator anim;

    bool grounded = false;
    public Transform GroundCheck;
    public float groundRadius = 0.2f;
    public LayerMask whatIsGround;
    public float jumpForce = 700f;
    public bool upright = false;
    GameObject uprightCollider;
    GameObject quadrupedalCollider;
	GameObject crouchCollider;
	bool doJump = false;
	bool crouch = false;
	bool frozen = false;
	bool fireball = false;

    // Use this for initialization
    void Start()
    {
        anim = GetComponent<Animator>();
        uprightCollider = transform.Find("uprightCollider").gameObject;
        quadrupedalCollider = transform.Find("quadrupedalCollider").gameObject;
		crouchCollider = transform.Find ("crouchCollider").gameObject;
        uprightCollider.SetActive(false);
		crouchCollider.SetActive (false);
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        grounded = Physics2D.OverlapCircle(GroundCheck.position, groundRadius, whatIsGround);
        anim.SetBool("grounded", grounded);
		if (!frozen) {
			float move = Input.GetAxis ("Horizontal");
			float speed = move * maxSpeed;
			if (upright) {
				speed = speed / 2;
			}
			anim.SetFloat ("speed", Mathf.Abs (move));
			GetComponent<Rigidbody2D> ().velocity = new Vector2 (speed, GetComponent<Rigidbody2D> ().velocity.y);
			if (speed != 0) {
				crouch = false;
			}
			if (move > 0 && !facingRight) {
				Flip ();
			} else if (move < 0 && facingRight) {
				Flip ();
			}
			Crouch ();
			if (upright && !crouch) {
				uprightCollider.SetActive (true);
				quadrupedalCollider.SetActive (false);
				anim.SetBool ("upright", true);
			} else if (!crouch) {
				uprightCollider.SetActive (false);
				quadrupedalCollider.SetActive (true);
				anim.SetBool ("upright", false);
			}
		}
//		if (fireball) {
//			fireball = false;
//			anim.SetBool ("fireball", false);
//			frozen = false;
//		}
//		if (Input.GetKeyDown (KeyCode.Space)) {
//			fireball = true;
//			anim.SetBool ("fireball", true);
//			frozen = true;
//		}
    }


    void Update()
    {
		if (Input.GetKeyDown (KeyCode.Space)) {
			fireball = true;
		}
		float jump = jumpForce;
		if (upright) {
			jump = jump / 3;
{'fraction_non_alphanumeric': 0.1263575605680869, 'fraction_numerical': 0.006683375104427736, 'mean_word_length': 3.014249790444258, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7567644', 'n_tokens_mistral': 1809, 'n_tokens_neox': 1564, 'n_words': 377}