mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-30 07:51:54 +08:00
Add sound effects and character scripts
- 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.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user