mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 07:21:54 +08:00
66413bd75d
- Imported new sound effects: "Low Boing", "Low Whoosh", and "Pew" with corresponding import files. - Created a new character script for "Hen" with basic AI and attack functionality. - Implemented an effect controller script for managing particle effects with one-shot functionality.
18 lines
376 B
GDScript
18 lines
376 B
GDScript
extends Node2D
|
|
class_name EffectController
|
|
|
|
@export var oneShot: bool = true
|
|
|
|
@onready var particles: GPUParticles2D = $"%particles"
|
|
|
|
func _ready():
|
|
particles.emitting = false
|
|
particles.one_shot = oneShot
|
|
func shot():
|
|
var cloned = particles.duplicate() as GPUParticles2D
|
|
cloned.emitting = true
|
|
add_child(cloned)
|
|
if oneShot:
|
|
await cloned.finished
|
|
cloned.queue_free()
|