feat(enemy): sistema d'events declaratius via YAML

This commit is contained in:
2026-05-25 13:34:48 +02:00
parent 9b3da3a6e7
commit 9c0502eefb
10 changed files with 299 additions and 71 deletions
+13
View File
@@ -53,3 +53,16 @@ colors:
wounded: [255, 220, 60] # Daurat (parpelleig al rebre impacte)
score: 100
events:
# Comportament clàssic: dos impactes per matar (set_hurt entra wounded;
# el segon hit detecta wounded i destrueix automàticament).
on_hit:
- action: apply_impulse
- action: set_hurt
on_hurt_end:
- action: destroy
on_destroy:
- action: add_score
- action: create_debris
- action: create_fireworks
+11
View File
@@ -53,3 +53,14 @@ colors:
wounded: [255, 220, 60]
score: 200
events:
on_hit:
- action: apply_impulse
- action: set_hurt
on_hurt_end:
- action: destroy
on_destroy:
- action: add_score
- action: create_debris
- action: create_fireworks
+11
View File
@@ -53,3 +53,14 @@ colors:
wounded: [255, 220, 60]
score: 150
events:
on_hit:
- action: apply_impulse
- action: set_hurt
on_hurt_end:
- action: destroy
on_destroy:
- action: add_score
- action: create_debris
- action: create_fireworks
+10
View File
@@ -53,3 +53,13 @@ colors:
wounded: [255, 220, 60]
score: 100
events:
# STAR: mor al primer impacte, sense passar per wounded.
on_hit:
- action: apply_impulse
- action: destroy
on_destroy:
- action: add_score
- action: create_debris
- action: create_fireworks