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

public class Player : MonoBehaviour {

    private int playerNumber; //player number in relation to the game
    public int controllerNumber; //joystick number of player, public for debug
    private Vector3 startingPosition = new Vector3(0.0f,1.0f,-6.5f);

    public float maxSpeed = 8.0f;
    public float jumpPower = 7.0f;
    private float jumpDelay = 0.6f;
    private bool canJump = true;

    private Rigidbody _rigidbody;
    private Quaternion rotation;

	float moveX = 0;
	float moveY = 0;
	// Use this for initialization
	void Start () {
        _rigidbody = this.GetComponent<Rigidbody>();

        //controllerNumber = 1;
	}
	
	// Update is called once per frame
	void Update () {
		//keyboard is automatically applied to player one
		if (controllerNumber != 1) {
			
			//position of the movement thumbstick
			moveX = Input.GetAxis ("Horizontal_" + controllerNumber);
			moveY = Input.GetAxis ("Vertical_" + controllerNumber);

		//Convert Keyboard into controller axis
		} else {
			if(Input.GetKey("up")){
				moveY = Mathf.Min(1,moveY+.1f);
			}
			if(Input.GetKey("down")){
				moveY = Mathf.Max(-1,moveY-.1f);
			}
			if(Input.GetKey("left")){
				moveX = Mathf.Max(-1,moveX-.1f);
			}
			if(Input.GetKey("right")){
				moveX = Mathf.Min(1,moveX+.1f);
			}
			if(!Input.GetKey("up") && !Input.GetKey("down")){
				moveY = 0;
			}
			if(!Input.GetKey("left") && !Input.GetKey("right")){
				moveX = 0;
			}
		}
        if(moveX != 0 || moveY != 0) //only does movement code if you are moving

        {
            Vector3 axisVector = new Vector3(
                                               moveX,
                                               0,
                                               moveY);

            //moving character
            _rigidbody.velocity = new Vector3(axisVector.x * maxSpeed, _rigidbody.velocity.y, axisVector.z * maxSpeed);

            //rotating character
            Vector2 t = new Vector2(moveX, moveY);
            if (t.magnitude < 0.2f)
            {
                this.transform.rotation = rotation;
            }
            else
            {
                rotation = Quaternion.Euler(new Vector3(0, Mathf.Atan2(moveX, moveY) * Mathf.Rad2Deg, 0));
                this.transform.rotation = rotation;
            }

        }

       

		if (canJump && Input.GetButtonDown("Jump_" + controllerNumber) || (Input.GetKeyDown(KeyCode.Space) && controllerNumber == 1))
        {
            StartCoroutine(Jump());
        }

        if (Input.GetButtonDown("Submit_" + controllerNumber))
        {
            _rigidbody.velocity = new Vector3();
            _rigidbody.position = startingPosition;
        }


    }

    IEnumerator Jump()
    {
        canJump = false;
        jump();
        yield return new WaitForSeconds(jumpDelay);
        canJump = true;
    }

    private void jump()
    {
        _rigidbody.AddForce(new Vector3(0, jumpPower, 0), ForceMode.VelocityChange);
    }
}
<commit_msg>Player jump force is now private and is set to 9.6f<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour {

    private int playerNumber; //player number in relation to the game
    public int controllerNumber; //joystick number of player, public for debug
    private Vector3 startingPosition = new Vector3(0.0f,1.0f,-6.5f);

    public float maxSpeed = 8.0f;
    private float jumpPower = 9.6f; //use 9.6f
    private float jumpDelay = 0.8f;
    private bool canJump = true;

    private Rigidbody _rigidbody;
    private Quaternion rotation;

	float moveX = 0;
	float moveY = 0;
	// Use this for initialization
	void Start () {
        _rigidbody = this.GetComponent<Rigidbody>();

        //controllerNumber = 1;
	}
	
	// Update is called once per frame
	void Update () {
		//keyboard is automatically applied to player one
		if (controllerNumber != 1) {
			
			//position of the movement thumbstick
			moveX = Input.GetAxis ("Horizontal_" + controllerNumber);
			moveY = Input.GetAxis ("Vertical_" + controllerNumber);

		//Convert Keyboard into controller axis
		} else {
			if(Input.GetKey("up")){
				moveY = Mathf.Min(1,moveY+.1f);
			}
			if(Input.GetKey("down")){
				moveY = Mathf.Max(-1,moveY-.1f);
			}
			if(Input.GetKey("left")){
				moveX = Mathf.Max(-1,moveX-.1f);
			}
			if(Input.GetKey("right")){
				moveX = Mathf.Min(1,moveX+.1f);
			}
			if(!Input.GetKey("up") && !Input.GetKey("down")){
				moveY = 0;
			}
			if(!Input.GetKey("left") && !Input.GetKey("right")){
				moveX = 0;
			}
		}
        if(moveX != 0 || moveY != 0) //only does movement code if you are moving

        {
            Vector3 axisVector = new Vector3(
                                               moveX,
                                               0,
                                               moveY);

            //moving character
            _rigidbody.velocity = new Vector3(axisVector.x * maxSpeed, _rigidbody.velocity.y, axisVector.z * maxSpeed);

            //rotating character
            Vector2 t = new Vector2(moveX, moveY);
            if (t.magnitude < 0.2f)
            {
                this.transform.rotation = rotation;
            }
            else
            {
                rotation = Quaternion.Euler(new Vector3(0, Mathf.Atan2(moveX, moveY) * Mathf.Rad2Deg, 0));
                this.transform.rotation = rotation;
            }

        }

       

		if (canJump && Input.GetButtonDown("Jump_" + controllerNumber) || canJump && (Input.GetKeyDown(KeyCode.Space) && controllerNumber == 1))
        {
            StartCoroutine(Jump());
        }

        if (Input.GetButtonDown("Submit_" + controllerNumber))
        {
            _rigidbody.velocity = new Vector3();
            _rigidbody.position = startingPosition;
        }


    }

    IEnumerator Jump()
    {
        canJump = false;
        jump();
        yield return new WaitForSeconds(jumpDelay);
        canJump = true;
    }

    private void jump()
    {
        _rigidbody.AddForce(new Vector3(0, jumpPower, 0), ForceMode.VelocityChange);
    }


}

{'fraction_non_alphanumeric': 0.11614776576867236, 'fraction_numerical': 0.016131634134537828, 'mean_word_length': 1.9707714422616196, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5606635', 'n_tokens_mistral': 2064, 'n_tokens_neox': 1842, 'n_words': 443}