refactor(entities): unifica loader d'animacio via AnimationComponent::fromYaml i elimina fps:
This commit is contained in:
1 parent
a779533d61
commit
b76a3eb1f3
21 files changed
+306
-231
No files matched your search
@@ -19,4 +19,4 @@ flags:
|
||||
collides: true
|
||||
interactable: false
|
||||
animations:
|
||||
default: { frames: [0], fps: 1, loop: false }
|
||||
default: { frames: [0], frame_ms: 1000, loop: false }
|
||||
@@ -21,9 +21,9 @@ flags:
|
||||
collides: true
|
||||
interactable: true
|
||||
animations:
|
||||
closed: { frames: [1], fps: 1, loop: true }
|
||||
opening: { frames: [0], fps: 6, loop: false }
|
||||
open: { frames: [0], fps: 1, loop: true }
|
||||
closed: { frames: [1], frame_ms: 1000, loop: true }
|
||||
opening: { frames: [0], frame_ms: 167, loop: false }
|
||||
open: { frames: [0], frame_ms: 1000, loop: true }
|
||||
behaviour:
|
||||
states: [CLOSED, OPENING, OPEN]
|
||||
initial_state: CLOSED
|
||||
|
||||
@@ -16,7 +16,7 @@ flags:
|
||||
# apropiada via `setVariant` abans del primer tick.
|
||||
# jump: frames 0..6 (7 frames) → reproduït al despegue.
|
||||
# land: frames 7..12 (6 frames) → reproduït a l'aterratge.
|
||||
# fps: 10 = 100 ms per frame.
|
||||
# frame_ms: 67 ≈ 15 fps (1000 / 67 ≈ 14.9 fps).
|
||||
animations:
|
||||
jump: { frames: [0, 1, 2, 3, 4, 5, 6], fps: 15, loop: false }
|
||||
land: { frames: [7, 8, 9, 10, 11, 12], fps: 15, loop: false }
|
||||
jump: { frames: [0, 1, 2, 3, 4, 5, 6], frame_ms: 67, loop: false }
|
||||
land: { frames: [7, 8, 9, 10, 11, 12], frame_ms: 67, loop: false }
|
||||
@@ -13,8 +13,8 @@ flags:
|
||||
collides: false
|
||||
interactable: false
|
||||
animations:
|
||||
inactive: { frames: [0], fps: 1, loop: true }
|
||||
active: { frames: [0], fps: 6, loop: true }
|
||||
inactive: { frames: [0], frame_ms: 1000, loop: true }
|
||||
active: { frames: [0], frame_ms: 167, loop: true }
|
||||
cycle:
|
||||
active_duration: 0.3
|
||||
inactive_duration: 2.0
|
||||
|
||||
@@ -22,6 +22,6 @@ flags:
|
||||
# lectura genèrica de flags.
|
||||
triggers_on_overlap: true
|
||||
animations:
|
||||
idle: { frames: [0], fps: 1, loop: true }
|
||||
idle: { frames: [0], frame_ms: 1000, loop: true }
|
||||
stats:
|
||||
damage: 0
|
||||
@@ -32,11 +32,18 @@ flags:
|
||||
# no decideix flip per direcció (només selecciona quina animació mostrar).
|
||||
# La momia no té variants `stand_*` perquè mai no para.
|
||||
animations:
|
||||
walk_south: { frames: [0, 1, 2, 3], fps: 8, loop: true }
|
||||
walk_north: { frames: [4, 5, 6, 7], fps: 8, loop: true }
|
||||
walk_east: { frames: [8, 9, 10, 11], fps: 8, loop: true }
|
||||
walk_west: { frames: [8, 9, 10, 11], fps: 8, loop: true, flip_h: true }
|
||||
raise: { frames: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27], fps: 8 , loop: false }
|
||||
walk_south: { frames: [0, 1, 2, 3], frame_ms: 125, loop: true }
|
||||
walk_north: { frames: [4, 5, 6, 7], frame_ms: 125, loop: true }
|
||||
walk_east: { frames: [8, 9, 10, 11], frame_ms: 125, loop: true }
|
||||
walk_west: { frames: [8, 9, 10, 11], frame_ms: 125, loop: true, flip_h: true }
|
||||
# Alçament: els 15 primers frames passen ràpid (125 ms cadascun) i el
|
||||
# darrer aguanta 1 s perquè el jugador pugui veure la mòmia ja alçada
|
||||
# abans que comenci a deambular. `frame_ms` accepta una llista per-frame
|
||||
# que mapeja 1:1 contra `frames`.
|
||||
raise:
|
||||
frames: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]
|
||||
frame_ms: [125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 1000]
|
||||
loop: false
|
||||
ai:
|
||||
type: corridor_wanderer
|
||||
direction_choice: random
|
||||
|
||||
@@ -13,7 +13,7 @@ flags:
|
||||
collides: true
|
||||
interactable: false
|
||||
animations:
|
||||
roll: { frames: [0], fps: 10, loop: true }
|
||||
roll: { frames: [0], frame_ms: 100, loop: true }
|
||||
ai:
|
||||
type: straight_line
|
||||
initial_direction: right
|
||||
|
||||
@@ -19,9 +19,9 @@ flags:
|
||||
collides: true
|
||||
interactable: true
|
||||
animations:
|
||||
closed: { frames: [0], fps: 1, loop: true }
|
||||
opening: { frames: [1, 2], fps: 6, loop: false }
|
||||
open: { frames: [3], fps: 1, loop: true }
|
||||
closed: { frames: [0], frame_ms: 1000, loop: true }
|
||||
opening: { frames: [1, 2], frame_ms: 167, loop: false }
|
||||
open: { frames: [3], frame_ms: 1000, loop: true }
|
||||
behaviour:
|
||||
states: [CLOSED, OPENING, OPEN]
|
||||
initial_state: CLOSED
|
||||
|
||||
@@ -19,4 +19,4 @@ flags:
|
||||
# Animació "default" amb un sol frame: el spawn YAML pot sobreescriure-la
|
||||
# via `frame: N` per fixar la variant escollida al editor.
|
||||
animations:
|
||||
default: { frames: [0], fps: 1, loop: false }
|
||||
default: { frames: [0], frame_ms: 1000, loop: false }
|
||||
@@ -15,7 +15,7 @@ flags:
|
||||
# El torch.gif és un strip vertical 16x64 amb 4 frames apilats.
|
||||
# El render clipa cada frame per `anim.currentFrame()` × 16 píxels en Y.
|
||||
animations:
|
||||
idle: { frames: [0, 1, 2, 3], fps: 8, loop: true }
|
||||
idle: { frames: [0, 1, 2, 3], frame_ms: 125, loop: true }
|
||||
|
||||
# Cercle de llum centrat a l'antorxa. El radi és en píxels del canvas;
|
||||
# el gradient global (data/config/lighting.yaml) hi posa la forma (3
|
||||
|
||||
@@ -13,8 +13,8 @@ flags:
|
||||
collides: false
|
||||
interactable: false
|
||||
animations:
|
||||
inactive: { frames: [0], fps: 1, loop: true }
|
||||
active: { frames: [0], fps: 6, loop: true }
|
||||
inactive: { frames: [0], frame_ms: 1000, loop: true }
|
||||
active: { frames: [0], frame_ms: 167, loop: true }
|
||||
cycle:
|
||||
active_duration: 0.5
|
||||
inactive_duration: 1.5
|
||||
|
||||
Reference in new issue
Block a user