Reworked weapons and projectiles

This commit is contained in:
2025-12-20 18:35:27 +03:00
parent 2ecc53416a
commit 8227e8bcf3
312 changed files with 2466 additions and 1376 deletions
@@ -0,0 +1,19 @@
class_name AbstractLaserProjectile
extends AbstractDirectHitProjectile
@onready var particles : GPUParticles2D = $GPUParticles2D
func _ready() -> void:
super._ready()
_update_sprite(_velocity)
func _update_sprite(velocity: Vector2) -> void:
var angle := posmod(floor(rad_to_deg(velocity.angle())), 360)
if angle > 90 and angle < 270:
particles.process_material.direction = Vector3.RIGHT
else:
particles.process_material.direction = Vector3.LEFT