feat(enemy): sistema d'events declaratius via YAML
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user