From 10911990dda9fcd656c4eeb9bfb876901d8829e2 Mon Sep 17 00:00:00 2001 From: Sergio Date: Mon, 17 Nov 2025 12:47:07 +0100 Subject: [PATCH] migrant .ani a .yaml --- .claude/settings.local.json | 3 +- config/assets.txt | 122 ++++++------- convert_ani_to_yaml.py | 164 ++++++++++++++++++ data/credits/shine.yaml | 10 ++ data/enemies/abad.yaml | 10 ++ data/enemies/abad_bell.yaml | 10 ++ data/enemies/amstrad_cs.yaml | 10 ++ data/enemies/arounders_door.yaml | 10 ++ data/enemies/arounders_machine.yaml | 10 ++ data/enemies/bat.yaml | 10 ++ data/enemies/batman.yaml | 10 ++ data/enemies/batman_bell.yaml | 10 ++ data/enemies/batman_fire.yaml | 10 ++ data/enemies/bell.yaml | 10 ++ data/enemies/bin.yaml | 10 ++ data/enemies/bird.yaml | 10 ++ data/enemies/breakout.yaml | 10 ++ data/enemies/bry.yaml | 10 ++ data/enemies/chip.yaml | 10 ++ data/enemies/code.yaml | 10 ++ data/enemies/congo.yaml | 10 ++ data/enemies/crosshair.yaml | 10 ++ data/enemies/demon.yaml | 10 ++ data/enemies/dimallas.yaml | 10 ++ data/enemies/dong.yaml | 10 ++ data/enemies/elsa.yaml | 10 ++ data/enemies/floppy.yaml | 10 ++ data/enemies/flying_arounder.yaml | 10 ++ data/enemies/guitar.yaml | 10 ++ data/enemies/heavy.yaml | 10 ++ data/enemies/jailbattle_alien.yaml | 10 ++ data/enemies/jailbattle_human.yaml | 10 ++ data/enemies/jailer_#1.yaml | 10 ++ data/enemies/jailer_#2.yaml | 10 ++ data/enemies/jailer_#3.yaml | 10 ++ data/enemies/jeannine.yaml | 10 ++ data/enemies/lamp.yaml | 10 ++ data/enemies/lord_abad.yaml | 10 ++ data/enemies/matatunos.yaml | 10 ++ data/enemies/mummy.yaml | 10 ++ data/enemies/paco.yaml | 10 ++ data/enemies/qvoid.yaml | 10 ++ data/enemies/robot.yaml | 10 ++ data/enemies/sam.yaml | 10 ++ data/enemies/shock.yaml | 10 ++ data/enemies/sigmasua.yaml | 10 ++ data/enemies/spark.yaml | 10 ++ data/enemies/special/aerojailer.yaml | 10 ++ data/enemies/special/arounder.yaml | 10 ++ data/enemies/special/pepe_rosita_job.yaml | 10 ++ data/enemies/special/shooting_star.yaml | 10 ++ data/enemies/spider.yaml | 10 ++ data/enemies/stopped_arounder.yaml | 10 ++ data/enemies/tree_thing.yaml | 10 ++ data/enemies/tuno.yaml | 10 ++ data/enemies/tv.yaml | 10 ++ data/enemies/tv_panel.yaml | 10 ++ data/enemies/upv_student.yaml | 10 ++ data/enemies/walking_arounder.yaml | 10 ++ data/enemies/wave.yaml | 10 ++ data/enemies/z80.yaml | 10 ++ data/player/player.yaml | 20 +++ data/player/player2.yaml | 20 +++ data/player/player_game_over.yaml | 10 ++ .../rendering/surface_animated_sprite.cpp | 146 +++++++++++++++- .../rendering/surface_animated_sprite.hpp | 25 +-- 66 files changed, 1012 insertions(+), 78 deletions(-) create mode 100644 convert_ani_to_yaml.py create mode 100644 data/credits/shine.yaml create mode 100644 data/enemies/abad.yaml create mode 100644 data/enemies/abad_bell.yaml create mode 100644 data/enemies/amstrad_cs.yaml create mode 100644 data/enemies/arounders_door.yaml create mode 100644 data/enemies/arounders_machine.yaml create mode 100644 data/enemies/bat.yaml create mode 100644 data/enemies/batman.yaml create mode 100644 data/enemies/batman_bell.yaml create mode 100644 data/enemies/batman_fire.yaml create mode 100644 data/enemies/bell.yaml create mode 100644 data/enemies/bin.yaml create mode 100644 data/enemies/bird.yaml create mode 100644 data/enemies/breakout.yaml create mode 100644 data/enemies/bry.yaml create mode 100644 data/enemies/chip.yaml create mode 100644 data/enemies/code.yaml create mode 100644 data/enemies/congo.yaml create mode 100644 data/enemies/crosshair.yaml create mode 100644 data/enemies/demon.yaml create mode 100644 data/enemies/dimallas.yaml create mode 100644 data/enemies/dong.yaml create mode 100644 data/enemies/elsa.yaml create mode 100644 data/enemies/floppy.yaml create mode 100644 data/enemies/flying_arounder.yaml create mode 100644 data/enemies/guitar.yaml create mode 100644 data/enemies/heavy.yaml create mode 100644 data/enemies/jailbattle_alien.yaml create mode 100644 data/enemies/jailbattle_human.yaml create mode 100644 data/enemies/jailer_#1.yaml create mode 100644 data/enemies/jailer_#2.yaml create mode 100644 data/enemies/jailer_#3.yaml create mode 100644 data/enemies/jeannine.yaml create mode 100644 data/enemies/lamp.yaml create mode 100644 data/enemies/lord_abad.yaml create mode 100644 data/enemies/matatunos.yaml create mode 100644 data/enemies/mummy.yaml create mode 100644 data/enemies/paco.yaml create mode 100644 data/enemies/qvoid.yaml create mode 100644 data/enemies/robot.yaml create mode 100644 data/enemies/sam.yaml create mode 100644 data/enemies/shock.yaml create mode 100644 data/enemies/sigmasua.yaml create mode 100644 data/enemies/spark.yaml create mode 100644 data/enemies/special/aerojailer.yaml create mode 100644 data/enemies/special/arounder.yaml create mode 100644 data/enemies/special/pepe_rosita_job.yaml create mode 100644 data/enemies/special/shooting_star.yaml create mode 100644 data/enemies/spider.yaml create mode 100644 data/enemies/stopped_arounder.yaml create mode 100644 data/enemies/tree_thing.yaml create mode 100644 data/enemies/tuno.yaml create mode 100644 data/enemies/tv.yaml create mode 100644 data/enemies/tv_panel.yaml create mode 100644 data/enemies/upv_student.yaml create mode 100644 data/enemies/walking_arounder.yaml create mode 100644 data/enemies/wave.yaml create mode 100644 data/enemies/z80.yaml create mode 100644 data/player/player.yaml create mode 100644 data/player/player2.yaml create mode 100644 data/player/player_game_over.yaml diff --git a/.claude/settings.local.json b/.claude/settings.local.json index cc929c3..d637cda 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -21,7 +21,8 @@ "WebFetch(domain:github.com)", "WebFetch(domain:raw.githubusercontent.com)", "Bash(curl:*)", - "WebFetch(domain:fktn-k.github.io)" + "WebFetch(domain:fktn-k.github.io)", + "Bash(./jaildoctors_dilemma)" ], "deny": [], "ask": [] diff --git a/config/assets.txt b/config/assets.txt index 43ef8ec..0b520fc 100644 --- a/config/assets.txt +++ b/config/assets.txt @@ -128,130 +128,130 @@ BITMAP|${PREFIX}/data/tilesets/standard.gif # =================================================================== # ENEMIES # =================================================================== -ANIMATION|${PREFIX}/data/enemies/abad_bell.ani +ANIMATION|${PREFIX}/data/enemies/abad_bell.yaml BITMAP|${PREFIX}/data/enemies/abad_bell.gif -ANIMATION|${PREFIX}/data/enemies/abad.ani +ANIMATION|${PREFIX}/data/enemies/abad.yaml BITMAP|${PREFIX}/data/enemies/abad.gif -ANIMATION|${PREFIX}/data/enemies/amstrad_cs.ani +ANIMATION|${PREFIX}/data/enemies/amstrad_cs.yaml BITMAP|${PREFIX}/data/enemies/amstrad_cs.gif -ANIMATION|${PREFIX}/data/enemies/flying_arounder.ani +ANIMATION|${PREFIX}/data/enemies/flying_arounder.yaml BITMAP|${PREFIX}/data/enemies/flying_arounder.gif -ANIMATION|${PREFIX}/data/enemies/stopped_arounder.ani +ANIMATION|${PREFIX}/data/enemies/stopped_arounder.yaml BITMAP|${PREFIX}/data/enemies/stopped_arounder.gif -ANIMATION|${PREFIX}/data/enemies/walking_arounder.ani +ANIMATION|${PREFIX}/data/enemies/walking_arounder.yaml BITMAP|${PREFIX}/data/enemies/walking_arounder.gif -ANIMATION|${PREFIX}/data/enemies/arounders_door.ani +ANIMATION|${PREFIX}/data/enemies/arounders_door.yaml BITMAP|${PREFIX}/data/enemies/arounders_door.gif -ANIMATION|${PREFIX}/data/enemies/arounders_machine.ani +ANIMATION|${PREFIX}/data/enemies/arounders_machine.yaml BITMAP|${PREFIX}/data/enemies/arounders_machine.gif -ANIMATION|${PREFIX}/data/enemies/bat.ani +ANIMATION|${PREFIX}/data/enemies/bat.yaml BITMAP|${PREFIX}/data/enemies/bat.gif -ANIMATION|${PREFIX}/data/enemies/batman_bell.ani +ANIMATION|${PREFIX}/data/enemies/batman_bell.yaml BITMAP|${PREFIX}/data/enemies/batman_bell.gif -ANIMATION|${PREFIX}/data/enemies/batman_fire.ani +ANIMATION|${PREFIX}/data/enemies/batman_fire.yaml BITMAP|${PREFIX}/data/enemies/batman_fire.gif -ANIMATION|${PREFIX}/data/enemies/batman.ani +ANIMATION|${PREFIX}/data/enemies/batman.yaml BITMAP|${PREFIX}/data/enemies/batman.gif -ANIMATION|${PREFIX}/data/enemies/bell.ani +ANIMATION|${PREFIX}/data/enemies/bell.yaml BITMAP|${PREFIX}/data/enemies/bell.gif -ANIMATION|${PREFIX}/data/enemies/bin.ani +ANIMATION|${PREFIX}/data/enemies/bin.yaml BITMAP|${PREFIX}/data/enemies/bin.gif -ANIMATION|${PREFIX}/data/enemies/bird.ani +ANIMATION|${PREFIX}/data/enemies/bird.yaml BITMAP|${PREFIX}/data/enemies/bird.gif -ANIMATION|${PREFIX}/data/enemies/breakout.ani +ANIMATION|${PREFIX}/data/enemies/breakout.yaml BITMAP|${PREFIX}/data/enemies/breakout.gif -ANIMATION|${PREFIX}/data/enemies/bry.ani +ANIMATION|${PREFIX}/data/enemies/bry.yaml BITMAP|${PREFIX}/data/enemies/bry.gif -ANIMATION|${PREFIX}/data/enemies/chip.ani +ANIMATION|${PREFIX}/data/enemies/chip.yaml BITMAP|${PREFIX}/data/enemies/chip.gif -ANIMATION|${PREFIX}/data/enemies/code.ani +ANIMATION|${PREFIX}/data/enemies/code.yaml BITMAP|${PREFIX}/data/enemies/code.gif -ANIMATION|${PREFIX}/data/enemies/congo.ani +ANIMATION|${PREFIX}/data/enemies/congo.yaml BITMAP|${PREFIX}/data/enemies/congo.gif -ANIMATION|${PREFIX}/data/enemies/crosshair.ani +ANIMATION|${PREFIX}/data/enemies/crosshair.yaml BITMAP|${PREFIX}/data/enemies/crosshair.gif -ANIMATION|${PREFIX}/data/enemies/demon.ani +ANIMATION|${PREFIX}/data/enemies/demon.yaml BITMAP|${PREFIX}/data/enemies/demon.gif -ANIMATION|${PREFIX}/data/enemies/dimallas.ani +ANIMATION|${PREFIX}/data/enemies/dimallas.yaml BITMAP|${PREFIX}/data/enemies/dimallas.gif -ANIMATION|${PREFIX}/data/enemies/floppy.ani +ANIMATION|${PREFIX}/data/enemies/floppy.yaml BITMAP|${PREFIX}/data/enemies/floppy.gif -ANIMATION|${PREFIX}/data/enemies/dong.ani +ANIMATION|${PREFIX}/data/enemies/dong.yaml BITMAP|${PREFIX}/data/enemies/dong.gif -ANIMATION|${PREFIX}/data/enemies/guitar.ani +ANIMATION|${PREFIX}/data/enemies/guitar.yaml BITMAP|${PREFIX}/data/enemies/guitar.gif -ANIMATION|${PREFIX}/data/enemies/heavy.ani +ANIMATION|${PREFIX}/data/enemies/heavy.yaml BITMAP|${PREFIX}/data/enemies/heavy.gif -ANIMATION|${PREFIX}/data/enemies/jailer_#1.ani +ANIMATION|${PREFIX}/data/enemies/jailer_#1.yaml BITMAP|${PREFIX}/data/enemies/jailer_#1.gif -ANIMATION|${PREFIX}/data/enemies/jailer_#2.ani +ANIMATION|${PREFIX}/data/enemies/jailer_#2.yaml BITMAP|${PREFIX}/data/enemies/jailer_#2.gif -ANIMATION|${PREFIX}/data/enemies/jailer_#3.ani +ANIMATION|${PREFIX}/data/enemies/jailer_#3.yaml BITMAP|${PREFIX}/data/enemies/jailer_#3.gif -ANIMATION|${PREFIX}/data/enemies/jailbattle_alien.ani +ANIMATION|${PREFIX}/data/enemies/jailbattle_alien.yaml BITMAP|${PREFIX}/data/enemies/jailbattle_alien.gif -ANIMATION|${PREFIX}/data/enemies/jailbattle_human.ani +ANIMATION|${PREFIX}/data/enemies/jailbattle_human.yaml BITMAP|${PREFIX}/data/enemies/jailbattle_human.gif -ANIMATION|${PREFIX}/data/enemies/jeannine.ani +ANIMATION|${PREFIX}/data/enemies/jeannine.yaml BITMAP|${PREFIX}/data/enemies/jeannine.gif -ANIMATION|${PREFIX}/data/enemies/lamp.ani +ANIMATION|${PREFIX}/data/enemies/lamp.yaml BITMAP|${PREFIX}/data/enemies/lamp.gif -ANIMATION|${PREFIX}/data/enemies/lord_abad.ani +ANIMATION|${PREFIX}/data/enemies/lord_abad.yaml BITMAP|${PREFIX}/data/enemies/lord_abad.gif -ANIMATION|${PREFIX}/data/enemies/matatunos.ani +ANIMATION|${PREFIX}/data/enemies/matatunos.yaml BITMAP|${PREFIX}/data/enemies/matatunos.gif -ANIMATION|${PREFIX}/data/enemies/mummy.ani +ANIMATION|${PREFIX}/data/enemies/mummy.yaml BITMAP|${PREFIX}/data/enemies/mummy.gif -ANIMATION|${PREFIX}/data/enemies/paco.ani +ANIMATION|${PREFIX}/data/enemies/paco.yaml BITMAP|${PREFIX}/data/enemies/paco.gif -ANIMATION|${PREFIX}/data/enemies/elsa.ani +ANIMATION|${PREFIX}/data/enemies/elsa.yaml BITMAP|${PREFIX}/data/enemies/elsa.gif -ANIMATION|${PREFIX}/data/enemies/qvoid.ani +ANIMATION|${PREFIX}/data/enemies/qvoid.yaml BITMAP|${PREFIX}/data/enemies/qvoid.gif -ANIMATION|${PREFIX}/data/enemies/robot.ani +ANIMATION|${PREFIX}/data/enemies/robot.yaml BITMAP|${PREFIX}/data/enemies/robot.gif -ANIMATION|${PREFIX}/data/enemies/sam.ani +ANIMATION|${PREFIX}/data/enemies/sam.yaml BITMAP|${PREFIX}/data/enemies/sam.gif -ANIMATION|${PREFIX}/data/enemies/shock.ani +ANIMATION|${PREFIX}/data/enemies/shock.yaml BITMAP|${PREFIX}/data/enemies/shock.gif -ANIMATION|${PREFIX}/data/enemies/sigmasua.ani +ANIMATION|${PREFIX}/data/enemies/sigmasua.yaml BITMAP|${PREFIX}/data/enemies/sigmasua.gif -ANIMATION|${PREFIX}/data/enemies/spark.ani +ANIMATION|${PREFIX}/data/enemies/spark.yaml BITMAP|${PREFIX}/data/enemies/spark.gif -ANIMATION|${PREFIX}/data/enemies/special/aerojailer.ani +ANIMATION|${PREFIX}/data/enemies/special/aerojailer.yaml BITMAP|${PREFIX}/data/enemies/special/aerojailer.gif -ANIMATION|${PREFIX}/data/enemies/special/arounder.ani +ANIMATION|${PREFIX}/data/enemies/special/arounder.yaml BITMAP|${PREFIX}/data/enemies/special/arounder.gif -ANIMATION|${PREFIX}/data/enemies/special/pepe_rosita_job.ani +ANIMATION|${PREFIX}/data/enemies/special/pepe_rosita_job.yaml BITMAP|${PREFIX}/data/enemies/special/pepe_rosita_job.gif -ANIMATION|${PREFIX}/data/enemies/special/shooting_star.ani +ANIMATION|${PREFIX}/data/enemies/special/shooting_star.yaml BITMAP|${PREFIX}/data/enemies/special/shooting_star.gif -ANIMATION|${PREFIX}/data/enemies/spider.ani +ANIMATION|${PREFIX}/data/enemies/spider.yaml BITMAP|${PREFIX}/data/enemies/spider.gif -ANIMATION|${PREFIX}/data/enemies/tree_thing.ani +ANIMATION|${PREFIX}/data/enemies/tree_thing.yaml BITMAP|${PREFIX}/data/enemies/tree_thing.gif -ANIMATION|${PREFIX}/data/enemies/tuno.ani +ANIMATION|${PREFIX}/data/enemies/tuno.yaml BITMAP|${PREFIX}/data/enemies/tuno.gif -ANIMATION|${PREFIX}/data/enemies/tv_panel.ani +ANIMATION|${PREFIX}/data/enemies/tv_panel.yaml BITMAP|${PREFIX}/data/enemies/tv_panel.gif -ANIMATION|${PREFIX}/data/enemies/tv.ani +ANIMATION|${PREFIX}/data/enemies/tv.yaml BITMAP|${PREFIX}/data/enemies/tv.gif -ANIMATION|${PREFIX}/data/enemies/upv_student.ani +ANIMATION|${PREFIX}/data/enemies/upv_student.yaml BITMAP|${PREFIX}/data/enemies/upv_student.gif -ANIMATION|${PREFIX}/data/enemies/wave.ani +ANIMATION|${PREFIX}/data/enemies/wave.yaml BITMAP|${PREFIX}/data/enemies/wave.gif -ANIMATION|${PREFIX}/data/enemies/z80.ani +ANIMATION|${PREFIX}/data/enemies/z80.yaml BITMAP|${PREFIX}/data/enemies/z80.gif # =================================================================== # PLAYER # =================================================================== BITMAP|${PREFIX}/data/player/player.gif -ANIMATION|${PREFIX}/data/player/player.ani +ANIMATION|${PREFIX}/data/player/player.yaml BITMAP|${PREFIX}/data/player/player2.gif -ANIMATION|${PREFIX}/data/player/player2.ani +ANIMATION|${PREFIX}/data/player/player2.yaml BITMAP|${PREFIX}/data/player/player_game_over.gif -ANIMATION|${PREFIX}/data/player/player_game_over.ani +ANIMATION|${PREFIX}/data/player/player_game_over.yaml # =================================================================== # ITEMS @@ -336,4 +336,4 @@ BITMAP|${PREFIX}/data/ending/ending5.gif # CREDITS # =================================================================== BITMAP|${PREFIX}/data/credits/shine.gif -ANIMATION|${PREFIX}/data/credits/shine.ani +ANIMATION|${PREFIX}/data/credits/shine.yaml diff --git a/convert_ani_to_yaml.py b/convert_ani_to_yaml.py new file mode 100644 index 0000000..8475926 --- /dev/null +++ b/convert_ani_to_yaml.py @@ -0,0 +1,164 @@ +#!/usr/bin/env python3 +""" +Script para convertir archivos .ani a formato YAML con nomenclatura camelCase +""" + +import os +import glob +import re + + +def parse_ani_file(file_path): + """ + Parsea un archivo .ani y retorna un diccionario con los datos + """ + data = { + 'tileSetFile': None, + 'frameWidth': None, + 'frameHeight': None, + 'animations': [] + } + + current_animation = None + + with open(file_path, 'r', encoding='utf-8') as f: + for line in f: + line = line.strip() + + # Ignorar líneas vacías + if not line: + continue + + # Detectar inicio de animación + if line == '[animation]': + current_animation = {} + continue + + # Detectar fin de animación + if line == '[/animation]': + if current_animation: + data['animations'].append(current_animation) + current_animation = None + continue + + # Parsear parámetros + if '=' in line: + key, value = line.split('=', 1) + key = key.strip() + value = value.strip() + + # Parámetros globales + if key == 'tileSetFile': + data['tileSetFile'] = value + elif key == 'frame_width': + data['frameWidth'] = int(value) + elif key == 'frame_height': + data['frameHeight'] = int(value) + # Parámetros de animación + elif current_animation is not None: + if key == 'name': + current_animation['name'] = value + elif key == 'speed': + current_animation['speed'] = float(value) + elif key == 'loop': + current_animation['loop'] = int(value) + elif key == 'frames': + # Convertir "0,1,2,3" a [0, 1, 2, 3] + current_animation['frames'] = [int(x.strip()) for x in value.split(',')] + + return data + + +def generate_yaml(data, comment_header=""): + """ + Genera el contenido YAML a partir de los datos parseados + """ + lines = [] + + # Añadir comentario de header si existe + if comment_header: + lines.append(f"# {comment_header}") + + # Parámetros globales + if data['tileSetFile']: + lines.append(f"tileSetFile: {data['tileSetFile']}") + if data['frameWidth'] is not None: + lines.append(f"frameWidth: {data['frameWidth']}") + if data['frameHeight'] is not None: + lines.append(f"frameHeight: {data['frameHeight']}") + + # Animaciones + if data['animations']: + lines.append("") + lines.append("animations:") + + for anim in data['animations']: + lines.append(f" - name: {anim.get('name', 'default')}") + lines.append(f" speed: {anim.get('speed', 0.0)}") + lines.append(f" loop: {anim.get('loop', 0)}") + + # Frames en formato compacto [0, 1, 2, 3] + frames = anim.get('frames', []) + frames_str = '[' + ', '.join(str(f) for f in frames) + ']' + lines.append(f" frames: {frames_str}") + + # Línea vacía entre animaciones (excepto la última) + if anim != data['animations'][-1]: + lines.append("") + + return '\n'.join(lines) + '\n' + + +def convert_ani_to_yaml(ani_path): + """ + Convierte un archivo .ani a .yaml + """ + # Generar nombre del archivo de salida + yaml_path = ani_path.replace('.ani', '.yaml') + + # Parsear archivo .ani + data = parse_ani_file(ani_path) + + # Generar comentario de header basado en el nombre del archivo + filename = os.path.basename(ani_path) + comment = f"{filename.replace('.ani', '')} animation" + + # Generar contenido YAML + yaml_content = generate_yaml(data, comment) + + # Escribir archivo .yaml + with open(yaml_path, 'w', encoding='utf-8') as f: + f.write(yaml_content) + + print(f"✓ {ani_path} → {yaml_path}") + + return yaml_path + + +def main(): + """ + Función principal que convierte todos los archivos .ani a .yaml + """ + # Buscar todos los archivos .ani + ani_files = glob.glob('data/**/*.ani', recursive=True) + + if not ani_files: + print("No se encontraron archivos .ani") + return + + print(f"Encontrados {len(ani_files)} archivos .ani\n") + + # Convertir cada archivo + converted = 0 + for ani_file in sorted(ani_files): + try: + convert_ani_to_yaml(ani_file) + converted += 1 + except Exception as e: + print(f"✗ Error al convertir {ani_file}: {e}") + + print(f"\n{converted}/{len(ani_files)} archivos convertidos exitosamente") + + +if __name__ == '__main__': + main() diff --git a/data/credits/shine.yaml b/data/credits/shine.yaml new file mode 100644 index 0000000..c4b723f --- /dev/null +++ b/data/credits/shine.yaml @@ -0,0 +1,10 @@ +# shine animation +tileSetFile: shine.gif +frameWidth: 8 +frameHeight: 8 + +animations: + - name: default + speed: 0.1 + loop: -1 + frames: [0, 1, 2, 3, 4, 5, 6, 7] diff --git a/data/enemies/abad.yaml b/data/enemies/abad.yaml new file mode 100644 index 0000000..ffc9c35 --- /dev/null +++ b/data/enemies/abad.yaml @@ -0,0 +1,10 @@ +# abad animation +tileSetFile: abad.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2] diff --git a/data/enemies/abad_bell.yaml b/data/enemies/abad_bell.yaml new file mode 100644 index 0000000..d6c1772 --- /dev/null +++ b/data/enemies/abad_bell.yaml @@ -0,0 +1,10 @@ +# abad_bell animation +tileSetFile: abad_bell.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] diff --git a/data/enemies/amstrad_cs.yaml b/data/enemies/amstrad_cs.yaml new file mode 100644 index 0000000..5d1169d --- /dev/null +++ b/data/enemies/amstrad_cs.yaml @@ -0,0 +1,10 @@ +# amstrad_cs animation +tileSetFile: amstrad_cs.gif +frameWidth: 8 +frameHeight: 8 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255] diff --git a/data/enemies/arounders_door.yaml b/data/enemies/arounders_door.yaml new file mode 100644 index 0000000..b5a4daa --- /dev/null +++ b/data/enemies/arounders_door.yaml @@ -0,0 +1,10 @@ +# arounders_door animation +tileSetFile: arounders_door.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0] diff --git a/data/enemies/arounders_machine.yaml b/data/enemies/arounders_machine.yaml new file mode 100644 index 0000000..026b250 --- /dev/null +++ b/data/enemies/arounders_machine.yaml @@ -0,0 +1,10 @@ +# arounders_machine animation +tileSetFile: arounders_machine.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/bat.yaml b/data/enemies/bat.yaml new file mode 100644 index 0000000..582903c --- /dev/null +++ b/data/enemies/bat.yaml @@ -0,0 +1,10 @@ +# bat animation +tileSetFile: bat.gif +frameWidth: 9 +frameHeight: 7 + +animations: + - name: default + speed: 0.05 + loop: 0 + frames: [0, 1] diff --git a/data/enemies/batman.yaml b/data/enemies/batman.yaml new file mode 100644 index 0000000..4a44e20 --- /dev/null +++ b/data/enemies/batman.yaml @@ -0,0 +1,10 @@ +# batman animation +tileSetFile: batman.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/batman_bell.yaml b/data/enemies/batman_bell.yaml new file mode 100644 index 0000000..69c0ee5 --- /dev/null +++ b/data/enemies/batman_bell.yaml @@ -0,0 +1,10 @@ +# batman_bell animation +tileSetFile: batman_bell.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3, 4, 5] diff --git a/data/enemies/batman_fire.yaml b/data/enemies/batman_fire.yaml new file mode 100644 index 0000000..743a15b --- /dev/null +++ b/data/enemies/batman_fire.yaml @@ -0,0 +1,10 @@ +# batman_fire animation +tileSetFile: batman_fire.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/bell.yaml b/data/enemies/bell.yaml new file mode 100644 index 0000000..9377046 --- /dev/null +++ b/data/enemies/bell.yaml @@ -0,0 +1,10 @@ +# bell animation +tileSetFile: bell.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] diff --git a/data/enemies/bin.yaml b/data/enemies/bin.yaml new file mode 100644 index 0000000..f076775 --- /dev/null +++ b/data/enemies/bin.yaml @@ -0,0 +1,10 @@ +# bin animation +tileSetFile: bin.gif +frameWidth: 16 +frameHeight: 8 + +animations: + - name: default + speed: 0.1667 + loop: 0 + frames: [0, 1, 2, 3, 4] diff --git a/data/enemies/bird.yaml b/data/enemies/bird.yaml new file mode 100644 index 0000000..3866a72 --- /dev/null +++ b/data/enemies/bird.yaml @@ -0,0 +1,10 @@ +# bird animation +tileSetFile: bird.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/breakout.yaml b/data/enemies/breakout.yaml new file mode 100644 index 0000000..da7c272 --- /dev/null +++ b/data/enemies/breakout.yaml @@ -0,0 +1,10 @@ +# breakout animation +tileSetFile: breakout.gif +frameWidth: 24 +frameHeight: 32 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1] diff --git a/data/enemies/bry.yaml b/data/enemies/bry.yaml new file mode 100644 index 0000000..7f9ca59 --- /dev/null +++ b/data/enemies/bry.yaml @@ -0,0 +1,10 @@ +# bry animation +tileSetFile: bry.gif +frameWidth: 10 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5] diff --git a/data/enemies/chip.yaml b/data/enemies/chip.yaml new file mode 100644 index 0000000..fc0b78d --- /dev/null +++ b/data/enemies/chip.yaml @@ -0,0 +1,10 @@ +# chip animation +tileSetFile: chip.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/code.yaml b/data/enemies/code.yaml new file mode 100644 index 0000000..01f0817 --- /dev/null +++ b/data/enemies/code.yaml @@ -0,0 +1,10 @@ +# code animation +tileSetFile: code.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/congo.yaml b/data/enemies/congo.yaml new file mode 100644 index 0000000..4ab10fb --- /dev/null +++ b/data/enemies/congo.yaml @@ -0,0 +1,10 @@ +# congo animation +tileSetFile: congo.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/crosshair.yaml b/data/enemies/crosshair.yaml new file mode 100644 index 0000000..93d9bf9 --- /dev/null +++ b/data/enemies/crosshair.yaml @@ -0,0 +1,10 @@ +# crosshair animation +tileSetFile: crosshair.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/demon.yaml b/data/enemies/demon.yaml new file mode 100644 index 0000000..17055d1 --- /dev/null +++ b/data/enemies/demon.yaml @@ -0,0 +1,10 @@ +# demon animation +tileSetFile: demon.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/dimallas.yaml b/data/enemies/dimallas.yaml new file mode 100644 index 0000000..5999413 --- /dev/null +++ b/data/enemies/dimallas.yaml @@ -0,0 +1,10 @@ +# dimallas animation +tileSetFile: dimallas.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/dong.yaml b/data/enemies/dong.yaml new file mode 100644 index 0000000..0154254 --- /dev/null +++ b/data/enemies/dong.yaml @@ -0,0 +1,10 @@ +# dong animation +tileSetFile: dong.gif +frameWidth: 22 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3, 4, 5] diff --git a/data/enemies/elsa.yaml b/data/enemies/elsa.yaml new file mode 100644 index 0000000..c31099a --- /dev/null +++ b/data/enemies/elsa.yaml @@ -0,0 +1,10 @@ +# elsa animation +tileSetFile: elsa.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3, 4, 5] diff --git a/data/enemies/floppy.yaml b/data/enemies/floppy.yaml new file mode 100644 index 0000000..145861a --- /dev/null +++ b/data/enemies/floppy.yaml @@ -0,0 +1,10 @@ +# floppy animation +tileSetFile: floppy.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/flying_arounder.yaml b/data/enemies/flying_arounder.yaml new file mode 100644 index 0000000..0b3f2fe --- /dev/null +++ b/data/enemies/flying_arounder.yaml @@ -0,0 +1,10 @@ +# flying_arounder animation +tileSetFile: flying_arounder.gif +frameWidth: 7 +frameHeight: 7 + +animations: + - name: default + speed: 0.1667 + loop: 0 + frames: [0] diff --git a/data/enemies/guitar.yaml b/data/enemies/guitar.yaml new file mode 100644 index 0000000..4600ac3 --- /dev/null +++ b/data/enemies/guitar.yaml @@ -0,0 +1,10 @@ +# guitar animation +tileSetFile: guitar.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/heavy.yaml b/data/enemies/heavy.yaml new file mode 100644 index 0000000..50f0ced --- /dev/null +++ b/data/enemies/heavy.yaml @@ -0,0 +1,10 @@ +# heavy animation +tileSetFile: heavy.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/jailbattle_alien.yaml b/data/enemies/jailbattle_alien.yaml new file mode 100644 index 0000000..5d18f67 --- /dev/null +++ b/data/enemies/jailbattle_alien.yaml @@ -0,0 +1,10 @@ +# jailbattle_alien animation +tileSetFile: jailbattle_alien.gif +frameWidth: 13 +frameHeight: 15 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1] diff --git a/data/enemies/jailbattle_human.yaml b/data/enemies/jailbattle_human.yaml new file mode 100644 index 0000000..e2f5eda --- /dev/null +++ b/data/enemies/jailbattle_human.yaml @@ -0,0 +1,10 @@ +# jailbattle_human animation +tileSetFile: jailbattle_human.gif +frameWidth: 11 +frameHeight: 13 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1] diff --git a/data/enemies/jailer_#1.yaml b/data/enemies/jailer_#1.yaml new file mode 100644 index 0000000..1c6d092 --- /dev/null +++ b/data/enemies/jailer_#1.yaml @@ -0,0 +1,10 @@ +# jailer_#1 animation +tileSetFile: jailer_#1.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/jailer_#2.yaml b/data/enemies/jailer_#2.yaml new file mode 100644 index 0000000..27ddc6f --- /dev/null +++ b/data/enemies/jailer_#2.yaml @@ -0,0 +1,10 @@ +# jailer_#2 animation +tileSetFile: jailer_#2.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 1, 3, 5, 1, 3, 5, 1, 3, 5] diff --git a/data/enemies/jailer_#3.yaml b/data/enemies/jailer_#3.yaml new file mode 100644 index 0000000..d33944a --- /dev/null +++ b/data/enemies/jailer_#3.yaml @@ -0,0 +1,10 @@ +# jailer_#3 animation +tileSetFile: jailer_#3.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/jeannine.yaml b/data/enemies/jeannine.yaml new file mode 100644 index 0000000..50a51de --- /dev/null +++ b/data/enemies/jeannine.yaml @@ -0,0 +1,10 @@ +# jeannine animation +tileSetFile: jeannine.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/lamp.yaml b/data/enemies/lamp.yaml new file mode 100644 index 0000000..b6d337d --- /dev/null +++ b/data/enemies/lamp.yaml @@ -0,0 +1,10 @@ +# lamp animation +tileSetFile: lamp.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1] diff --git a/data/enemies/lord_abad.yaml b/data/enemies/lord_abad.yaml new file mode 100644 index 0000000..b21c627 --- /dev/null +++ b/data/enemies/lord_abad.yaml @@ -0,0 +1,10 @@ +# lord_abad animation +tileSetFile: lord_abad.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/matatunos.yaml b/data/enemies/matatunos.yaml new file mode 100644 index 0000000..af60d8b --- /dev/null +++ b/data/enemies/matatunos.yaml @@ -0,0 +1,10 @@ +# matatunos animation +tileSetFile: matatunos.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3, 4, 5] diff --git a/data/enemies/mummy.yaml b/data/enemies/mummy.yaml new file mode 100644 index 0000000..8180ddc --- /dev/null +++ b/data/enemies/mummy.yaml @@ -0,0 +1,10 @@ +# mummy animation +tileSetFile: mummy.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: default + speed: 0.2 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/paco.yaml b/data/enemies/paco.yaml new file mode 100644 index 0000000..63aa8fd --- /dev/null +++ b/data/enemies/paco.yaml @@ -0,0 +1,10 @@ +# paco animation +tileSetFile: paco.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 6, 7] diff --git a/data/enemies/qvoid.yaml b/data/enemies/qvoid.yaml new file mode 100644 index 0000000..d7fa548 --- /dev/null +++ b/data/enemies/qvoid.yaml @@ -0,0 +1,10 @@ +# qvoid animation +tileSetFile: qvoid.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 6, 7] diff --git a/data/enemies/robot.yaml b/data/enemies/robot.yaml new file mode 100644 index 0000000..9fccf53 --- /dev/null +++ b/data/enemies/robot.yaml @@ -0,0 +1,10 @@ +# robot animation +tileSetFile: robot.gif +frameWidth: 16 +frameHeight: 32 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/sam.yaml b/data/enemies/sam.yaml new file mode 100644 index 0000000..3a2011c --- /dev/null +++ b/data/enemies/sam.yaml @@ -0,0 +1,10 @@ +# sam animation +tileSetFile: sam.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.0833 + loop: 0 + frames: [0, 1] diff --git a/data/enemies/shock.yaml b/data/enemies/shock.yaml new file mode 100644 index 0000000..9ba2544 --- /dev/null +++ b/data/enemies/shock.yaml @@ -0,0 +1,10 @@ +# shock animation +tileSetFile: shock.gif +frameWidth: 8 +frameHeight: 8 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 4, 3, 2, 1] diff --git a/data/enemies/sigmasua.yaml b/data/enemies/sigmasua.yaml new file mode 100644 index 0000000..c1bd4da --- /dev/null +++ b/data/enemies/sigmasua.yaml @@ -0,0 +1,10 @@ +# sigmasua animation +tileSetFile: sigmasua.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/spark.yaml b/data/enemies/spark.yaml new file mode 100644 index 0000000..98836d1 --- /dev/null +++ b/data/enemies/spark.yaml @@ -0,0 +1,10 @@ +# spark animation +tileSetFile: spark.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/special/aerojailer.yaml b/data/enemies/special/aerojailer.yaml new file mode 100644 index 0000000..cc63b5c --- /dev/null +++ b/data/enemies/special/aerojailer.yaml @@ -0,0 +1,10 @@ +# aerojailer animation +tileSetFile: aerojailer.gif +frameWidth: 43 +frameHeight: 44 + +animations: + - name: default + speed: 1.6667 + loop: 0 + frames: [0] diff --git a/data/enemies/special/arounder.yaml b/data/enemies/special/arounder.yaml new file mode 100644 index 0000000..5ba61d3 --- /dev/null +++ b/data/enemies/special/arounder.yaml @@ -0,0 +1,10 @@ +# arounder animation +tileSetFile: arounder.gif +frameWidth: 79 +frameHeight: 90 + +animations: + - name: default + speed: 1.6667 + loop: 0 + frames: [0] diff --git a/data/enemies/special/pepe_rosita_job.yaml b/data/enemies/special/pepe_rosita_job.yaml new file mode 100644 index 0000000..2199964 --- /dev/null +++ b/data/enemies/special/pepe_rosita_job.yaml @@ -0,0 +1,10 @@ +# pepe_rosita_job animation +tileSetFile: pepe_rosita_job.gif +frameWidth: 62 +frameHeight: 47 + +animations: + - name: default + speed: 1.6667 + loop: 0 + frames: [0] diff --git a/data/enemies/special/shooting_star.yaml b/data/enemies/special/shooting_star.yaml new file mode 100644 index 0000000..080eaf9 --- /dev/null +++ b/data/enemies/special/shooting_star.yaml @@ -0,0 +1,10 @@ +# shooting_star animation +tileSetFile: shooting_star.gif +frameWidth: 64 +frameHeight: 64 + +animations: + - name: default + speed: 0.1 + loop: -1 + frames: [18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] diff --git a/data/enemies/spider.yaml b/data/enemies/spider.yaml new file mode 100644 index 0000000..c65b8c1 --- /dev/null +++ b/data/enemies/spider.yaml @@ -0,0 +1,10 @@ +# spider animation +tileSetFile: spider.gif +frameWidth: 8 +frameHeight: 8 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/stopped_arounder.yaml b/data/enemies/stopped_arounder.yaml new file mode 100644 index 0000000..eb74ee6 --- /dev/null +++ b/data/enemies/stopped_arounder.yaml @@ -0,0 +1,10 @@ +# stopped_arounder animation +tileSetFile: stopped_arounder.gif +frameWidth: 7 +frameHeight: 8 + +animations: + - name: default + speed: 0.1667 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/tree_thing.yaml b/data/enemies/tree_thing.yaml new file mode 100644 index 0000000..1827ba6 --- /dev/null +++ b/data/enemies/tree_thing.yaml @@ -0,0 +1,10 @@ +# tree_thing animation +tileSetFile: tree_thing.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] diff --git a/data/enemies/tuno.yaml b/data/enemies/tuno.yaml new file mode 100644 index 0000000..3be50fe --- /dev/null +++ b/data/enemies/tuno.yaml @@ -0,0 +1,10 @@ +# tuno animation +tileSetFile: tuno.gif +frameWidth: 16 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3, 3, 2, 1, 0] diff --git a/data/enemies/tv.yaml b/data/enemies/tv.yaml new file mode 100644 index 0000000..ecffe2f --- /dev/null +++ b/data/enemies/tv.yaml @@ -0,0 +1,10 @@ +# tv animation +tileSetFile: tv.gif +frameWidth: 16 +frameHeight: 18 + +animations: + - name: default + speed: 0.0833 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/tv_panel.yaml b/data/enemies/tv_panel.yaml new file mode 100644 index 0000000..ee781f8 --- /dev/null +++ b/data/enemies/tv_panel.yaml @@ -0,0 +1,10 @@ +# tv_panel animation +tileSetFile: tv_panel.gif +frameWidth: 24 +frameHeight: 16 + +animations: + - name: default + speed: 0.0667 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/upv_student.yaml b/data/enemies/upv_student.yaml new file mode 100644 index 0000000..a59b04f --- /dev/null +++ b/data/enemies/upv_student.yaml @@ -0,0 +1,10 @@ +# upv_student animation +tileSetFile: upv_student.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/walking_arounder.yaml b/data/enemies/walking_arounder.yaml new file mode 100644 index 0000000..1e91460 --- /dev/null +++ b/data/enemies/walking_arounder.yaml @@ -0,0 +1,10 @@ +# walking_arounder animation +tileSetFile: walking_arounder.gif +frameWidth: 5 +frameHeight: 8 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1] diff --git a/data/enemies/wave.yaml b/data/enemies/wave.yaml new file mode 100644 index 0000000..28f5cea --- /dev/null +++ b/data/enemies/wave.yaml @@ -0,0 +1,10 @@ +# wave animation +tileSetFile: wave.gif +frameWidth: 8 +frameHeight: 8 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/enemies/z80.yaml b/data/enemies/z80.yaml new file mode 100644 index 0000000..3d98a4e --- /dev/null +++ b/data/enemies/z80.yaml @@ -0,0 +1,10 @@ +# z80 animation +tileSetFile: z80.gif +frameWidth: 16 +frameHeight: 32 + +animations: + - name: default + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/player/player.yaml b/data/player/player.yaml new file mode 100644 index 0000000..e35efa4 --- /dev/null +++ b/data/player/player.yaml @@ -0,0 +1,20 @@ +# player animation +tileSetFile: player.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: stand + speed: 0.1333 + loop: 0 + frames: [0] + + - name: walk + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3] + + - name: walk_menu + speed: 0.0 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/data/player/player2.yaml b/data/player/player2.yaml new file mode 100644 index 0000000..395ab89 --- /dev/null +++ b/data/player/player2.yaml @@ -0,0 +1,20 @@ +# player2 animation +tileSetFile: player2.gif +frameWidth: 8 +frameHeight: 16 + +animations: + - name: stand + speed: 0.1333 + loop: 0 + frames: [0] + + - name: walk + speed: 0.1333 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 6, 7] + + - name: walk_menu + speed: 0.0 + loop: 0 + frames: [0, 1, 2, 3, 4, 5, 6, 7] diff --git a/data/player/player_game_over.yaml b/data/player/player_game_over.yaml new file mode 100644 index 0000000..2aa1b2d --- /dev/null +++ b/data/player/player_game_over.yaml @@ -0,0 +1,10 @@ +# player_game_over animation +tileSetFile: player_game_over.gif +frameWidth: 19 +frameHeight: 18 + +animations: + - name: default + speed: 0.1 + loop: 0 + frames: [0, 1, 2, 3] diff --git a/source/core/rendering/surface_animated_sprite.cpp b/source/core/rendering/surface_animated_sprite.cpp index dddb168..36c4d29 100644 --- a/source/core/rendering/surface_animated_sprite.cpp +++ b/source/core/rendering/surface_animated_sprite.cpp @@ -7,6 +7,7 @@ #include // Para runtime_error #include +#include "external/fkyaml_node.hpp" // Para fkyaml::node #include "core/rendering/surface.hpp" // Para Surface #include "core/resources/resource_cache.hpp" // Para Resource #include "core/resources/resource_helper.hpp" // Para ResourceHelper @@ -42,12 +43,136 @@ auto SurfaceAnimatedSprite::loadAnimationsFromFile(const std::string& file_path) return buffer; } +// Helper: Convierte un nodo YAML de frames (array) a vector de SDL_FRect +auto convertYAMLFramesToRects(const fkyaml::node& frames_node, float frame_width, float frame_height, int frames_per_row, int max_tiles) -> std::vector { + std::vector frames; + SDL_FRect rect = {0.0F, 0.0F, frame_width, frame_height}; + + for (const auto& frame_index_node : frames_node) { + const int NUM_TILE = frame_index_node.get_value(); + if (NUM_TILE <= max_tiles) { + rect.x = (NUM_TILE % frames_per_row) * frame_width; + rect.y = (NUM_TILE / frames_per_row) * frame_height; + frames.emplace_back(rect); + } + } + + return frames; +} + +// Carga las animaciones desde un fichero YAML +auto SurfaceAnimatedSprite::loadAnimationsFromYAML(const std::string& file_path, std::shared_ptr& surface, float& frame_width, float& frame_height) -> std::vector { + std::vector animations; + + // Extract filename for logging + const std::string FILE_NAME = file_path.substr(file_path.find_last_of("\\/") + 1); + + try { + // Load YAML file using ResourceHelper (supports both filesystem and pack) + auto file_data = Resource::Helper::loadFile(file_path); + + if (file_data.empty()) { + std::cerr << "Error: Unable to load animation file " << FILE_NAME << '\n'; + throw std::runtime_error("Animation file not found: " + file_path); + } + + printWithDots("Animation : ", FILE_NAME, "[ LOADED ]"); + + // Parse YAML from string + std::string yaml_content(file_data.begin(), file_data.end()); + auto yaml = fkyaml::node::deserialize(yaml_content); + + // --- Parse global configuration --- + if (yaml.contains("tileSetFile")) { + std::string tile_set_file = yaml["tileSetFile"].get_value(); + surface = Resource::Cache::get()->getSurface(tile_set_file); + } + + if (yaml.contains("frameWidth")) { + frame_width = static_cast(yaml["frameWidth"].get_value()); + } + + if (yaml.contains("frameHeight")) { + frame_height = static_cast(yaml["frameHeight"].get_value()); + } + + // Calculate sprite sheet parameters + int frames_per_row = 1; + int max_tiles = 1; + if (surface) { + frames_per_row = surface->getWidth() / static_cast(frame_width); + const int W = surface->getWidth() / static_cast(frame_width); + const int H = surface->getHeight() / static_cast(frame_height); + max_tiles = W * H; + } + + // --- Parse animations array --- + if (yaml.contains("animations") && yaml["animations"].is_sequence()) { + const auto& animations_node = yaml["animations"]; + + for (const auto& anim_node : animations_node) { + AnimationData animation; + + // Parse animation name + if (anim_node.contains("name")) { + animation.name = anim_node["name"].get_value(); + } + + // Parse speed (seconds per frame) + if (anim_node.contains("speed")) { + animation.speed = anim_node["speed"].get_value(); + } + + // Parse loop frame index + if (anim_node.contains("loop")) { + animation.loop = anim_node["loop"].get_value(); + } + + // Parse frames array + if (anim_node.contains("frames") && anim_node["frames"].is_sequence()) { + animation.frames = convertYAMLFramesToRects( + anim_node["frames"], + frame_width, + frame_height, + frames_per_row, + max_tiles + ); + } + + animations.push_back(animation); + } + } + + } catch (const fkyaml::exception& e) { + std::cerr << "YAML parsing error in " << FILE_NAME << ": " << e.what() << '\n'; + throw; + } catch (const std::exception& e) { + std::cerr << "Error loading animation " << FILE_NAME << ": " << e.what() << '\n'; + throw; + } + + return animations; +} + // Constructor SurfaceAnimatedSprite::SurfaceAnimatedSprite(const std::string& file_path) { // Carga las animaciones if (!file_path.empty()) { - Animations v = SurfaceAnimatedSprite::loadAnimationsFromFile(file_path); - setAnimations(v); + // Detectar extensión del archivo + const bool IS_YAML = file_path.substr(file_path.find_last_of('.') + 1) == "yaml"; + + if (IS_YAML) { + // Cargar desde YAML (formato nuevo) + float frame_width = 1.0F; + float frame_height = 1.0F; + animations_ = loadAnimationsFromYAML(file_path, surface_, frame_width, frame_height); + setWidth(frame_width); + setHeight(frame_height); + } else { + // Cargar desde .ani (formato legacy) + Animations v = SurfaceAnimatedSprite::loadAnimationsFromFile(file_path); + setAnimations(v); + } } } @@ -63,8 +188,21 @@ SurfaceAnimatedSprite::SurfaceAnimatedSprite(std::shared_ptr surface, c : SurfaceMovingSprite(std::move(surface)) { // Carga las animaciones if (!file_path.empty()) { - Animations v = SurfaceAnimatedSprite::loadAnimationsFromFile(file_path); - setAnimations(v); + // Detectar extensión del archivo + const bool IS_YAML = file_path.substr(file_path.find_last_of('.') + 1) == "yaml"; + + if (IS_YAML) { + // Cargar desde YAML (formato nuevo) + float frame_width = 1.0F; + float frame_height = 1.0F; + animations_ = loadAnimationsFromYAML(file_path, surface_, frame_width, frame_height); + setWidth(frame_width); + setHeight(frame_height); + } else { + // Cargar desde .ani (formato legacy) + Animations v = SurfaceAnimatedSprite::loadAnimationsFromFile(file_path); + setAnimations(v); + } } } diff --git a/source/core/rendering/surface_animated_sprite.hpp b/source/core/rendering/surface_animated_sprite.hpp index 17a9617..271881d 100644 --- a/source/core/rendering/surface_animated_sprite.hpp +++ b/source/core/rendering/surface_animated_sprite.hpp @@ -15,8 +15,20 @@ class SurfaceAnimatedSprite : public SurfaceMovingSprite { public: using Animations = std::vector; // Tipo para lista de animaciones + // Estructura pública de datos de animación + struct AnimationData { + std::string name{}; // Nombre de la animacion + std::vector frames; // Cada uno de los frames que componen la animación + float speed{0.083F}; // Velocidad de la animación (segundos por frame) + int loop{0}; // Indica a que frame vuelve la animación al terminar. -1 para que no vuelva + bool completed{false}; // Indica si ha finalizado la animación + int current_frame{0}; // Frame actual + float accumulated_time{0.0F}; // Tiempo acumulado para las animaciones (time-based) + }; + // Métodos estáticos - static auto loadAnimationsFromFile(const std::string& file_path) -> Animations; // Carga las animaciones desde fichero + static auto loadAnimationsFromFile(const std::string& file_path) -> Animations; // Carga las animaciones desde fichero .ani + static auto loadAnimationsFromYAML(const std::string& file_path, std::shared_ptr& surface, float& frame_width, float& frame_height) -> std::vector; // Carga las animaciones desde fichero .yaml // Constructores explicit SurfaceAnimatedSprite(const std::string& file_path); @@ -47,17 +59,6 @@ class SurfaceAnimatedSprite : public SurfaceMovingSprite { void setAnimations(const Animations& animations); // Carga la animación desde un vector de cadenas private: - // Estructura interna de datos de animación - struct AnimationData { - std::string name{}; // Nombre de la animacion - std::vector frames; // Cada uno de los frames que componen la animación - float speed{0.083F}; // Velocidad de la animación (segundos por frame) - int loop{0}; // Indica a que frame vuelve la animación al terminar. -1 para que no vuelva - bool completed{false}; // Indica si ha finalizado la animación - int current_frame{0}; // Frame actual - float accumulated_time{0.0F}; // Tiempo acumulado para las animaciones (time-based) - }; - // Funciones amigas (helper functions del .cpp) friend void parseAnimationFrames(const std::string& value, AnimationData& animation, float frame_width, float frame_height, int frames_per_row, int max_tiles); friend auto parseAnimationParameter(const std::string& key, const std::string& value, AnimationData& animation, float frame_width, float frame_height, int frames_per_row, int max_tiles) -> bool;