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

public class PlayerMovement : MonoBehaviour
{

    public GameObject player;
    public float speed;
    public int collisionCount;

	// Use this for initialization
	void Start ()
	{
	    Screen.SetResolution(800, 600, false);
	}
	
	// Update is called once per frame
	void Update ()
	{
        MoveCharacter();
	}

    void MoveCharacter()
    {
        Vector2 currentPos = player.rigidbody2D.position;

        if (Input.GetKey(KeyCode.RightArrow))
        {
            player.rigidbody2D.MovePosition(new Vector2(currentPos.x + speed, currentPos.y));
        }

        else if (Input.GetKey(KeyCode.LeftArrow))
        {
            player.rigidbody2D.MovePosition(new Vector2(currentPos.x - speed, currentPos.y));
        }
    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "background")
        {
            /*player.rigidbody2D.velocity = new Vector2(0, 0);
            player.rigidbody2D.angularVelocity = 0;*/
        }

        else if (collision.gameObject.tag == "obstacle")
        {
            --collisionCount;
            Destroy(collision.gameObject);

            if (collisionCount == 0)<commit_msg>Removed unnecessary code<commit_after>﻿using UnityEngine;
using System.Collections;

public class PlayerMovement : MonoBehaviour
{

    public GameObject player;
    public float speed;
    public int collisionCount;

	// Use this for initialization
	void Start ()
	{
	    Screen.SetResolution(800, 600, false);
	}
	
	// Update is called once per frame
	void Update ()
	{
        MoveCharacter();
	}

    void MoveCharacter()
    {
        Vector2 currentPos = player.rigidbody2D.position;

        if (Input.GetKey(KeyCode.RightArrow))
        {
            player.rigidbody2D.MovePosition(new Vector2(currentPos.x + speed, currentPos.y));
        }

        else if (Input.GetKey(KeyCode.LeftArrow))
        {
            player.rigidbody2D.MovePosition(new Vector2(currentPos.x - speed, currentPos.y));
        }
    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "obstacle")
        {
            --collisionCount;
            Destroy(collision.gameObject);

            if (collisionCount == 0)
{'fraction_non_alphanumeric': 0.09930615784908933, 'fraction_numerical': 0.015611448395490026, 'mean_word_length': 2.3386396526772795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5263819', 'n_tokens_mistral': 714, 'n_tokens_neox': 678, 'n_words': 141}