<commit_before>﻿
// <NAME> | @matnesis | <EMAIL>
// 2015/07/15 10:33:29 PM

using UnityEngine;
using System.Collections;
using DG.Tweening;


[RequireComponent(typeof(Motion))]
public class Dash : MonoBehaviour
{
	public float dashPower = 3;
	public Motion motion;
	public Rigidbody2D rigid;


	void Start()
	{
		motion = GetComponent<Motion>();
		rigid = GetComponent<Rigidbody2D>();
	}


	void Update()
	{
		// Dash
		if (Input.GetKeyDown(KeyCode.Space))
		{
			// Positions
			Vector3 mousepos = MouseUtil.GetMousePosition();
			Vector3 playerpos = transform.position;

			// Ignore z
			mousepos.z = 0;
			playerpos.z = 0;

			// Direction
			Vector2 dashDir = (mousepos - playerpos).normalized;

			// Dash
			motion.jumpForce = dashDir * dashPower;
			motion.Jump();

			transform.DORotate(new Vector3(0, 0, 360), 1);

			this.tt("DashDown").ttReset().ttAdd(0.10f, (ttHandler t) =>
			{
				motion.ResetJump();
			})
			.ttAdd(0.30f, () =>
			{

				motion.Reset();
			});
		}
	}
}
<commit_msg>More compact dash slow down<commit_after>﻿
// <NAME> | @matnesis | <EMAIL>
// 2015/07/15 10:33:29 PM

using UnityEngine;
using System.Collections;
using DG.Tweening;


[RequireComponent(typeof(Motion))]
public class Dash : MonoBehaviour
{
	public float dashPower = 3;
	public Motion motion;
	public Rigidbody2D rigid;


	void Start()
	{
		motion = GetComponent<Motion>();
		rigid = GetComponent<Rigidbody2D>();
	}


	void Update()
	{
		// Dash
		if (Input.GetKeyDown(KeyCode.Space))
		{
			// Positions
			Vector3 mousepos = MouseUtil.GetMousePosition();
			Vector3 playerpos = transform.position;

			// Ignore z
			mousepos.z = 0;
			playerpos.z = 0;

			// Direction
			Vector2 dashDir = (mousepos - playerpos).normalized;

			// Dash
			motion.jumpForce = dashDir * dashPower;
			motion.Jump();

			transform.DORotate(new Vector3(0, 0, 360), 1);

			// Tween down
			this.tt("DashSlowDown").ttReset().ttAdd(0.1f).ttLoop(0.2f, (ttHandler t) =>
			{
				motion.currentJump = Vector2.Lerp(motion.currentJump, Vector2.zero, t.deltaTime);
			});
		}
	}
}

{'fraction_non_alphanumeric': 0.1460564751703992, 'fraction_numerical': 0.034079844206426485, 'mean_word_length': 3.2458677685950414, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '4075898', 'n_tokens_mistral': 923, 'n_tokens_neox': 744, 'n_words': 153}