deleted old code

This commit is contained in:
go38coz
2026-06-06 16:09:49 +02:00
parent 7110fba09f
commit 674d5bf28b
+1 -52
View File
@@ -10,7 +10,6 @@ public class DropletMovement : MonoBehaviour
private bool isGrounded = true; private bool isGrounded = true;
private float facingDirection = 1f; private float facingDirection = 1f;
private bool isDropping = false; private bool isDropping = false;
// private float fallAngleThreshold = -45f;
private float fallTimer; private float fallTimer;
private bool isFalling; private bool isFalling;
public float maxFallTime = 0.5f; public float maxFallTime = 0.5f;
@@ -39,28 +38,6 @@ public class DropletMovement : MonoBehaviour
void Update() void Update()
{ {
//reset falltimer when start the jump
// if ((Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow)) && isGrounded)
// {
// fallTimer = 0f; //jump resets falltime
// }
//fall damage
// if (isGrounded && fallTimer > 0.6f)
// {
// Destroy(gameObject); //TODO
// }
//handle jump/midair variables
// if (isGrounded)
// {
// isFalling = false;
// }
// else
// {
// HandleMidairLogic();
// }
//dashing //dashing
if (isDashing) if (isDashing)
{ {
@@ -116,11 +93,6 @@ public class DropletMovement : MonoBehaviour
private void OnTriggerEnter2D(Collider2D other) private void OnTriggerEnter2D(Collider2D other)
{ {
/*if (other.CompareTag("Border"))
{
Destroy(gameObject); //for now it destroys the droplet
Debug.Log("Droplet dropped down, animation, game end!");
}*/
//Hole //Hole
if (other.CompareTag("Hole")) if (other.CompareTag("Hole"))
@@ -131,29 +103,6 @@ public class DropletMovement : MonoBehaviour
} }
// [System.Obsolete]
// private void HandleMidairLogic()
// {
// if (rb.linearVelocity.y >= 0)
// {
// isFalling = false;
// fallTimer = 0f;
// return;
// }
//
// float movementAngle = Mathf.Atan2(rb.velocity.y, rb.velocity.x) * Mathf.Rad2Deg;
// //Degrees: 0 - right, 90 - up, -90 - down --> downwards is beteen -90 and -180
// //Standard treshhold (degree) = -45 --> between -45 and -135 degrees is falling (instead of jumping)
// bool fallingDown = (movementAngle < fallAngleThreshold && movementAngle > (-180f - fallAngleThreshold));
//
// if (fallingDown || rb.velocity.x == 0)
// {
// isFalling = true;
// fallTimer += Time.deltaTime;
// Debug.Log($"Fall time: {fallTimer:F2} seconds");
// }
// }
private IEnumerator Dash() private IEnumerator Dash()
{ {
canDash = false; canDash = false;
@@ -223,7 +172,7 @@ public class DropletMovement : MonoBehaviour
//move down the height of the collider //move down the height of the collider
float dropDistance = playerCollider.bounds.size.y; float dropDistance = playerCollider.bounds.size.y;
float speed = dropDistance/duration; float speed = dropDistance / duration;
while (elapsed < duration) while (elapsed < duration)
{ {