From 4a64f30c57c8ab3c77670e30d01103bdd04e8c5c Mon Sep 17 00:00:00 2001 From: Jonas Braus Date: Sat, 3 Aug 2024 01:26:19 +0200 Subject: [PATCH] coopa improvement --- scripts/enemies/coopa.gd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/enemies/coopa.gd b/scripts/enemies/coopa.gd index 72ecf12..d941ebf 100644 --- a/scripts/enemies/coopa.gd +++ b/scripts/enemies/coopa.gd @@ -16,7 +16,10 @@ var is_down = false @onready var ray_cast_right_3 = $RayCastRight3 func _ready(): - collision_shape_2d.shape.height = 24 + var coll = CapsuleShape2D.new() + coll.height = 24 + coll.radius = 7 + collision_shape_2d.shape = coll func _physics_process(delta): linear_velocity.x = speed @@ -80,8 +83,8 @@ func f_shrink(body): die_sound.play() if not is_down: speed = 0 - #collision_shape_2d.shape.height -= 9 - #die.position.y += 2 + collision_shape_2d.shape.height -= 9 + die.position.y += 2 animated_sprite_2d.play("shrink") is_down = true elif speed == 0: