From 875567c3555a651c6365fde9b5c5ce633f4878f4 Mon Sep 17 00:00:00 2001 From: Torben Date: Mon, 10 Feb 2025 17:23:36 +0100 Subject: [PATCH] =?UTF-8?q?umhang=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character_body_2d.gd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/character_body_2d.gd b/character_body_2d.gd index e621c55..4eb6348 100644 --- a/character_body_2d.gd +++ b/character_body_2d.gd @@ -1,5 +1,6 @@ extends CharacterBody2D +var umhang = false var speed = 80000 var schwerkraft = 600 var sprung = 600 @@ -26,9 +27,16 @@ func grün_rot_weis(): liste.append("weis") +func _process(delta: float) -> void: + if umhang == true: + schwerkraft = 400 + else: + schwerkraft = 600 + func _physics_process(delta: float) -> void: velocity.x = 0 + for i in get_slide_collision_count(): var collision = get_slide_collision(i) if collision.get_collider().name.find("ziel") == 0: @@ -115,6 +123,7 @@ func _on_area_2d_area_entered(area: Area2D) -> void: if area.is_in_group("tötung"): velocity.y = -sprung + umhang = true if area.is_in_group ("ziel"): Globel.check_point_position =area.position @@ -134,6 +143,7 @@ func die(): Globel.dieconter +=1 $Timer.start() die_coldown = false + umhang = false func set_state(state : anim_states) -> void: