From e04fd16171318ace2fa009643ca5e18d57f3166a Mon Sep 17 00:00:00 2001 From: cemt1363 Date: Sat, 6 Jun 2026 02:09:36 +0200 Subject: [PATCH 1/2] added images folder --- Game/Assets/Images.meta | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Game/Assets/Images.meta diff --git a/Game/Assets/Images.meta b/Game/Assets/Images.meta new file mode 100644 index 0000000..b2888a3 --- /dev/null +++ b/Game/Assets/Images.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bc8547deda124e4418a491921dad1ff9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From e40669b234f73a4c10325c9f67bcb9d6109bfb4d Mon Sep 17 00:00:00 2001 From: orsolya-st Date: Sat, 6 Jun 2026 02:10:19 +0200 Subject: [PATCH 2/2] dropwdown --- Game/Assets/Scripts/DropletMovement.cs | 50 +++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/Game/Assets/Scripts/DropletMovement.cs b/Game/Assets/Scripts/DropletMovement.cs index 53bc6f9..cd8b0b6 100644 --- a/Game/Assets/Scripts/DropletMovement.cs +++ b/Game/Assets/Scripts/DropletMovement.cs @@ -30,16 +30,15 @@ public class DropletMovement : MonoBehaviour void Update() { + + //dashing if (isDashing) { return; } - movement.x = Input.GetAxisRaw("Horizontal"); - if (movement.x < 0) facingDirection = -1; if (movement.x > 0) facingDirection = 1; - if (isGrounded && (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.UpArrow) || @@ -47,11 +46,18 @@ public class DropletMovement : MonoBehaviour { rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpingPower); } - if (Input.GetKeyDown(KeyCode.LeftShift) && canDash) { StartCoroutine(Dash()); } + + //dropdown + if (!isGrounded){return;} + if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.S)) + { + DropDown(); + } + } private void FixedUpdate() @@ -103,4 +109,40 @@ public class DropletMovement : MonoBehaviour { isGrounded = false; } + + private void DropDown() + { + //when "s" or "down key" is pressed turn of/disable collider; + //move object slowly down (1 seconds, move down the height of the collision box) + //after that enable collider again + + if (isGrounded && (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))) + { + StartCoroutine(DropRoutine()); + } + } + + private IEnumerator DropRoutine() + { + Collider2D playerCollider = GetComponent(); + + playerCollider.isTrigger = true; + + float duration = 1f; + float elapsed = 0f; //measure time + + //move down the height of the collider + float dropDistance = playerCollider.bounds.size.y; + float speed = dropDistance/duration; + + while (elapsed < duration) + { + transform.Translate(Vector3.down * speed * Time.deltaTime); + elapsed += Time.deltaTime; //update time + yield return null; + } + + //enable collider --> not a trigger anymore + playerCollider.isTrigger = false; + } } \ No newline at end of file