From ab449599fa31a06fd55939e957a953882afd97e2 Mon Sep 17 00:00:00 2001 From: Diego Date: Tue, 21 Jul 2020 13:39:41 -0500 Subject: [PATCH] Skeleton movement and jump height fixed --- ai/Skeleton Enemy.gd | 8 ++++---- levels/World.tscn | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ai/Skeleton Enemy.gd b/ai/Skeleton Enemy.gd index 62a24a0..c1d1328 100644 --- a/ai/Skeleton Enemy.gd +++ b/ai/Skeleton Enemy.gd @@ -10,7 +10,7 @@ func apply_gravity(delta, modifier = 1): func _physics_process(_delta): var dist = global_position.distance_to(Player.position) - + var gravity = 4350 if knockback != Vector2.ZERO: knockback = lerp(knockback, Vector2.ZERO, 0.5) move_and_slide(-knockback * knockback_amount) @@ -27,9 +27,9 @@ func _physics_process(_delta): apply_gravity(_delta) velocity.x *= speed velocity = move_and_slide(velocity, UP) - + if dist <= 400: - velocity.x = position.direction_to(Globals.player).normalized().x + velocity.x = position.direction_to(Player.position).normalized().x else: velocity = Vector2(0, 0) @@ -45,7 +45,7 @@ func _physics_process(_delta): # Jump if is_on_wall() and is_on_floor(): - velocity.y = -150 + velocity.y = -90 func throw_bone(direction): if ShootDelay.is_stopped(): diff --git a/levels/World.tscn b/levels/World.tscn index 460b450..8664662 100644 --- a/levels/World.tscn +++ b/levels/World.tscn @@ -460,5 +460,5 @@ texture = ExtResource( 12 ) [node name="Skeleton Enemy" parent="." instance=ExtResource( 11 )] position = Vector2( 149.132, 146.16 ) -[connection signal="body_entered" from="Area2D" to="Player" method="_on_Area2D_body_entered"] [connection signal="body_entered" from="Area2D" to="text/Text2" method="_on_body_entered"] +[connection signal="body_entered" from="Area2D" to="Player" method="_on_Area2D_body_entered"]