Skip to content

Commit

Permalink
Finally fix for the boss
Browse files Browse the repository at this point in the history
  • Loading branch information
Nartynka committed Oct 13, 2022
1 parent 18ff77e commit e13aaef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Enemies/BossEnemy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func chase_player(delta):
motion.x += ACCELERATION * delta * direction
motion.x = clamp(motion.x, -MAX_SPEED, MAX_SPEED)
global_position.x += motion.x * delta
rotation_degrees = lerp(rotation_degrees, (motion.x / MAX_SPEED), 0.3)
rotation_degrees = lerp(rotation_degrees, (motion.x / MAX_SPEED) * 5, 0.3)

if (rightWallCheck.is_colliding() or leftWallCheck.is_colliding()) and motion.x != 0:
motion.x *= -0.5
Expand Down
4 changes: 3 additions & 1 deletion Enemies/BossEnemy.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

[sub_resource type="Animation" id=1]
resource_name = "Fly"
length = 0.8
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite/LeftWingSprite:rotation_degrees")
Expand Down Expand Up @@ -672,6 +673,7 @@ length = 16.0

[node name="BossEnemy" instance=ExtResource( 1 )]
script = ExtResource( 8 )
MAX_SPEED = 50
ACCELERATION = 70

[node name="Sprite" parent="." index="0"]
Expand Down Expand Up @@ -841,7 +843,7 @@ position = Vector2( 0, -7 )
shape = SubResource( 3 )

[node name="EnemyStats" parent="." index="4"]
max_health = 100
max_health = 50

[node name="CollisionShape2D" parent="Hitbox" index="0"]
shape = SubResource( 4 )
Expand Down

0 comments on commit e13aaef

Please sign in to comment.