Updated projectile collision shapes

This commit is contained in:
2025-12-22 21:10:48 +03:00
parent 309112a1f2
commit b637474913
6 changed files with 5 additions and 28 deletions
@@ -18,23 +18,17 @@ var weapon : AbstractWeapon
var _velocity: Vector2
@onready var collision : CollisionShape2D = $CollisionShape2D
@onready var out_of_screen_timer : Timer = $OutOfScreenTimer
func _ready() -> void:
_velocity = direction.normalized() * speed + ship_velocity
_update_collision_rotation(_velocity)
func _physics_process(delta: float) -> void:
position += _velocity * delta
func _update_collision_rotation(velocity: Vector2) -> void:
collision.rotation = velocity.angle() - 0.5 * PI
func _on_screen_entered() -> void:
out_of_screen_timer.stop()