diff --git a/scripts/player.gd b/scripts/player.gd index 858b4d5..8a0d763 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -87,7 +87,7 @@ func _on_weapon_cooldown_timeout() -> void: func shoot(): - var projectiles: int = 3 + var projectiles: int = 4 const PROJECTILE_SPACING: float = 10 const MUZZLE_HEIGHT: int = -23 for b in projectiles: @@ -95,7 +95,7 @@ func shoot(): # Instantiate the bullets var bullet = weapon_current.instantiate() get_tree().root.add_child(bullet) - bullet.position = position + Vector2((b * PROJECTILE_SPACING) - (projectiles * projectiles), MUZZLE_HEIGHT) + bullet.position = position + Vector2((b - (projectiles - 1) / 2.0) * PROJECTILE_SPACING, MUZZLE_HEIGHT) # Get weapon speed and spacing for equidistant calculations weapon_rate = bullet.shot_data.rate