Added follow angle for spread shots so projectiles point in the
direction they're going.
This commit is contained in:
parent
62e02d2555
commit
2db5f37975
3 changed files with 7 additions and 0 deletions
|
|
@ -27,6 +27,10 @@ func _process(delta):
|
|||
var velocity = Vector2.UP.rotated(deg_to_rad(angle)) * shot_data.speed
|
||||
position += velocity * delta
|
||||
|
||||
# Rotate sprite to face travel direction when conditions are met
|
||||
if shot_data.follow_angle and shot_data.projectiles > 2 and shot_data.spread_angle > 0:
|
||||
$AnimatedSprite2D.rotation = deg_to_rad(angle)
|
||||
|
||||
func activate():
|
||||
is_active = true
|
||||
visible = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue