Added water splash
This commit is contained in:
@@ -14,6 +14,7 @@ var target_x := 0.0
|
||||
|
||||
|
||||
@onready var sprite : Sprite2D = $CultistSprite
|
||||
@onready var water_splash : GPUParticles2D = $WaterSplash
|
||||
@onready var animated_sprite : AnimatedSprite2D = $SubViewport/CultistSprite
|
||||
|
||||
@onready var left_wall_high_ray : RayCast2D = $WallCheckHigh/LeftWallRay
|
||||
@@ -48,6 +49,16 @@ func _physics_process(delta: float) -> void:
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func kill(type := KillingArea.Type.None) -> void:
|
||||
match type:
|
||||
KillingArea.Type.Water:
|
||||
SoundManager.play_sfx_stream(SoundManager.sfx_stream_splash, global_position)
|
||||
water_splash.finished.connect(queue_free)
|
||||
water_splash.restart()
|
||||
_:
|
||||
queue_free()
|
||||
|
||||
|
||||
func update_x_velocity(direction: int, max_speed: float, delta: float) -> void:
|
||||
velocity.x = move_toward(velocity.x, direction * max_speed, ACCELERATION * delta)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user