Adds lightning projectile

Implements a lightning projectile with visual effects.
The lightning is created using a series of bolt components that dynamically adjust their shape.
Also refactors the projectile system to use a base class.

Removes unused modifiers from player script.
This commit is contained in:
Dan Baker 2025-05-05 16:42:51 +01:00
parent ff62d67f54
commit d0c2a7b3c8
12 changed files with 239 additions and 103 deletions

View file

@ -26,13 +26,13 @@ func _ready():
combat.animated_sprite = animated_sprite
Log.pr("Adding projectile size additive modifier")
weapon.add_modifier(ProjectileSizeAdditive.new())
#weapon.add_modifier(ProjectileSizeAdditive.new())
Log.pr(weapon.stats.get_stat("projectile_size")) # Size is now 1.0 + 0.5 = 1.5
# Size is now 1.0 + 0.5 = 1.5
# Add the multiplicative size modifier (1.5x multiplier)
Log.pr("Adding projectile size multiplicative modifier")
weapon.add_modifier(ProjectileSizeMultiplicative.new())
#weapon.add_modifier(ProjectileSizeMultiplicative.new())
Log.pr(weapon.stats.get_stat("projectile_size"))
# Size is now 1.5 * 1.5 = 2.25
@ -40,10 +40,10 @@ func _ready():
Log.pr("Adding another projectile size additive modifier", 2)
var another_size_mod = ProjectileSizeAdditive.new()
another_size_mod.size_increase = 0.7
weapon.add_modifier(another_size_mod)
#weapon.add_modifier(another_size_mod)
Log.pr(weapon.stats.get_stat("projectile_size"))
weapon.add_modifier(FireRateAdditive.new())
#weapon.add_modifier(FireRateAdditive.new())
func _physics_process(delta):

View file

@ -19,7 +19,7 @@ func process(_delta):
var normalized_direction = direction.normalized()
if Input.is_action_pressed("fire"):
player.weapon.fire(normalized_direction)
player.weapon.fire(normalized_direction, mouse_position)
# Update animation
#update_animation()