From 8227e8bcf39d0a3198d6399cad72ac622010adf8 Mon Sep 17 00:00:00 2001 From: Ruslan Ignatov Date: Sat, 20 Dec 2025 18:35:27 +0300 Subject: [PATCH] Reworked weapons and projectiles --- game/area_map/area_map.tscn | 2 +- .../damage/abstract_damage.gd | 0 .../damage/abstract_damage.gd.uid | 0 .../damage/energy_damage.gd | 0 .../damage/energy_damage.gd.uid | 0 .../damage/explosion_damage.gd | 0 .../damage/explosion_damage.gd.uid | 0 .../damage/kinetic_damage.gd | 0 .../damage/kinetic_damage.gd.uid | 0 game/{ => data}/game_data.gd | 0 game/{ => data}/game_data.gd.uid | 0 game/{world/data => data/ships}/enemy_data.gd | 0 .../data => data/ships}/enemy_data.gd.uid | 0 .../{world/data => data/ships}/player_data.gd | 0 .../data => data/ships}/player_data.gd.uid | 0 game/data/weapons/cannon_data.tres | 18 ++ game/data/weapons/gatling_data.tres | 17 ++ game/data/weapons/laser_data.tres | 17 ++ game/data/weapons/launcher_data.tres | 19 ++ game/data/weapons/minelayer_data.tres | 19 ++ game/data/weapons/plasma_data.tres | 17 ++ game/data/weapons/railgun_data.tres | 18 ++ game/data/weapons/shrapnel_data.tres | 19 ++ game/data/weapons/tesla_data.tres | 19 ++ .../data => data/weapons}/weapon_data.gd | 3 +- .../data => data/weapons}/weapon_data.gd.uid | 0 game/{world/data => data/world}/area_data.gd | 0 .../data => data/world}/area_data.gd.uid | 0 .../data => data/world}/passage_data.gd | 0 .../data => data/world}/passage_data.gd.uid | 0 .../{world/data => data/world}/sector_data.gd | 0 .../data => data/world}/sector_data.gd.uid | 0 game/{world/data => data/world}/stage_data.gd | 0 .../data => data/world}/stage_data.gd.uid | 0 game/{world/data => data/world}/world_data.gd | 0 .../data => data/world}/world_data.gd.uid | 0 game/entities/{other => explosions}/blast.gd | 0 .../{other => explosions}/blast.gd.uid | 0 .../entities/{other => explosions}/blast.tscn | 2 +- .../explosion_particles.gd | 0 .../explosion_particles.gd.uid | 0 .../explosion_particles.tscn | 2 +- game/{ => entities}/health_system/health.gd | 0 .../health_system/health.gd.uid | 0 game/{ => entities}/health_system/health.tscn | 2 +- .../health_system}/health_bar_part.gd | 0 .../health_system}/health_bar_part.gd.uid | 0 .../health_system}/health_bar_part.tscn | 2 +- .../health_system}/heath_bar.gd | 0 .../health_system}/heath_bar.gd.uid | 0 .../health_system}/heath_bar.tscn | 4 +- game/entities/ships/abstract_ship.gd | 1 - game/entities/ships/abstract_ship.tscn | 4 +- .../ships/enemies/abstract_enemy_ship.gd | 17 +- .../ships/enemies/abstract_enemy_ship.tscn | 13 +- .../ships/enemies/heavy/heavy_enemy_ship.tscn | 19 +- game/entities/ships/player/player_ship.gd | 7 +- ...ectile.gd => abstract_blast_projectile.gd} | 10 +- ...d.uid => abstract_blast_projectile.gd.uid} | 0 ...le.tscn => abstract_blast_projectile.tscn} | 4 +- ...e.gd => abstract_direct_hit_projectile.gd} | 2 +- ... => abstract_direct_hit_projectile.gd.uid} | 0 ...cn => abstract_direct_hit_projectile.tscn} | 2 +- game/entities/weapons/abstract_projectile.gd | 47 +---- game/entities/weapons/abstract_weapon.gd | 29 +-- ...ctile.gd => abstract_cannon_projectile.gd} | 4 +- ....uid => abstract_cannon_projectile.gd.uid} | 0 ...e.tscn => abstract_cannon_projectile.tscn} | 10 +- ...on_weapon.gd => abstract_cannon_weapon.gd} | 11 +- ...n.gd.uid => abstract_cannon_weapon.gd.uid} | 0 ...eapon.tscn => abstract_cannon_weapon.tscn} | 120 +------------ game/entities/weapons/cannon/cannon_data.tres | 16 -- .../weapons/cannon/enemy_cannon_projectile.gd | 2 + .../cannon/enemy_cannon_projectile.gd.uid | 1 + .../cannon/enemy_cannon_projectile.tscn | 14 ++ .../weapons/cannon/enemy_cannon_weapon.gd | 2 + .../weapons/cannon/enemy_cannon_weapon.gd.uid | 1 + .../weapons/cannon/enemy_cannon_weapon.tscn | 131 ++++++++++++++ .../cannon/player_cannon_projectile.gd | 2 + .../cannon/player_cannon_projectile.gd.uid | 1 + .../cannon/player_cannon_projectile.tscn | 14 ++ .../weapons/cannon/player_cannon_weapon.gd | 2 + .../cannon/player_cannon_weapon.gd.uid | 1 + .../weapons/cannon/player_cannon_weapon.tscn | 130 ++++++++++++++ .../gatling/abstract_gatling_projectile.gd | 2 + ...uid => abstract_gatling_projectile.gd.uid} | 0 ....tscn => abstract_gatling_projectile.tscn} | 9 +- ...g_weapon.gd => abstract_gatling_weapon.gd} | 10 +- ....gd.uid => abstract_gatling_weapon.gd.uid} | 0 .../gatling/abstract_gatling_weapon.tscn | 54 ++++++ .../gatling/enemy_gatling_projectile.gd | 2 + .../gatling/enemy_gatling_projectile.gd.uid | 1 + .../gatling/enemy_gatling_projectile.tscn | 10 ++ .../weapons/gatling/enemy_gatling_weapon.gd | 2 + .../gatling/enemy_gatling_weapon.gd.uid | 1 + .../weapons/gatling/enemy_gatling_weapon.tscn | 86 +++++++++ .../weapons/gatling/gatling_data.tres | 15 -- .../weapons/gatling/gatling_projectile.gd | 2 - .../weapons/gatling/gatling_weapon.tscn | 142 --------------- .../gatling/player_gatling_projectile.gd | 2 + .../gatling/player_gatling_projectile.gd.uid | 1 + .../gatling/player_gatling_projectile.tscn | 10 ++ .../weapons/gatling/player_gatling_weapon.gd | 2 + .../gatling/player_gatling_weapon.gd.uid | 1 + .../gatling/player_gatling_weapon.tscn | 86 +++++++++ ...ectile.gd => abstract_laser_projectile.gd} | 4 +- ...d.uid => abstract_laser_projectile.gd.uid} | 0 ...le.tscn => abstract_laser_projectile.tscn} | 18 +- ...ser_weapon.gd => abstract_laser_weapon.gd} | 7 +- ...on.gd.uid => abstract_laser_weapon.gd.uid} | 0 .../weapons/laser/abstract_laser_weapon.tscn | 21 +++ .../weapons/laser/enemy_laser_projectile.gd | 2 + .../laser/enemy_laser_projectile.gd.uid | 1 + .../weapons/laser/enemy_laser_projectile.tscn | 25 +++ .../weapons/laser/enemy_laser_weapon.gd | 2 + .../weapons/laser/enemy_laser_weapon.gd.uid | 1 + .../weapons/laser/enemy_laser_weapon.tscn | 54 ++++++ game/entities/weapons/laser/laser_data.tres | 15 -- game/entities/weapons/laser/laser_weapon.tscn | 93 ---------- .../weapons/laser/player_laser_projectile.gd | 2 + .../laser/player_laser_projectile.gd.uid | 1 + .../laser/player_laser_projectile.tscn | 24 +++ .../weapons/laser/player_laser_weapon.gd | 2 + .../weapons/laser/player_laser_weapon.gd.uid | 1 + .../weapons/laser/player_laser_weapon.tscn | 54 ++++++ ...ile.gd => abstract_launcher_projectile.gd} | 8 +- ...id => abstract_launcher_projectile.gd.uid} | 0 ...tscn => abstract_launcher_projectile.tscn} | 38 ++-- ..._weapon.gd => abstract_launcher_weapon.gd} | 15 +- ...gd.uid => abstract_launcher_weapon.gd.uid} | 0 ...pon.tscn => abstract_launcher_weapon.tscn} | 35 +--- .../launcher/enemy_launcher_projectile.gd | 2 + .../launcher/enemy_launcher_projectile.gd.uid | 1 + .../launcher/enemy_launcher_projectile.tscn | 14 ++ .../weapons/launcher/enemy_launcher_weapon.gd | 2 + .../launcher/enemy_launcher_weapon.gd.uid | 1 + .../launcher/enemy_launcher_weapon.tscn | 58 ++++++ .../weapons/launcher/launcher_data.tres | 17 -- .../launcher/player_launcher_projectile.gd | 2 + .../player_launcher_projectile.gd.uid | 1 + .../launcher/player_launcher_projectile.tscn | 14 ++ .../launcher/player_launcher_weapon.gd | 2 + .../launcher/player_launcher_weapon.gd.uid | 1 + .../launcher/player_launcher_weapon.tscn | 60 +++++++ ...le.gd => abstract_minelayer_projectile.gd} | 4 +- ...d => abstract_minelayer_projectile.gd.uid} | 0 ...scn => abstract_minelayer_projectile.tscn} | 10 +- ...weapon.gd => abstract_minelayer_weapon.gd} | 12 +- ...d.uid => abstract_minelayer_weapon.gd.uid} | 0 ...on.tscn => abstract_minelayer_weapon.tscn} | 8 +- .../minelayer/enemy_minelayer_projectile.gd | 2 + .../enemy_minelayer_projectile.gd.uid | 1 + .../minelayer/enemy_minelayer_projectile.tscn | 14 ++ .../minelayer/enemy_minelayer_weapon.gd | 2 + .../minelayer/enemy_minelayer_weapon.gd.uid | 1 + .../minelayer/enemy_minelayer_weapon.tscn | 76 ++++++++ .../weapons/minelayer/minelayer_data.tres | 17 -- .../minelayer/player_minelayer_projectile.gd | 2 + .../player_minelayer_projectile.gd.uid | 1 + .../player_minelayer_projectile.tscn | 14 ++ .../minelayer/player_minelayer_weapon.gd | 2 + .../minelayer/player_minelayer_weapon.gd.uid | 1 + .../minelayer/player_minelayer_weapon.tscn | 76 ++++++++ .../plasma/abstract_plasma_projectile.gd | 2 + ....uid => abstract_plasma_projectile.gd.uid} | 0 ...e.tscn => abstract_plasma_projectile.tscn} | 8 +- ...ma_weapon.gd => abstract_plasma_weapon.gd} | 14 +- ...n.gd.uid => abstract_plasma_weapon.gd.uid} | 0 .../plasma/abstract_plasma_weapon.tscn | 22 +++ .../weapons/plasma/enemy_plasma_projectile.gd | 2 + .../plasma/enemy_plasma_projectile.gd.uid | 1 + .../plasma/enemy_plasma_projectile.tscn | 10 ++ .../weapons/plasma/enemy_plasma_weapon.gd | 2 + .../weapons/plasma/enemy_plasma_weapon.gd.uid | 1 + .../weapons/plasma/enemy_plasma_weapon.tscn | 67 +++++++ game/entities/weapons/plasma/plasma_data.tres | 15 -- .../weapons/plasma/plasma_projectile.gd | 2 - .../weapons/plasma/plasma_weapon.tscn | 118 ------------- .../plasma/player_plasma_projectile.gd | 2 + .../plasma/player_plasma_projectile.gd.uid | 1 + .../plasma/player_plasma_projectile.tscn | 10 ++ .../weapons/plasma/player_plasma_weapon.gd | 2 + .../plasma/player_plasma_weapon.gd.uid | 1 + .../weapons/plasma/player_plasma_weapon.tscn | 64 +++++++ .../railgun/abstract_railgun_projectile.gd | 12 ++ ...uid => abstract_railgun_projectile.gd.uid} | 0 ....tscn => abstract_railgun_projectile.tscn} | 29 +-- .../railgun/abstract_railgun_weapon.gd | 26 +++ ....gd.uid => abstract_railgun_weapon.gd.uid} | 0 .../railgun/abstract_railgun_weapon.tscn | 15 ++ .../railgun/enemy_railgun_projectile.gd | 2 + .../railgun/enemy_railgun_projectile.gd.uid | 1 + .../railgun/enemy_railgun_projectile.tscn | 18 ++ .../weapons/railgun/enemy_railgun_weapon.gd | 2 + .../railgun/enemy_railgun_weapon.gd.uid | 1 + .../weapons/railgun/enemy_railgun_weapon.tscn | 93 ++++++++++ .../railgun/player_railgun_projectile.gd | 2 + .../railgun/player_railgun_projectile.gd.uid | 1 + .../railgun/player_railgun_projectile.tscn | 18 ++ .../weapons/railgun/player_railgun_weapon.gd | 2 + .../railgun/player_railgun_weapon.gd.uid | 1 + .../railgun/player_railgun_weapon.tscn | 93 ++++++++++ .../weapons/railgun/railgun_data.tres | 16 -- .../weapons/railgun/railgun_projectile.gd | 32 ---- .../weapons/railgun/railgun_weapon.gd | 27 --- .../weapons/railgun/railgun_weapon.tscn | 167 ------------------ ...ile.gd => abstract_shrapnel_projectile.gd} | 4 +- ...id => abstract_shrapnel_projectile.gd.uid} | 0 ...tscn => abstract_shrapnel_projectile.tscn} | 8 +- ..._weapon.gd => abstract_shrapnel_weapon.gd} | 11 +- ...gd.uid => abstract_shrapnel_weapon.gd.uid} | 0 .../shrapnel/abstract_shrapnel_weapon.tscn | 65 +++++++ .../shrapnel/enemy_shrapnel_projectile.gd | 2 + .../shrapnel/enemy_shrapnel_projectile.gd.uid | 1 + .../shrapnel/enemy_shrapnel_projectile.tscn | 10 ++ .../weapons/shrapnel/enemy_shrapnel_weapon.gd | 2 + .../shrapnel/enemy_shrapnel_weapon.gd.uid | 1 + .../shrapnel/enemy_shrapnel_weapon.tscn | 92 ++++++++++ .../shrapnel/player_shrapnel_projectile.gd | 2 + .../player_shrapnel_projectile.gd.uid | 1 + .../shrapnel/player_shrapnel_projectile.tscn | 10 ++ .../shrapnel/player_shrapnel_weapon.gd | 2 + .../shrapnel/player_shrapnel_weapon.gd.uid | 1 + .../shrapnel/player_shrapnel_weapon.tscn | 91 ++++++++++ .../weapons/shrapnel/shrapnel_data.tres | 17 -- .../weapons/shrapnel/shrapnel_weapon.tscn | 152 ---------------- ...ectile.gd => abstract_tesla_projectile.gd} | 4 +- ...d.uid => abstract_tesla_projectile.gd.uid} | 0 ...le.tscn => abstract_tesla_projectile.tscn} | 8 +- ...sla_weapon.gd => abstract_tesla_weapon.gd} | 8 +- ...on.gd.uid => abstract_tesla_weapon.gd.uid} | 0 ...weapon.tscn => abstract_tesla_weapon.tscn} | 8 +- .../weapons/tesla/enemy_tesla_projectile.gd | 2 + .../tesla/enemy_tesla_projectile.gd.uid | 1 + .../weapons/tesla/enemy_tesla_projectile.tscn | 18 ++ .../weapons/tesla/enemy_tesla_weapon.gd | 2 + .../weapons/tesla/enemy_tesla_weapon.gd.uid | 1 + .../weapons/tesla/enemy_tesla_weapon.tscn | 78 ++++++++ .../weapons/tesla/player_tesla_projectile.gd | 2 + .../tesla/player_tesla_projectile.gd.uid | 1 + .../tesla/player_tesla_projectile.tscn | 18 ++ .../weapons/tesla/player_tesla_weapon.gd | 2 + .../weapons/tesla/player_tesla_weapon.gd.uid | 1 + .../weapons/tesla/player_tesla_weapon.tscn | 78 ++++++++ game/entities/weapons/tesla/tesla_data.tres | 17 -- game/{ => entities/world}/background.gd | 0 game/{ => entities/world}/background.gd.uid | 0 game/{ => entities/world}/background.tscn | 2 +- game/{ => entities/world}/game.gd | 6 +- game/{ => entities/world}/game.gd.uid | 0 game/{ => entities/world}/game.tscn | 10 +- game/{ => entities/world}/passage.gd | 0 game/{ => entities/world}/passage.gd.uid | 0 game/{ => entities/world}/passage.tscn | 4 +- game/{world => }/generators/area_generator.gd | 0 .../generators/area_generator.gd.uid | 0 .../generators/area_generator.tscn | 6 +- .../{world => }/generators/enemy_generator.gd | 0 .../generators/enemy_generator.gd.uid | 0 .../generators/enemy_generator.tscn | 2 +- .../generators/passage_generator.gd | 0 .../generators/passage_generator.gd.uid | 0 .../generators/passage_generator.tscn | 4 +- .../generators/sector_generator.gd | 0 .../generators/sector_generator.gd.uid | 0 .../generators/sector_generator.tscn | 2 +- .../{world => }/generators/stage_generator.gd | 0 .../generators/stage_generator.gd.uid | 0 .../generators/stage_generator.tscn | 4 +- .../{world => }/generators/world_generator.gd | 0 .../generators/world_generator.gd.uid | 0 .../generators/world_generator.tscn | 4 +- {managers => game/managers}/save_manager.gd | 18 +- .../managers}/save_manager.gd.uid | 0 .../managers}/settings_manager.gd | 0 .../managers}/settings_manager.gd.uid | 0 {menu => game/menu}/common/credits.gd | 0 {menu => game/menu}/common/credits.gd.uid | 0 {menu => game/menu}/common/credits.tscn | 2 +- {menu => game/menu}/common/options.gd | 0 {menu => game/menu}/common/options.gd.uid | 0 {menu => game/menu}/common/options.tscn | 2 +- .../menu}/ingame/game_over_screen.gd | 0 .../menu}/ingame/game_over_screen.gd.uid | 0 .../menu}/ingame/game_over_screen.tscn | 2 +- {menu => game/menu}/ingame/pause_menu.gd | 0 {menu => game/menu}/ingame/pause_menu.gd.uid | 0 {menu => game/menu}/ingame/pause_menu.tscn | 2 +- {menu => game/menu}/ingame/pause_screen.gd | 0 .../menu}/ingame/pause_screen.gd.uid | 0 {menu => game/menu}/ingame/pause_screen.tscn | 8 +- {menu => game/menu}/ingame/victory_screen.gd | 0 .../menu}/ingame/victory_screen.gd.uid | 0 .../menu}/ingame/victory_screen.tscn | 2 +- .../menu}/ingame/weapon_selection_screen.gd | 2 +- .../ingame/weapon_selection_screen.gd.uid | 0 .../menu}/ingame/weapon_selection_screen.tscn | 2 +- {menu => game/menu}/ingame/weapon_selector.gd | 0 .../menu}/ingame/weapon_selector.gd.uid | 0 .../menu}/ingame/weapon_selector.tscn | 2 +- {menu => game/menu}/main/main_menu.gd | 0 {menu => game/menu}/main/main_menu.gd.uid | 0 {menu => game/menu}/main/main_menu.tscn | 2 +- .../menu}/main/seed_selection_menu.gd | 2 +- .../menu}/main/seed_selection_menu.gd.uid | 0 .../menu}/main/seed_selection_menu.tscn | 2 +- {menu => game/menu}/main/title_screen.gd | 2 +- {menu => game/menu}/main/title_screen.gd.uid | 0 {menu => game/menu}/main/title_screen.tscn | 12 +- images/weapons.png | 4 +- menu/title_screen.tscn2367379461.tmp | 28 --- project.godot | 5 +- 312 files changed, 2466 insertions(+), 1376 deletions(-) rename game/{health_system => data}/damage/abstract_damage.gd (100%) rename game/{health_system => data}/damage/abstract_damage.gd.uid (100%) rename game/{health_system => data}/damage/energy_damage.gd (100%) rename game/{health_system => data}/damage/energy_damage.gd.uid (100%) rename game/{health_system => data}/damage/explosion_damage.gd (100%) rename game/{health_system => data}/damage/explosion_damage.gd.uid (100%) rename game/{health_system => data}/damage/kinetic_damage.gd (100%) rename game/{health_system => data}/damage/kinetic_damage.gd.uid (100%) rename game/{ => data}/game_data.gd (100%) rename game/{ => data}/game_data.gd.uid (100%) rename game/{world/data => data/ships}/enemy_data.gd (100%) rename game/{world/data => data/ships}/enemy_data.gd.uid (100%) rename game/{world/data => data/ships}/player_data.gd (100%) rename game/{world/data => data/ships}/player_data.gd.uid (100%) create mode 100644 game/data/weapons/cannon_data.tres create mode 100644 game/data/weapons/gatling_data.tres create mode 100644 game/data/weapons/laser_data.tres create mode 100644 game/data/weapons/launcher_data.tres create mode 100644 game/data/weapons/minelayer_data.tres create mode 100644 game/data/weapons/plasma_data.tres create mode 100644 game/data/weapons/railgun_data.tres create mode 100644 game/data/weapons/shrapnel_data.tres create mode 100644 game/data/weapons/tesla_data.tres rename game/{world/data => data/weapons}/weapon_data.gd (67%) rename game/{world/data => data/weapons}/weapon_data.gd.uid (100%) rename game/{world/data => data/world}/area_data.gd (100%) rename game/{world/data => data/world}/area_data.gd.uid (100%) rename game/{world/data => data/world}/passage_data.gd (100%) rename game/{world/data => data/world}/passage_data.gd.uid (100%) rename game/{world/data => data/world}/sector_data.gd (100%) rename game/{world/data => data/world}/sector_data.gd.uid (100%) rename game/{world/data => data/world}/stage_data.gd (100%) rename game/{world/data => data/world}/stage_data.gd.uid (100%) rename game/{world/data => data/world}/world_data.gd (100%) rename game/{world/data => data/world}/world_data.gd.uid (100%) rename game/entities/{other => explosions}/blast.gd (100%) rename game/entities/{other => explosions}/blast.gd.uid (100%) rename game/entities/{other => explosions}/blast.tscn (83%) rename game/entities/{other => explosions}/explosion_particles.gd (100%) rename game/entities/{other => explosions}/explosion_particles.gd.uid (100%) rename game/entities/{other => explosions}/explosion_particles.tscn (96%) rename game/{ => entities}/health_system/health.gd (100%) rename game/{ => entities}/health_system/health.gd.uid (100%) rename game/{ => entities}/health_system/health.tscn (91%) rename game/{health_system/health_bar => entities/health_system}/health_bar_part.gd (100%) rename game/{health_system/health_bar => entities/health_system}/health_bar_part.gd.uid (100%) rename game/{health_system/health_bar => entities/health_system}/health_bar_part.tscn (94%) rename game/{health_system/health_bar => entities/health_system}/heath_bar.gd (100%) rename game/{health_system/health_bar => entities/health_system}/heath_bar.gd.uid (100%) rename game/{health_system/health_bar => entities/health_system}/heath_bar.tscn (89%) rename game/entities/weapons/{blast_projectile.gd => abstract_blast_projectile.gd} (76%) rename game/entities/weapons/{blast_projectile.gd.uid => abstract_blast_projectile.gd.uid} (100%) rename game/entities/weapons/{blast_projectile.tscn => abstract_blast_projectile.tscn} (79%) rename game/entities/weapons/{direct_hit_projectile.gd => abstract_direct_hit_projectile.gd} (82%) rename game/entities/weapons/{direct_hit_projectile.gd.uid => abstract_direct_hit_projectile.gd.uid} (100%) rename game/entities/weapons/{direct_hit__projectile.tscn => abstract_direct_hit_projectile.tscn} (82%) rename game/entities/weapons/cannon/{cannon_projectile.gd => abstract_cannon_projectile.gd} (84%) rename game/entities/weapons/cannon/{cannon_projectile.gd.uid => abstract_cannon_projectile.gd.uid} (100%) rename game/entities/weapons/cannon/{cannon_projectile.tscn => abstract_cannon_projectile.tscn} (84%) rename game/entities/weapons/cannon/{cannon_weapon.gd => abstract_cannon_weapon.gd} (78%) rename game/entities/weapons/cannon/{cannon_weapon.gd.uid => abstract_cannon_weapon.gd.uid} (100%) rename game/entities/weapons/cannon/{cannon_weapon.tscn => abstract_cannon_weapon.tscn} (51%) delete mode 100644 game/entities/weapons/cannon/cannon_data.tres create mode 100644 game/entities/weapons/cannon/enemy_cannon_projectile.gd create mode 100644 game/entities/weapons/cannon/enemy_cannon_projectile.gd.uid create mode 100644 game/entities/weapons/cannon/enemy_cannon_projectile.tscn create mode 100644 game/entities/weapons/cannon/enemy_cannon_weapon.gd create mode 100644 game/entities/weapons/cannon/enemy_cannon_weapon.gd.uid create mode 100644 game/entities/weapons/cannon/enemy_cannon_weapon.tscn create mode 100644 game/entities/weapons/cannon/player_cannon_projectile.gd create mode 100644 game/entities/weapons/cannon/player_cannon_projectile.gd.uid create mode 100644 game/entities/weapons/cannon/player_cannon_projectile.tscn create mode 100644 game/entities/weapons/cannon/player_cannon_weapon.gd create mode 100644 game/entities/weapons/cannon/player_cannon_weapon.gd.uid create mode 100644 game/entities/weapons/cannon/player_cannon_weapon.tscn create mode 100644 game/entities/weapons/gatling/abstract_gatling_projectile.gd rename game/entities/weapons/gatling/{gatling_projectile.gd.uid => abstract_gatling_projectile.gd.uid} (100%) rename game/entities/weapons/gatling/{gatling_projectile.tscn => abstract_gatling_projectile.tscn} (78%) rename game/entities/weapons/gatling/{gatling_weapon.gd => abstract_gatling_weapon.gd} (74%) rename game/entities/weapons/gatling/{gatling_weapon.gd.uid => abstract_gatling_weapon.gd.uid} (100%) create mode 100644 game/entities/weapons/gatling/abstract_gatling_weapon.tscn create mode 100644 game/entities/weapons/gatling/enemy_gatling_projectile.gd create mode 100644 game/entities/weapons/gatling/enemy_gatling_projectile.gd.uid create mode 100644 game/entities/weapons/gatling/enemy_gatling_projectile.tscn create mode 100644 game/entities/weapons/gatling/enemy_gatling_weapon.gd create mode 100644 game/entities/weapons/gatling/enemy_gatling_weapon.gd.uid create mode 100644 game/entities/weapons/gatling/enemy_gatling_weapon.tscn delete mode 100644 game/entities/weapons/gatling/gatling_data.tres delete mode 100644 game/entities/weapons/gatling/gatling_projectile.gd delete mode 100644 game/entities/weapons/gatling/gatling_weapon.tscn create mode 100644 game/entities/weapons/gatling/player_gatling_projectile.gd create mode 100644 game/entities/weapons/gatling/player_gatling_projectile.gd.uid create mode 100644 game/entities/weapons/gatling/player_gatling_projectile.tscn create mode 100644 game/entities/weapons/gatling/player_gatling_weapon.gd create mode 100644 game/entities/weapons/gatling/player_gatling_weapon.gd.uid create mode 100644 game/entities/weapons/gatling/player_gatling_weapon.tscn rename game/entities/weapons/laser/{laser_projectile.gd => abstract_laser_projectile.gd} (84%) rename game/entities/weapons/laser/{laser_projectile.gd.uid => abstract_laser_projectile.gd.uid} (100%) rename game/entities/weapons/laser/{laser_projectile.tscn => abstract_laser_projectile.tscn} (74%) rename game/entities/weapons/laser/{laser_weapon.gd => abstract_laser_weapon.gd} (75%) rename game/entities/weapons/laser/{laser_weapon.gd.uid => abstract_laser_weapon.gd.uid} (100%) create mode 100644 game/entities/weapons/laser/abstract_laser_weapon.tscn create mode 100644 game/entities/weapons/laser/enemy_laser_projectile.gd create mode 100644 game/entities/weapons/laser/enemy_laser_projectile.gd.uid create mode 100644 game/entities/weapons/laser/enemy_laser_projectile.tscn create mode 100644 game/entities/weapons/laser/enemy_laser_weapon.gd create mode 100644 game/entities/weapons/laser/enemy_laser_weapon.gd.uid create mode 100644 game/entities/weapons/laser/enemy_laser_weapon.tscn delete mode 100644 game/entities/weapons/laser/laser_data.tres delete mode 100644 game/entities/weapons/laser/laser_weapon.tscn create mode 100644 game/entities/weapons/laser/player_laser_projectile.gd create mode 100644 game/entities/weapons/laser/player_laser_projectile.gd.uid create mode 100644 game/entities/weapons/laser/player_laser_projectile.tscn create mode 100644 game/entities/weapons/laser/player_laser_weapon.gd create mode 100644 game/entities/weapons/laser/player_laser_weapon.gd.uid create mode 100644 game/entities/weapons/laser/player_laser_weapon.tscn rename game/entities/weapons/launcher/{launcher_projectile.gd => abstract_launcher_projectile.gd} (89%) rename game/entities/weapons/launcher/{launcher_projectile.gd.uid => abstract_launcher_projectile.gd.uid} (100%) rename game/entities/weapons/launcher/{launcher_projectile.tscn => abstract_launcher_projectile.tscn} (75%) rename game/entities/weapons/launcher/{launcher_weapon.gd => abstract_launcher_weapon.gd} (76%) rename game/entities/weapons/launcher/{launcher_weapon.gd.uid => abstract_launcher_weapon.gd.uid} (100%) rename game/entities/weapons/launcher/{launcher_weapon.tscn => abstract_launcher_weapon.tscn} (58%) create mode 100644 game/entities/weapons/launcher/enemy_launcher_projectile.gd create mode 100644 game/entities/weapons/launcher/enemy_launcher_projectile.gd.uid create mode 100644 game/entities/weapons/launcher/enemy_launcher_projectile.tscn create mode 100644 game/entities/weapons/launcher/enemy_launcher_weapon.gd create mode 100644 game/entities/weapons/launcher/enemy_launcher_weapon.gd.uid create mode 100644 game/entities/weapons/launcher/enemy_launcher_weapon.tscn delete mode 100644 game/entities/weapons/launcher/launcher_data.tres create mode 100644 game/entities/weapons/launcher/player_launcher_projectile.gd create mode 100644 game/entities/weapons/launcher/player_launcher_projectile.gd.uid create mode 100644 game/entities/weapons/launcher/player_launcher_projectile.tscn create mode 100644 game/entities/weapons/launcher/player_launcher_weapon.gd create mode 100644 game/entities/weapons/launcher/player_launcher_weapon.gd.uid create mode 100644 game/entities/weapons/launcher/player_launcher_weapon.tscn rename game/entities/weapons/minelayer/{minelayer_projectile.gd => abstract_minelayer_projectile.gd} (97%) rename game/entities/weapons/minelayer/{minelayer_projectile.gd.uid => abstract_minelayer_projectile.gd.uid} (100%) rename game/entities/weapons/minelayer/{minelayer_projectile.tscn => abstract_minelayer_projectile.tscn} (88%) rename game/entities/weapons/minelayer/{minelayer_weapon.gd => abstract_minelayer_weapon.gd} (56%) rename game/entities/weapons/minelayer/{minelayer_weapon.gd.uid => abstract_minelayer_weapon.gd.uid} (100%) rename game/entities/weapons/minelayer/{minelayer_weapon.tscn => abstract_minelayer_weapon.tscn} (90%) create mode 100644 game/entities/weapons/minelayer/enemy_minelayer_projectile.gd create mode 100644 game/entities/weapons/minelayer/enemy_minelayer_projectile.gd.uid create mode 100644 game/entities/weapons/minelayer/enemy_minelayer_projectile.tscn create mode 100644 game/entities/weapons/minelayer/enemy_minelayer_weapon.gd create mode 100644 game/entities/weapons/minelayer/enemy_minelayer_weapon.gd.uid create mode 100644 game/entities/weapons/minelayer/enemy_minelayer_weapon.tscn delete mode 100644 game/entities/weapons/minelayer/minelayer_data.tres create mode 100644 game/entities/weapons/minelayer/player_minelayer_projectile.gd create mode 100644 game/entities/weapons/minelayer/player_minelayer_projectile.gd.uid create mode 100644 game/entities/weapons/minelayer/player_minelayer_projectile.tscn create mode 100644 game/entities/weapons/minelayer/player_minelayer_weapon.gd create mode 100644 game/entities/weapons/minelayer/player_minelayer_weapon.gd.uid create mode 100644 game/entities/weapons/minelayer/player_minelayer_weapon.tscn create mode 100644 game/entities/weapons/plasma/abstract_plasma_projectile.gd rename game/entities/weapons/plasma/{plasma_projectile.gd.uid => abstract_plasma_projectile.gd.uid} (100%) rename game/entities/weapons/plasma/{plasma_projectile.tscn => abstract_plasma_projectile.tscn} (83%) rename game/entities/weapons/plasma/{plasma_weapon.gd => abstract_plasma_weapon.gd} (59%) rename game/entities/weapons/plasma/{plasma_weapon.gd.uid => abstract_plasma_weapon.gd.uid} (100%) create mode 100644 game/entities/weapons/plasma/abstract_plasma_weapon.tscn create mode 100644 game/entities/weapons/plasma/enemy_plasma_projectile.gd create mode 100644 game/entities/weapons/plasma/enemy_plasma_projectile.gd.uid create mode 100644 game/entities/weapons/plasma/enemy_plasma_projectile.tscn create mode 100644 game/entities/weapons/plasma/enemy_plasma_weapon.gd create mode 100644 game/entities/weapons/plasma/enemy_plasma_weapon.gd.uid create mode 100644 game/entities/weapons/plasma/enemy_plasma_weapon.tscn delete mode 100644 game/entities/weapons/plasma/plasma_data.tres delete mode 100644 game/entities/weapons/plasma/plasma_projectile.gd delete mode 100644 game/entities/weapons/plasma/plasma_weapon.tscn create mode 100644 game/entities/weapons/plasma/player_plasma_projectile.gd create mode 100644 game/entities/weapons/plasma/player_plasma_projectile.gd.uid create mode 100644 game/entities/weapons/plasma/player_plasma_projectile.tscn create mode 100644 game/entities/weapons/plasma/player_plasma_weapon.gd create mode 100644 game/entities/weapons/plasma/player_plasma_weapon.gd.uid create mode 100644 game/entities/weapons/plasma/player_plasma_weapon.tscn create mode 100644 game/entities/weapons/railgun/abstract_railgun_projectile.gd rename game/entities/weapons/railgun/{railgun_projectile.gd.uid => abstract_railgun_projectile.gd.uid} (100%) rename game/entities/weapons/railgun/{railgun_projectile.tscn => abstract_railgun_projectile.tscn} (58%) create mode 100644 game/entities/weapons/railgun/abstract_railgun_weapon.gd rename game/entities/weapons/railgun/{railgun_weapon.gd.uid => abstract_railgun_weapon.gd.uid} (100%) create mode 100644 game/entities/weapons/railgun/abstract_railgun_weapon.tscn create mode 100644 game/entities/weapons/railgun/enemy_railgun_projectile.gd create mode 100644 game/entities/weapons/railgun/enemy_railgun_projectile.gd.uid create mode 100644 game/entities/weapons/railgun/enemy_railgun_projectile.tscn create mode 100644 game/entities/weapons/railgun/enemy_railgun_weapon.gd create mode 100644 game/entities/weapons/railgun/enemy_railgun_weapon.gd.uid create mode 100644 game/entities/weapons/railgun/enemy_railgun_weapon.tscn create mode 100644 game/entities/weapons/railgun/player_railgun_projectile.gd create mode 100644 game/entities/weapons/railgun/player_railgun_projectile.gd.uid create mode 100644 game/entities/weapons/railgun/player_railgun_projectile.tscn create mode 100644 game/entities/weapons/railgun/player_railgun_weapon.gd create mode 100644 game/entities/weapons/railgun/player_railgun_weapon.gd.uid create mode 100644 game/entities/weapons/railgun/player_railgun_weapon.tscn delete mode 100644 game/entities/weapons/railgun/railgun_data.tres delete mode 100644 game/entities/weapons/railgun/railgun_projectile.gd delete mode 100644 game/entities/weapons/railgun/railgun_weapon.gd delete mode 100644 game/entities/weapons/railgun/railgun_weapon.tscn rename game/entities/weapons/shrapnel/{shrapnel_projectile.gd => abstract_shrapnel_projectile.gd} (82%) rename game/entities/weapons/shrapnel/{shrapnel_projectile.gd.uid => abstract_shrapnel_projectile.gd.uid} (100%) rename game/entities/weapons/shrapnel/{shrapnel_projectile.tscn => abstract_shrapnel_projectile.tscn} (78%) rename game/entities/weapons/shrapnel/{shrapnel_weapon.gd => abstract_shrapnel_weapon.gd} (73%) rename game/entities/weapons/shrapnel/{shrapnel_weapon.gd.uid => abstract_shrapnel_weapon.gd.uid} (100%) create mode 100644 game/entities/weapons/shrapnel/abstract_shrapnel_weapon.tscn create mode 100644 game/entities/weapons/shrapnel/enemy_shrapnel_projectile.gd create mode 100644 game/entities/weapons/shrapnel/enemy_shrapnel_projectile.gd.uid create mode 100644 game/entities/weapons/shrapnel/enemy_shrapnel_projectile.tscn create mode 100644 game/entities/weapons/shrapnel/enemy_shrapnel_weapon.gd create mode 100644 game/entities/weapons/shrapnel/enemy_shrapnel_weapon.gd.uid create mode 100644 game/entities/weapons/shrapnel/enemy_shrapnel_weapon.tscn create mode 100644 game/entities/weapons/shrapnel/player_shrapnel_projectile.gd create mode 100644 game/entities/weapons/shrapnel/player_shrapnel_projectile.gd.uid create mode 100644 game/entities/weapons/shrapnel/player_shrapnel_projectile.tscn create mode 100644 game/entities/weapons/shrapnel/player_shrapnel_weapon.gd create mode 100644 game/entities/weapons/shrapnel/player_shrapnel_weapon.gd.uid create mode 100644 game/entities/weapons/shrapnel/player_shrapnel_weapon.tscn delete mode 100644 game/entities/weapons/shrapnel/shrapnel_data.tres delete mode 100644 game/entities/weapons/shrapnel/shrapnel_weapon.tscn rename game/entities/weapons/tesla/{tesla_projectile.gd => abstract_tesla_projectile.gd} (96%) rename game/entities/weapons/tesla/{tesla_projectile.gd.uid => abstract_tesla_projectile.gd.uid} (100%) rename game/entities/weapons/tesla/{tesla_projectile.tscn => abstract_tesla_projectile.tscn} (90%) rename game/entities/weapons/tesla/{tesla_weapon.gd => abstract_tesla_weapon.gd} (73%) rename game/entities/weapons/tesla/{tesla_weapon.gd.uid => abstract_tesla_weapon.gd.uid} (100%) rename game/entities/weapons/tesla/{tesla_weapon.tscn => abstract_tesla_weapon.tscn} (92%) create mode 100644 game/entities/weapons/tesla/enemy_tesla_projectile.gd create mode 100644 game/entities/weapons/tesla/enemy_tesla_projectile.gd.uid create mode 100644 game/entities/weapons/tesla/enemy_tesla_projectile.tscn create mode 100644 game/entities/weapons/tesla/enemy_tesla_weapon.gd create mode 100644 game/entities/weapons/tesla/enemy_tesla_weapon.gd.uid create mode 100644 game/entities/weapons/tesla/enemy_tesla_weapon.tscn create mode 100644 game/entities/weapons/tesla/player_tesla_projectile.gd create mode 100644 game/entities/weapons/tesla/player_tesla_projectile.gd.uid create mode 100644 game/entities/weapons/tesla/player_tesla_projectile.tscn create mode 100644 game/entities/weapons/tesla/player_tesla_weapon.gd create mode 100644 game/entities/weapons/tesla/player_tesla_weapon.gd.uid create mode 100644 game/entities/weapons/tesla/player_tesla_weapon.tscn delete mode 100644 game/entities/weapons/tesla/tesla_data.tres rename game/{ => entities/world}/background.gd (100%) rename game/{ => entities/world}/background.gd.uid (100%) rename game/{ => entities/world}/background.tscn (96%) rename game/{ => entities/world}/game.gd (95%) rename game/{ => entities/world}/game.gd.uid (100%) rename game/{ => entities/world}/game.tscn (83%) rename game/{ => entities/world}/passage.gd (100%) rename game/{ => entities/world}/passage.gd.uid (100%) rename game/{ => entities/world}/passage.tscn (96%) rename game/{world => }/generators/area_generator.gd (100%) rename game/{world => }/generators/area_generator.gd.uid (100%) rename game/{world => }/generators/area_generator.tscn (71%) rename game/{world => }/generators/enemy_generator.gd (100%) rename game/{world => }/generators/enemy_generator.gd.uid (100%) rename game/{world => }/generators/enemy_generator.tscn (77%) rename game/{world => }/generators/passage_generator.gd (100%) rename game/{world => }/generators/passage_generator.gd.uid (100%) rename game/{world => }/generators/passage_generator.tscn (72%) rename game/{world => }/generators/sector_generator.gd (100%) rename game/{world => }/generators/sector_generator.gd.uid (100%) rename game/{world => }/generators/sector_generator.tscn (77%) rename game/{world => }/generators/stage_generator.gd (100%) rename game/{world => }/generators/stage_generator.gd.uid (100%) rename game/{world => }/generators/stage_generator.tscn (73%) rename game/{world => }/generators/world_generator.gd (100%) rename game/{world => }/generators/world_generator.gd.uid (100%) rename game/{world => }/generators/world_generator.tscn (73%) rename {managers => game/managers}/save_manager.gd (82%) rename {managers => game/managers}/save_manager.gd.uid (100%) rename {managers => game/managers}/settings_manager.gd (100%) rename {managers => game/managers}/settings_manager.gd.uid (100%) rename {menu => game/menu}/common/credits.gd (100%) rename {menu => game/menu}/common/credits.gd.uid (100%) rename {menu => game/menu}/common/credits.tscn (96%) rename {menu => game/menu}/common/options.gd (100%) rename {menu => game/menu}/common/options.gd.uid (100%) rename {menu => game/menu}/common/options.tscn (98%) rename {menu => game/menu}/ingame/game_over_screen.gd (100%) rename {menu => game/menu}/ingame/game_over_screen.gd.uid (100%) rename {menu => game/menu}/ingame/game_over_screen.tscn (96%) rename {menu => game/menu}/ingame/pause_menu.gd (100%) rename {menu => game/menu}/ingame/pause_menu.gd.uid (100%) rename {menu => game/menu}/ingame/pause_menu.tscn (97%) rename {menu => game/menu}/ingame/pause_screen.gd (100%) rename {menu => game/menu}/ingame/pause_screen.gd.uid (100%) rename {menu => game/menu}/ingame/pause_screen.tscn (86%) rename {menu => game/menu}/ingame/victory_screen.gd (100%) rename {menu => game/menu}/ingame/victory_screen.gd.uid (100%) rename {menu => game/menu}/ingame/victory_screen.tscn (96%) rename {menu => game/menu}/ingame/weapon_selection_screen.gd (91%) rename {menu => game/menu}/ingame/weapon_selection_screen.gd.uid (100%) rename {menu => game/menu}/ingame/weapon_selection_screen.tscn (94%) rename {menu => game/menu}/ingame/weapon_selector.gd (100%) rename {menu => game/menu}/ingame/weapon_selector.gd.uid (100%) rename {menu => game/menu}/ingame/weapon_selector.tscn (96%) rename {menu => game/menu}/main/main_menu.gd (100%) rename {menu => game/menu}/main/main_menu.gd.uid (100%) rename {menu => game/menu}/main/main_menu.tscn (97%) rename {menu => game/menu}/main/seed_selection_menu.gd (96%) rename {menu => game/menu}/main/seed_selection_menu.gd.uid (100%) rename {menu => game/menu}/main/seed_selection_menu.tscn (97%) rename {menu => game/menu}/main/title_screen.gd (93%) rename {menu => game/menu}/main/title_screen.gd.uid (100%) rename {menu => game/menu}/main/title_screen.tscn (85%) delete mode 100644 menu/title_screen.tscn2367379461.tmp diff --git a/game/area_map/area_map.tscn b/game/area_map/area_map.tscn index 969c446..92b1e57 100644 --- a/game/area_map/area_map.tscn +++ b/game/area_map/area_map.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" uid="uid://bk8qn34w5cqmj" path="res://game/area_map/area_map.gd" id="1_hkcry"] [ext_resource type="PackedScene" uid="uid://b8qwok6v44la" path="res://game/area_map/indicators/current_sector_indicator.tscn" id="2_fx4fd"] [ext_resource type="PackedScene" uid="uid://bwru7i7xetjth" path="res://game/area_map/indicators/selected_sector_indicator.tscn" id="3_oxnrh"] -[ext_resource type="PackedScene" uid="uid://chdrjc7c6bdpb" path="res://game/background.tscn" id="4_fx4fd"] +[ext_resource type="PackedScene" uid="uid://chdrjc7c6bdpb" path="res://game/entities/world/background.tscn" id="4_fx4fd"] [node name="AreaMap" type="Node2D"] script = ExtResource("1_hkcry") diff --git a/game/health_system/damage/abstract_damage.gd b/game/data/damage/abstract_damage.gd similarity index 100% rename from game/health_system/damage/abstract_damage.gd rename to game/data/damage/abstract_damage.gd diff --git a/game/health_system/damage/abstract_damage.gd.uid b/game/data/damage/abstract_damage.gd.uid similarity index 100% rename from game/health_system/damage/abstract_damage.gd.uid rename to game/data/damage/abstract_damage.gd.uid diff --git a/game/health_system/damage/energy_damage.gd b/game/data/damage/energy_damage.gd similarity index 100% rename from game/health_system/damage/energy_damage.gd rename to game/data/damage/energy_damage.gd diff --git a/game/health_system/damage/energy_damage.gd.uid b/game/data/damage/energy_damage.gd.uid similarity index 100% rename from game/health_system/damage/energy_damage.gd.uid rename to game/data/damage/energy_damage.gd.uid diff --git a/game/health_system/damage/explosion_damage.gd b/game/data/damage/explosion_damage.gd similarity index 100% rename from game/health_system/damage/explosion_damage.gd rename to game/data/damage/explosion_damage.gd diff --git a/game/health_system/damage/explosion_damage.gd.uid b/game/data/damage/explosion_damage.gd.uid similarity index 100% rename from game/health_system/damage/explosion_damage.gd.uid rename to game/data/damage/explosion_damage.gd.uid diff --git a/game/health_system/damage/kinetic_damage.gd b/game/data/damage/kinetic_damage.gd similarity index 100% rename from game/health_system/damage/kinetic_damage.gd rename to game/data/damage/kinetic_damage.gd diff --git a/game/health_system/damage/kinetic_damage.gd.uid b/game/data/damage/kinetic_damage.gd.uid similarity index 100% rename from game/health_system/damage/kinetic_damage.gd.uid rename to game/data/damage/kinetic_damage.gd.uid diff --git a/game/game_data.gd b/game/data/game_data.gd similarity index 100% rename from game/game_data.gd rename to game/data/game_data.gd diff --git a/game/game_data.gd.uid b/game/data/game_data.gd.uid similarity index 100% rename from game/game_data.gd.uid rename to game/data/game_data.gd.uid diff --git a/game/world/data/enemy_data.gd b/game/data/ships/enemy_data.gd similarity index 100% rename from game/world/data/enemy_data.gd rename to game/data/ships/enemy_data.gd diff --git a/game/world/data/enemy_data.gd.uid b/game/data/ships/enemy_data.gd.uid similarity index 100% rename from game/world/data/enemy_data.gd.uid rename to game/data/ships/enemy_data.gd.uid diff --git a/game/world/data/player_data.gd b/game/data/ships/player_data.gd similarity index 100% rename from game/world/data/player_data.gd rename to game/data/ships/player_data.gd diff --git a/game/world/data/player_data.gd.uid b/game/data/ships/player_data.gd.uid similarity index 100% rename from game/world/data/player_data.gd.uid rename to game/data/ships/player_data.gd.uid diff --git a/game/data/weapons/cannon_data.tres b/game/data/weapons/cannon_data.tres new file mode 100644 index 0000000..72398dc --- /dev/null +++ b/game/data/weapons/cannon_data.tres @@ -0,0 +1,18 @@ +[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://dxap3sahurth4"] + +[ext_resource type="PackedScene" uid="uid://d3co2xx0th1d0" path="res://game/entities/weapons/cannon/enemy_cannon_weapon.tscn" id="1_2gkq7"] +[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_c34y3"] +[ext_resource type="PackedScene" uid="uid://mpr5kl87nx3f" path="res://game/entities/weapons/cannon/player_cannon_weapon.tscn" id="2_qvf4o"] + +[resource] +script = ExtResource("1_c34y3") +id = "cannon" +name = "Cannon" +group = "explosion" +description = "High damage (explosion) +Low firerate +Moderate velocity +High explosion radius" +enemy_scene = ExtResource("1_2gkq7") +player_scene = ExtResource("2_qvf4o") +metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/data/weapons/gatling_data.tres b/game/data/weapons/gatling_data.tres new file mode 100644 index 0000000..311472b --- /dev/null +++ b/game/data/weapons/gatling_data.tres @@ -0,0 +1,17 @@ +[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://djelo5gu3ybuf"] + +[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_bt4k8"] +[ext_resource type="PackedScene" uid="uid://b0ajhllwm5qux" path="res://game/entities/weapons/gatling/enemy_gatling_weapon.tscn" id="1_punrp"] +[ext_resource type="PackedScene" uid="uid://ca2cjffcrfxkq" path="res://game/entities/weapons/gatling/player_gatling_weapon.tscn" id="2_84glq"] + +[resource] +script = ExtResource("1_bt4k8") +id = "gatling" +name = "Gatling" +group = "kinetic" +description = "Low damage (kinetic) +High firerate +Moderate velocity" +enemy_scene = ExtResource("1_punrp") +player_scene = ExtResource("2_84glq") +metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/data/weapons/laser_data.tres b/game/data/weapons/laser_data.tres new file mode 100644 index 0000000..af7131f --- /dev/null +++ b/game/data/weapons/laser_data.tres @@ -0,0 +1,17 @@ +[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://y7ccba1uqf2d"] + +[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_ipxhy"] +[ext_resource type="PackedScene" uid="uid://mjt8xj8k28vi" path="res://game/entities/weapons/laser/enemy_laser_weapon.tscn" id="1_mdqmb"] +[ext_resource type="PackedScene" uid="uid://cargptjtnale2" path="res://game/entities/weapons/laser/player_laser_weapon.tscn" id="2_bmgx0"] + +[resource] +script = ExtResource("1_ipxhy") +id = "laser" +name = "Laser" +group = "energy" +description = "Low damage (energetic) +High firerate +Low velocity" +enemy_scene = ExtResource("1_mdqmb") +player_scene = ExtResource("2_bmgx0") +metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/data/weapons/launcher_data.tres b/game/data/weapons/launcher_data.tres new file mode 100644 index 0000000..c75a383 --- /dev/null +++ b/game/data/weapons/launcher_data.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://ddgggndifycge"] + +[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_tcis2"] +[ext_resource type="PackedScene" uid="uid://b757rcwc231o2" path="res://game/entities/weapons/launcher/enemy_launcher_weapon.tscn" id="1_vypk3"] +[ext_resource type="PackedScene" uid="uid://bmn3cxk1ajydl" path="res://game/entities/weapons/launcher/player_launcher_weapon.tscn" id="2_sdkfu"] + +[resource] +script = ExtResource("1_tcis2") +id = "launcher" +name = "Launcher" +group = "explosion" +description = "Moderate damage (explosion) +Moderate firerate +Low velocity +Small explosion radius +Homing" +enemy_scene = ExtResource("1_vypk3") +player_scene = ExtResource("2_sdkfu") +metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/data/weapons/minelayer_data.tres b/game/data/weapons/minelayer_data.tres new file mode 100644 index 0000000..6ea4bb2 --- /dev/null +++ b/game/data/weapons/minelayer_data.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://40sshnf6g80k"] + +[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_152qt"] +[ext_resource type="PackedScene" uid="uid://bjbfi6vvikk15" path="res://game/entities/weapons/minelayer/enemy_minelayer_weapon.tscn" id="1_bpafq"] +[ext_resource type="PackedScene" uid="uid://dxh4m1upio4fx" path="res://game/entities/weapons/minelayer/player_minelayer_weapon.tscn" id="2_77jvm"] + +[resource] +script = ExtResource("1_152qt") +id = "minelayer" +name = "Minelayer" +group = "explosion" +description = "High damage (explosion) +Low firerate +Low velocity +Medium explosion radius +Short range" +enemy_scene = ExtResource("1_bpafq") +player_scene = ExtResource("2_77jvm") +metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/data/weapons/plasma_data.tres b/game/data/weapons/plasma_data.tres new file mode 100644 index 0000000..7e689c0 --- /dev/null +++ b/game/data/weapons/plasma_data.tres @@ -0,0 +1,17 @@ +[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://dq0pjpg3slr8s"] + +[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_3fasx"] +[ext_resource type="PackedScene" uid="uid://dtl3d7soletdn" path="res://game/entities/weapons/plasma/enemy_plasma_weapon.tscn" id="1_h185p"] +[ext_resource type="PackedScene" uid="uid://dd8juohu1x2xo" path="res://game/entities/weapons/plasma/player_plasma_weapon.tscn" id="2_6cfmm"] + +[resource] +script = ExtResource("1_3fasx") +id = "plasma" +name = "Plasma" +group = "energy" +description = "Moderate damage (energetic) +Moderate firerate +Moderate velocity" +enemy_scene = ExtResource("1_h185p") +player_scene = ExtResource("2_6cfmm") +metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/data/weapons/railgun_data.tres b/game/data/weapons/railgun_data.tres new file mode 100644 index 0000000..6852d30 --- /dev/null +++ b/game/data/weapons/railgun_data.tres @@ -0,0 +1,18 @@ +[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://dtpk5apjti4vh"] + +[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_6lcn5"] +[ext_resource type="PackedScene" uid="uid://chgf0tdlikwlb" path="res://game/entities/weapons/railgun/enemy_railgun_weapon.tscn" id="1_srmn2"] +[ext_resource type="PackedScene" uid="uid://b745401et1bom" path="res://game/entities/weapons/railgun/player_railgun_weapon.tscn" id="2_hqpda"] + +[resource] +script = ExtResource("1_6lcn5") +id = "railgun" +name = "Railgun" +group = "kinetic" +description = "High damage (kinetic) +Low firerate +High velocity +Can pierce enemies" +enemy_scene = ExtResource("1_srmn2") +player_scene = ExtResource("2_hqpda") +metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/data/weapons/shrapnel_data.tres b/game/data/weapons/shrapnel_data.tres new file mode 100644 index 0000000..7dd0b59 --- /dev/null +++ b/game/data/weapons/shrapnel_data.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://d1kc2gvye2f28"] + +[ext_resource type="PackedScene" uid="uid://df816hasxkglk" path="res://game/entities/weapons/shrapnel/enemy_shrapnel_weapon.tscn" id="1_260ps"] +[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_xds2o"] +[ext_resource type="PackedScene" uid="uid://cvtwks2ooetxp" path="res://game/entities/weapons/shrapnel/player_shrapnel_weapon.tscn" id="2_nj3we"] + +[resource] +script = ExtResource("1_xds2o") +id = "shrapnel" +name = "Shrapnel" +group = "kinetic" +description = "High damage (kinetic) +Moderate firerate +Moderate velocity +Short range +Multiple projectiles" +enemy_scene = ExtResource("1_260ps") +player_scene = ExtResource("2_nj3we") +metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/data/weapons/tesla_data.tres b/game/data/weapons/tesla_data.tres new file mode 100644 index 0000000..761e874 --- /dev/null +++ b/game/data/weapons/tesla_data.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://c7tim0uie3m35"] + +[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_a16gw"] +[ext_resource type="PackedScene" uid="uid://dqgybquvuw0v6" path="res://game/entities/weapons/tesla/enemy_tesla_weapon.tscn" id="1_iwabo"] +[ext_resource type="PackedScene" uid="uid://u6hpohk5i3eu" path="res://game/entities/weapons/tesla/player_tesla_weapon.tscn" id="2_kqe35"] + +[resource] +script = ExtResource("1_a16gw") +id = "tesla" +name = "Tesla" +group = "energy" +description = "Moderate damage (energetic) +Low firerate +High velocity +Hits nearest target +Can pierce enemies" +enemy_scene = ExtResource("1_iwabo") +player_scene = ExtResource("2_kqe35") +metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/world/data/weapon_data.gd b/game/data/weapons/weapon_data.gd similarity index 67% rename from game/world/data/weapon_data.gd rename to game/data/weapons/weapon_data.gd index bc40789..65bf4aa 100644 --- a/game/world/data/weapon_data.gd +++ b/game/data/weapons/weapon_data.gd @@ -8,4 +8,5 @@ extends Resource @export_multiline var description: String -@export var scene: PackedScene +@export var enemy_scene: PackedScene +@export var player_scene: PackedScene diff --git a/game/world/data/weapon_data.gd.uid b/game/data/weapons/weapon_data.gd.uid similarity index 100% rename from game/world/data/weapon_data.gd.uid rename to game/data/weapons/weapon_data.gd.uid diff --git a/game/world/data/area_data.gd b/game/data/world/area_data.gd similarity index 100% rename from game/world/data/area_data.gd rename to game/data/world/area_data.gd diff --git a/game/world/data/area_data.gd.uid b/game/data/world/area_data.gd.uid similarity index 100% rename from game/world/data/area_data.gd.uid rename to game/data/world/area_data.gd.uid diff --git a/game/world/data/passage_data.gd b/game/data/world/passage_data.gd similarity index 100% rename from game/world/data/passage_data.gd rename to game/data/world/passage_data.gd diff --git a/game/world/data/passage_data.gd.uid b/game/data/world/passage_data.gd.uid similarity index 100% rename from game/world/data/passage_data.gd.uid rename to game/data/world/passage_data.gd.uid diff --git a/game/world/data/sector_data.gd b/game/data/world/sector_data.gd similarity index 100% rename from game/world/data/sector_data.gd rename to game/data/world/sector_data.gd diff --git a/game/world/data/sector_data.gd.uid b/game/data/world/sector_data.gd.uid similarity index 100% rename from game/world/data/sector_data.gd.uid rename to game/data/world/sector_data.gd.uid diff --git a/game/world/data/stage_data.gd b/game/data/world/stage_data.gd similarity index 100% rename from game/world/data/stage_data.gd rename to game/data/world/stage_data.gd diff --git a/game/world/data/stage_data.gd.uid b/game/data/world/stage_data.gd.uid similarity index 100% rename from game/world/data/stage_data.gd.uid rename to game/data/world/stage_data.gd.uid diff --git a/game/world/data/world_data.gd b/game/data/world/world_data.gd similarity index 100% rename from game/world/data/world_data.gd rename to game/data/world/world_data.gd diff --git a/game/world/data/world_data.gd.uid b/game/data/world/world_data.gd.uid similarity index 100% rename from game/world/data/world_data.gd.uid rename to game/data/world/world_data.gd.uid diff --git a/game/entities/other/blast.gd b/game/entities/explosions/blast.gd similarity index 100% rename from game/entities/other/blast.gd rename to game/entities/explosions/blast.gd diff --git a/game/entities/other/blast.gd.uid b/game/entities/explosions/blast.gd.uid similarity index 100% rename from game/entities/other/blast.gd.uid rename to game/entities/explosions/blast.gd.uid diff --git a/game/entities/other/blast.tscn b/game/entities/explosions/blast.tscn similarity index 83% rename from game/entities/other/blast.tscn rename to game/entities/explosions/blast.tscn index 895c55f..211f848 100644 --- a/game/entities/other/blast.tscn +++ b/game/entities/explosions/blast.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://pfvs7wqrnn08"] -[ext_resource type="Script" uid="uid://clt20ebs6shkm" path="res://game/entities/other/blast.gd" id="1_2fpxy"] +[ext_resource type="Script" uid="uid://clt20ebs6shkm" path="res://game/entities/explosions/blast.gd" id="1_2fpxy"] [node name="Blast" type="Area2D"] script = ExtResource("1_2fpxy") diff --git a/game/entities/other/explosion_particles.gd b/game/entities/explosions/explosion_particles.gd similarity index 100% rename from game/entities/other/explosion_particles.gd rename to game/entities/explosions/explosion_particles.gd diff --git a/game/entities/other/explosion_particles.gd.uid b/game/entities/explosions/explosion_particles.gd.uid similarity index 100% rename from game/entities/other/explosion_particles.gd.uid rename to game/entities/explosions/explosion_particles.gd.uid diff --git a/game/entities/other/explosion_particles.tscn b/game/entities/explosions/explosion_particles.tscn similarity index 96% rename from game/entities/other/explosion_particles.tscn rename to game/entities/explosions/explosion_particles.tscn index 70be893..d603607 100644 --- a/game/entities/other/explosion_particles.tscn +++ b/game/entities/explosions/explosion_particles.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=3 uid="uid://bhxib2ltpkcbf"] [ext_resource type="Texture2D" uid="uid://gh7mwehpqfco" path="res://particle_textures/flame_medium.tres" id="1_6awlt"] -[ext_resource type="Script" uid="uid://dhnjdam04g4tb" path="res://game/entities/other/explosion_particles.gd" id="1_w1d42"] +[ext_resource type="Script" uid="uid://dhnjdam04g4tb" path="res://game/entities/explosions/explosion_particles.gd" id="1_w1d42"] [ext_resource type="Texture2D" uid="uid://b13al44e8ofsx" path="res://particle_textures/flame_large.tres" id="2_w1d42"] [ext_resource type="Texture2D" uid="uid://blp4o1c7y66wv" path="res://particle_textures/flame_huge.tres" id="3_lplfr"] diff --git a/game/health_system/health.gd b/game/entities/health_system/health.gd similarity index 100% rename from game/health_system/health.gd rename to game/entities/health_system/health.gd diff --git a/game/health_system/health.gd.uid b/game/entities/health_system/health.gd.uid similarity index 100% rename from game/health_system/health.gd.uid rename to game/entities/health_system/health.gd.uid diff --git a/game/health_system/health.tscn b/game/entities/health_system/health.tscn similarity index 91% rename from game/health_system/health.tscn rename to game/entities/health_system/health.tscn index 5bbbb6c..884c1d8 100644 --- a/game/health_system/health.tscn +++ b/game/entities/health_system/health.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://clkymhkv3cevm"] -[ext_resource type="Script" uid="uid://d3g4xbq45qmpr" path="res://game/health_system/health.gd" id="1_gwdg4"] +[ext_resource type="Script" uid="uid://d3g4xbq45qmpr" path="res://game/entities/health_system/health.gd" id="1_gwdg4"] [node name="Health" type="Node"] script = ExtResource("1_gwdg4") diff --git a/game/health_system/health_bar/health_bar_part.gd b/game/entities/health_system/health_bar_part.gd similarity index 100% rename from game/health_system/health_bar/health_bar_part.gd rename to game/entities/health_system/health_bar_part.gd diff --git a/game/health_system/health_bar/health_bar_part.gd.uid b/game/entities/health_system/health_bar_part.gd.uid similarity index 100% rename from game/health_system/health_bar/health_bar_part.gd.uid rename to game/entities/health_system/health_bar_part.gd.uid diff --git a/game/health_system/health_bar/health_bar_part.tscn b/game/entities/health_system/health_bar_part.tscn similarity index 94% rename from game/health_system/health_bar/health_bar_part.tscn rename to game/entities/health_system/health_bar_part.tscn index 201ade5..4f33009 100644 --- a/game/health_system/health_bar/health_bar_part.tscn +++ b/game/entities/health_system/health_bar_part.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://xbfxsiumbgkp"] -[ext_resource type="Script" uid="uid://drwgq8fxaclvn" path="res://game/health_system/health_bar/health_bar_part.gd" id="1_nuv67"] +[ext_resource type="Script" uid="uid://drwgq8fxaclvn" path="res://game/entities/health_system/health_bar_part.gd" id="1_nuv67"] [node name="HealthBarPart" type="Control"] layout_mode = 3 diff --git a/game/health_system/health_bar/heath_bar.gd b/game/entities/health_system/heath_bar.gd similarity index 100% rename from game/health_system/health_bar/heath_bar.gd rename to game/entities/health_system/heath_bar.gd diff --git a/game/health_system/health_bar/heath_bar.gd.uid b/game/entities/health_system/heath_bar.gd.uid similarity index 100% rename from game/health_system/health_bar/heath_bar.gd.uid rename to game/entities/health_system/heath_bar.gd.uid diff --git a/game/health_system/health_bar/heath_bar.tscn b/game/entities/health_system/heath_bar.tscn similarity index 89% rename from game/health_system/health_bar/heath_bar.tscn rename to game/entities/health_system/heath_bar.tscn index af8887b..31d7544 100644 --- a/game/health_system/health_bar/heath_bar.tscn +++ b/game/entities/health_system/heath_bar.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=7 format=3 uid="uid://d2snum2pxc2ui"] -[ext_resource type="Script" uid="uid://be7k64p2kel8b" path="res://game/health_system/health_bar/heath_bar.gd" id="1_bx561"] -[ext_resource type="PackedScene" uid="uid://xbfxsiumbgkp" path="res://game/health_system/health_bar/health_bar_part.tscn" id="2_wb6me"] +[ext_resource type="Script" uid="uid://be7k64p2kel8b" path="res://game/entities/health_system/heath_bar.gd" id="1_bx561"] +[ext_resource type="PackedScene" uid="uid://xbfxsiumbgkp" path="res://game/entities/health_system/health_bar_part.tscn" id="2_wb6me"] [ext_resource type="Texture2D" uid="uid://do586oblhwuc5" path="res://images/health.png" id="3_fogsl"] [sub_resource type="AtlasTexture" id="AtlasTexture_sgr4k"] diff --git a/game/entities/ships/abstract_ship.gd b/game/entities/ships/abstract_ship.gd index 269bda3..b250410 100644 --- a/game/entities/ships/abstract_ship.gd +++ b/game/entities/ships/abstract_ship.gd @@ -101,7 +101,6 @@ func _on_health_depleted() -> void: func _add_weapon(weapon: AbstractWeapon, weapon_position: Vector2) -> void: weapon.position = weapon_position - weapon.rotation_degrees = weapon_rotation add_child(weapon) _weapons.append(weapon) diff --git a/game/entities/ships/abstract_ship.tscn b/game/entities/ships/abstract_ship.tscn index 834dc75..51b9793 100644 --- a/game/entities/ships/abstract_ship.tscn +++ b/game/entities/ships/abstract_ship.tscn @@ -2,8 +2,8 @@ [ext_resource type="Script" uid="uid://cesibaqtrgotl" path="res://game/entities/ships/abstract_ship.gd" id="1_6isjb"] [ext_resource type="Shader" uid="uid://dwh22f35u5qqi" path="res://game/entities/ships/shield.gdshader" id="2_dokxo"] -[ext_resource type="PackedScene" uid="uid://clkymhkv3cevm" path="res://game/health_system/health.tscn" id="2_xxtvk"] -[ext_resource type="PackedScene" uid="uid://d2snum2pxc2ui" path="res://game/health_system/health_bar/heath_bar.tscn" id="3_l62e5"] +[ext_resource type="PackedScene" uid="uid://clkymhkv3cevm" path="res://game/entities/health_system/health.tscn" id="2_xxtvk"] +[ext_resource type="PackedScene" uid="uid://d2snum2pxc2ui" path="res://game/entities/health_system/heath_bar.tscn" id="3_l62e5"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_dokxo"] resource_local_to_scene = true diff --git a/game/entities/ships/enemies/abstract_enemy_ship.gd b/game/entities/ships/enemies/abstract_enemy_ship.gd index a33b3de..3c9a254 100644 --- a/game/entities/ships/enemies/abstract_enemy_ship.gd +++ b/game/entities/ships/enemies/abstract_enemy_ship.gd @@ -18,11 +18,6 @@ func _physics_process(delta: float) -> void: shoot() -func _add_weapon(weapon: AbstractWeapon, weapon_position: Vector2) -> void: - super._add_weapon(weapon, weapon_position) - weapon.set_belonging(AbstractWeapon.Belonging.ENEMY) - - func _on_visible_on_screen_notifier_2d_screen_entered() -> void: is_on_screen = true @@ -42,12 +37,6 @@ func _set_enemy_data(data: EnemyData) -> void: positions.remove_at(0) for i in range(min(enemy_data.weapon_count, positions.size())): - var weapon : AbstractWeapon = enemy_data.weapon.scene.instantiate() - _add_weapon(weapon, weapon_positions[i]) - - -func _create_weapon(weapon_id : String) -> AbstractWeapon: - var weapon_scene : PackedScene = load(WEAPON_SCENES[weapon_id]) - var weapon : AbstractWeapon = weapon_scene.instantiate() - weapon_type = weapon.type - return weapon + var weapon_scene := enemy_data.weapon.enemy_scene + var weapon : AbstractWeapon = weapon_scene.instantiate() + _add_weapon(weapon, positions[i]) diff --git a/game/entities/ships/enemies/abstract_enemy_ship.tscn b/game/entities/ships/enemies/abstract_enemy_ship.tscn index a0b08f4..65b4a5e 100644 --- a/game/entities/ships/enemies/abstract_enemy_ship.tscn +++ b/game/entities/ships/enemies/abstract_enemy_ship.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=6 format=3 uid="uid://dwsn0lf1e3578"] +[gd_scene load_steps=7 format=3 uid="uid://dwsn0lf1e3578"] [ext_resource type="PackedScene" uid="uid://jvyagshykmgb" path="res://game/entities/ships/abstract_ship.tscn" id="1_28j6l"] [ext_resource type="Script" uid="uid://byicf1t0807pq" path="res://game/entities/ships/enemies/abstract_enemy_ship.gd" id="2_fwvrd"] @@ -12,15 +12,24 @@ shader_parameter/speed = 0.0 shader_parameter/scale = 20.0 shader_parameter/intensity = 1.0 +[sub_resource type="ShaderMaterial" id="ShaderMaterial_l8c0n"] +resource_local_to_scene = true +shader = ExtResource("3_6nnf4") +shader_parameter/speed = 5.0 +shader_parameter/scale = 20.0 +shader_parameter/intensity = 1.0 + [node name="AbstractEnemyShip" groups=["enemies"] instance=ExtResource("1_28j6l")] collision_layer = 4 collision_mask = 6 script = ExtResource("2_fwvrd") -weapon_rotation = 180 [node name="ArmorSprite" parent="." index="1"] material = SubResource("ShaderMaterial_dlmr1") +[node name="ShieldSprite" parent="." index="2"] +material = SubResource("ShaderMaterial_l8c0n") + [node name="EnemyController" parent="." index="4" node_paths=PackedStringArray("ship") instance=ExtResource("3_l8c0n")] ship = NodePath("..") diff --git a/game/entities/ships/enemies/heavy/heavy_enemy_ship.tscn b/game/entities/ships/enemies/heavy/heavy_enemy_ship.tscn index 3ec9b8e..67fcce6 100644 --- a/game/entities/ships/enemies/heavy/heavy_enemy_ship.tscn +++ b/game/entities/ships/enemies/heavy/heavy_enemy_ship.tscn @@ -1,17 +1,32 @@ -[gd_scene load_steps=7 format=3 uid="uid://d3epy8w15qmjm"] +[gd_scene load_steps=10 format=3 uid="uid://d3epy8w15qmjm"] [ext_resource type="PackedScene" uid="uid://dwsn0lf1e3578" path="res://game/entities/ships/enemies/abstract_enemy_ship.tscn" id="1_wvvpj"] [ext_resource type="Script" uid="uid://cxomr1oojcrcl" path="res://game/entities/ships/enemies/heavy/heavy_enemy_ship.gd" id="2_3umer"] [ext_resource type="Texture2D" uid="uid://5cgq8o5oqunq" path="res://images/ships/enemies/heavy.png" id="3_xqe8d"] +[ext_resource type="Shader" uid="uid://dwh22f35u5qqi" path="res://game/entities/ships/shield.gdshader" id="4_qawoi"] [sub_resource type="AtlasTexture" id="AtlasTexture_xqe8d"] atlas = ExtResource("3_xqe8d") region = Rect2(0, 0, 64, 48) +[sub_resource type="ShaderMaterial" id="ShaderMaterial_c4do6"] +resource_local_to_scene = true +shader = ExtResource("4_qawoi") +shader_parameter/speed = 0.0 +shader_parameter/scale = 20.0 +shader_parameter/intensity = 1.0 + [sub_resource type="AtlasTexture" id="AtlasTexture_qawoi"] atlas = ExtResource("3_xqe8d") region = Rect2(0, 48, 64, 48) +[sub_resource type="ShaderMaterial" id="ShaderMaterial_6d574"] +resource_local_to_scene = true +shader = ExtResource("4_qawoi") +shader_parameter/speed = 5.0 +shader_parameter/scale = 20.0 +shader_parameter/intensity = 1.0 + [sub_resource type="AtlasTexture" id="AtlasTexture_c4do6"] atlas = ExtResource("3_xqe8d") region = Rect2(0, 96, 64, 48) @@ -27,9 +42,11 @@ mass = 600 texture = SubResource("AtlasTexture_xqe8d") [node name="ArmorSprite" parent="." index="1"] +material = SubResource("ShaderMaterial_c4do6") texture = SubResource("AtlasTexture_qawoi") [node name="ShieldSprite" parent="." index="2"] +material = SubResource("ShaderMaterial_6d574") texture = SubResource("AtlasTexture_c4do6") [node name="CollisionPolygon2D" parent="." index="3"] diff --git a/game/entities/ships/player/player_ship.gd b/game/entities/ships/player/player_ship.gd index 1a8ac56..440c5e9 100644 --- a/game/entities/ships/player/player_ship.gd +++ b/game/entities/ships/player/player_ship.gd @@ -40,11 +40,6 @@ func _physics_process(delta: float) -> void: blink_charge_indicator.value = blink_charge -func _add_weapon(weapon: AbstractWeapon, weapon_position: Vector2) -> void: - super._add_weapon(weapon, weapon_position) - weapon.set_belonging(AbstractWeapon.Belonging.PLAYER) - - func _blink(direction: Vector2) -> void: if blink_charge < BLINK_CHARGE_MAXIMUM: return @@ -70,7 +65,7 @@ func _set_player_data(new_data: PlayerData) -> void: player_data = new_data _weapons.clear() for i in range(min(player_data.weapons.size(), weapon_positions.size())): - var weapon_scene := player_data.weapons[i].scene + var weapon_scene := player_data.weapons[i].player_scene var weapon : AbstractWeapon = weapon_scene.instantiate() _add_weapon(weapon, weapon_positions[i]) diff --git a/game/entities/weapons/blast_projectile.gd b/game/entities/weapons/abstract_blast_projectile.gd similarity index 76% rename from game/entities/weapons/blast_projectile.gd rename to game/entities/weapons/abstract_blast_projectile.gd index 4a43080..e760828 100644 --- a/game/entities/weapons/blast_projectile.gd +++ b/game/entities/weapons/abstract_blast_projectile.gd @@ -1,4 +1,4 @@ -class_name BlastProjectile +class_name AbstractBlastProjectile extends AbstractProjectile @@ -19,11 +19,3 @@ func _try_to_damage_by_blast() -> bool: if _try_to_damage(overlapping_body, damage): damaged = true return damaged - - - -func _apply_collision_mask() -> void: - super._apply_collision_mask() - - if blast: - _apply_collision_mask_to_area(blast) diff --git a/game/entities/weapons/blast_projectile.gd.uid b/game/entities/weapons/abstract_blast_projectile.gd.uid similarity index 100% rename from game/entities/weapons/blast_projectile.gd.uid rename to game/entities/weapons/abstract_blast_projectile.gd.uid diff --git a/game/entities/weapons/blast_projectile.tscn b/game/entities/weapons/abstract_blast_projectile.tscn similarity index 79% rename from game/entities/weapons/blast_projectile.tscn rename to game/entities/weapons/abstract_blast_projectile.tscn index f2da00d..0dcef71 100644 --- a/game/entities/weapons/blast_projectile.tscn +++ b/game/entities/weapons/abstract_blast_projectile.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=3 uid="uid://betr5ry5tc75e"] [ext_resource type="PackedScene" uid="uid://ybkqaynvpcjm" path="res://game/entities/weapons/abstract_projectile.tscn" id="1_pd7f6"] -[ext_resource type="Script" uid="uid://bg8yrenh7x03b" path="res://game/entities/weapons/blast_projectile.gd" id="2_5vx6r"] -[ext_resource type="PackedScene" uid="uid://pfvs7wqrnn08" path="res://game/entities/other/blast.tscn" id="3_r3k86"] +[ext_resource type="Script" uid="uid://bg8yrenh7x03b" path="res://game/entities/weapons/abstract_blast_projectile.gd" id="2_5vx6r"] +[ext_resource type="PackedScene" uid="uid://pfvs7wqrnn08" path="res://game/entities/explosions/blast.tscn" id="3_r3k86"] [node name="BlastProjectile" instance=ExtResource("1_pd7f6")] script = ExtResource("2_5vx6r") diff --git a/game/entities/weapons/direct_hit_projectile.gd b/game/entities/weapons/abstract_direct_hit_projectile.gd similarity index 82% rename from game/entities/weapons/direct_hit_projectile.gd rename to game/entities/weapons/abstract_direct_hit_projectile.gd index 9c09d4f..bef9c41 100644 --- a/game/entities/weapons/direct_hit_projectile.gd +++ b/game/entities/weapons/abstract_direct_hit_projectile.gd @@ -1,4 +1,4 @@ -class_name DirectHitProjectile +class_name AbstractDirectHitProjectile extends AbstractProjectile diff --git a/game/entities/weapons/direct_hit_projectile.gd.uid b/game/entities/weapons/abstract_direct_hit_projectile.gd.uid similarity index 100% rename from game/entities/weapons/direct_hit_projectile.gd.uid rename to game/entities/weapons/abstract_direct_hit_projectile.gd.uid diff --git a/game/entities/weapons/direct_hit__projectile.tscn b/game/entities/weapons/abstract_direct_hit_projectile.tscn similarity index 82% rename from game/entities/weapons/direct_hit__projectile.tscn rename to game/entities/weapons/abstract_direct_hit_projectile.tscn index 5db8ce3..d19356d 100644 --- a/game/entities/weapons/direct_hit__projectile.tscn +++ b/game/entities/weapons/abstract_direct_hit_projectile.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://cdv5n4t47hr8i"] [ext_resource type="PackedScene" uid="uid://ybkqaynvpcjm" path="res://game/entities/weapons/abstract_projectile.tscn" id="1_klynw"] -[ext_resource type="Script" uid="uid://blqs7hyu33qhu" path="res://game/entities/weapons/direct_hit_projectile.gd" id="2_0vgnq"] +[ext_resource type="Script" uid="uid://blqs7hyu33qhu" path="res://game/entities/weapons/abstract_direct_hit_projectile.gd" id="2_0vgnq"] [node name="DirectHitProjectile" instance=ExtResource("1_klynw")] script = ExtResource("2_0vgnq") diff --git a/game/entities/weapons/abstract_projectile.gd b/game/entities/weapons/abstract_projectile.gd index e15cbca..2aa567b 100644 --- a/game/entities/weapons/abstract_projectile.gd +++ b/game/entities/weapons/abstract_projectile.gd @@ -9,22 +9,11 @@ const ENEMY_PROJECTILE_LAYER = 16 @export_range(0, 1000) var speed : int = 0 +@export var direction : Vector2 -var direction : Vector2 var ship_velocity: Vector2 -var collide_players: bool: - set(value): - collide_players = value - _apply_collision_mask() - -var collide_enemies: bool: - set(value): - collide_enemies = value - _apply_collision_mask() - - var _velocity: Vector2 @@ -35,34 +24,12 @@ var _velocity: Vector2 func _ready() -> void: _velocity = direction.normalized() * speed + ship_velocity _update_collision_rotation(_velocity) - - _apply_collision_mask() func _physics_process(delta: float) -> void: position += _velocity * delta -func _apply_collision_mask() -> void: - _apply_collision_mask_to_area(self) - - -func _apply_collision_mask_to_area(area: Area2D) -> void: - if collide_players: - area.collision_layer |= ENEMY_PROJECTILE_LAYER - area.collision_mask |= PLAYER_LAYER - else: - area.collision_layer &= ~ENEMY_PROJECTILE_LAYER - area.collision_mask &= ~PLAYER_LAYER - - if collide_enemies: - area.collision_layer |= PLAYER_PROJECTILE_LAYER - area.collision_mask |= ENEMY_LAYER - else: - area.collision_layer &= ~PLAYER_PROJECTILE_LAYER - area.collision_mask &= ~ENEMY_LAYER - - func _update_collision_rotation(velocity: Vector2) -> void: collision.rotation = velocity.angle() - 0.5 * PI @@ -107,16 +74,14 @@ func _get_nearest_foe(filter: Array[AbstractShip] = []) -> AbstractShip: func _get_foes(filter: Array[AbstractShip] = []) -> Array[AbstractShip]: var foes : Array[AbstractShip] = [] - var flags_by_group : Dictionary[String, bool] = { - "enemies": collide_enemies, - "players": collide_players, - } + var groups : Array[String] = [ "enemies", "players" ] - for group in flags_by_group: - if not flags_by_group[group]: continue + for group in groups: var nodes := get_tree().get_nodes_in_group(group) for node in nodes: - if not node in filter: + if not node is AbstractShip: continue + var ship := node as AbstractShip + if collision_mask & ship.collision_layer and not node in filter: foes.append(node) return foes diff --git a/game/entities/weapons/abstract_weapon.gd b/game/entities/weapons/abstract_weapon.gd index 7ed7401..9dade92 100644 --- a/game/entities/weapons/abstract_weapon.gd +++ b/game/entities/weapons/abstract_weapon.gd @@ -2,38 +2,27 @@ class_name AbstractWeapon extends Node2D -enum Belonging { PLAYER, ENEMY } enum Type { NONE, SHORT_RANGE, MEDIUM_RANGE, LONG_RANGE, HOMING, MINES } -const PREFIXES := { - Belonging.PLAYER: "player", - Belonging.ENEMY: "enemy", -} - -const SHOT_POSTFIX = "_shot" -const IDLE_POSTFIX = "_idle" -const RELOAD_POSTFIX = "_reloading" +const IDLE_ANIMATION = "idle" +const SHOT_ANIMATION = "shot" +const RELOAD_ANIMATION = "reloading" @export_range(1, 100) var bullet_per_shot : int = 1 @export_range(0, 360) var sector_angle : int = 0 -@export var Projectile : PackedScene +@export var projectile_scene : PackedScene @export var type := Type.NONE -var _belonging: Belonging var _can_shoot := true @onready var muzzle : Node2D = $Muzzle -func set_belonging(belonging: Belonging) -> void: - _belonging = belonging - - func shoot(ship_velocity: Vector2) -> bool: if not _can_shoot: return false @@ -52,18 +41,10 @@ func _get_projectile_position() -> Vector2: func _create_projectile(ship_velocity: Vector2) -> AbstractProjectile: - var projectile : AbstractProjectile = Projectile.instantiate() + var projectile : AbstractProjectile = projectile_scene.instantiate() projectile.global_position = global_position projectile.ship_velocity = ship_velocity - match _belonging: - Belonging.PLAYER: - projectile.direction = Vector2.RIGHT - projectile.collide_enemies = true - Belonging.ENEMY: - projectile.direction = Vector2.LEFT - projectile.collide_players = true - if sector_angle > 0: var sector_rad := deg_to_rad(sector_angle) var random_angle := randfn(0.0, sector_rad / 6.0) diff --git a/game/entities/weapons/cannon/cannon_projectile.gd b/game/entities/weapons/cannon/abstract_cannon_projectile.gd similarity index 84% rename from game/entities/weapons/cannon/cannon_projectile.gd rename to game/entities/weapons/cannon/abstract_cannon_projectile.gd index 296cc7e..1786611 100644 --- a/game/entities/weapons/cannon/cannon_projectile.gd +++ b/game/entities/weapons/cannon/abstract_cannon_projectile.gd @@ -1,5 +1,5 @@ -class_name CannonProjectile -extends BlastProjectile +class_name AbstractCannonProjectile +extends AbstractBlastProjectile @onready var sprite : Sprite2D = $Sprite2D diff --git a/game/entities/weapons/cannon/cannon_projectile.gd.uid b/game/entities/weapons/cannon/abstract_cannon_projectile.gd.uid similarity index 100% rename from game/entities/weapons/cannon/cannon_projectile.gd.uid rename to game/entities/weapons/cannon/abstract_cannon_projectile.gd.uid diff --git a/game/entities/weapons/cannon/cannon_projectile.tscn b/game/entities/weapons/cannon/abstract_cannon_projectile.tscn similarity index 84% rename from game/entities/weapons/cannon/cannon_projectile.tscn rename to game/entities/weapons/cannon/abstract_cannon_projectile.tscn index f7e2421..71e60c8 100644 --- a/game/entities/weapons/cannon/cannon_projectile.tscn +++ b/game/entities/weapons/cannon/abstract_cannon_projectile.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=11 format=3 uid="uid://cgi7wd84kjnyw"] -[ext_resource type="PackedScene" uid="uid://betr5ry5tc75e" path="res://game/entities/weapons/blast_projectile.tscn" id="1_20qwt"] -[ext_resource type="Script" uid="uid://dfdh0o88as054" path="res://game/entities/weapons/cannon/cannon_projectile.gd" id="2_x3axw"] -[ext_resource type="Script" uid="uid://dftb7hg5f06b5" path="res://game/health_system/damage/explosion_damage.gd" id="3_lb11p"] +[ext_resource type="PackedScene" uid="uid://betr5ry5tc75e" path="res://game/entities/weapons/abstract_blast_projectile.tscn" id="1_20qwt"] +[ext_resource type="Script" uid="uid://dfdh0o88as054" path="res://game/entities/weapons/cannon/abstract_cannon_projectile.gd" id="2_x3axw"] +[ext_resource type="Script" uid="uid://dftb7hg5f06b5" path="res://game/data/damage/explosion_damage.gd" id="3_lb11p"] [ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="4_bb01p"] -[ext_resource type="PackedScene" uid="uid://bhxib2ltpkcbf" path="res://game/entities/other/explosion_particles.tscn" id="5_ugryq"] +[ext_resource type="PackedScene" uid="uid://bhxib2ltpkcbf" path="res://game/entities/explosions/explosion_particles.tscn" id="5_ugryq"] [sub_resource type="AtlasTexture" id="AtlasTexture_ugryq"] atlas = ExtResource("4_bb01p") @@ -33,7 +33,7 @@ gravity = Vector3(0, 0, 0) turbulence_enabled = true turbulence_noise_speed = Vector3(0.1, 0.1, 0.1) -[node name="CannonProjectile" instance=ExtResource("1_20qwt")] +[node name="AbstractCannonProjectile" instance=ExtResource("1_20qwt")] collision_layer = 0 collision_mask = 0 script = ExtResource("2_x3axw") diff --git a/game/entities/weapons/cannon/cannon_weapon.gd b/game/entities/weapons/cannon/abstract_cannon_weapon.gd similarity index 78% rename from game/entities/weapons/cannon/cannon_weapon.gd rename to game/entities/weapons/cannon/abstract_cannon_weapon.gd index f325315..1e1a98b 100644 --- a/game/entities/weapons/cannon/cannon_weapon.gd +++ b/game/entities/weapons/cannon/abstract_cannon_weapon.gd @@ -1,3 +1,4 @@ +class_name AbstractCannonWeapon extends AbstractWeapon @@ -9,16 +10,14 @@ extends AbstractWeapon @onready var cooldown_timer : Timer = $CooldownTimer -func set_belonging(belonging: Belonging) -> void: - super.set_belonging(belonging) - - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) +func _ready() -> void: + sprite.play(IDLE_ANIMATION) func shoot(ship_velocity: Vector2) -> bool: var is_shot := super.shoot(ship_velocity) if is_shot: - sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX) + sprite.play(SHOT_ANIMATION) _can_shoot = false cooldown_timer.start() front_particles.restart() @@ -30,7 +29,7 @@ func shoot(ship_velocity: Vector2) -> bool: func _on_animated_sprite_2d_animation_finished() -> void: - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) + sprite.play(IDLE_ANIMATION) func _on_cooldown_timer_timeout() -> void: diff --git a/game/entities/weapons/cannon/cannon_weapon.gd.uid b/game/entities/weapons/cannon/abstract_cannon_weapon.gd.uid similarity index 100% rename from game/entities/weapons/cannon/cannon_weapon.gd.uid rename to game/entities/weapons/cannon/abstract_cannon_weapon.gd.uid diff --git a/game/entities/weapons/cannon/cannon_weapon.tscn b/game/entities/weapons/cannon/abstract_cannon_weapon.tscn similarity index 51% rename from game/entities/weapons/cannon/cannon_weapon.tscn rename to game/entities/weapons/cannon/abstract_cannon_weapon.tscn index 4ed5b75..398cd20 100644 --- a/game/entities/weapons/cannon/cannon_weapon.tscn +++ b/game/entities/weapons/cannon/abstract_cannon_weapon.tscn @@ -1,15 +1,12 @@ -[gd_scene load_steps=23 format=3 uid="uid://bccaoirwdkp7n"] +[gd_scene load_steps=11 format=3 uid="uid://bccaoirwdkp7n"] [ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_xnbws"] -[ext_resource type="PackedScene" uid="uid://cgi7wd84kjnyw" path="res://game/entities/weapons/cannon/cannon_projectile.tscn" id="2_2bjeu"] -[ext_resource type="Script" uid="uid://db24dm76b1am7" path="res://game/entities/weapons/cannon/cannon_weapon.gd" id="2_ew5um"] +[ext_resource type="Script" uid="uid://db24dm76b1am7" path="res://game/entities/weapons/cannon/abstract_cannon_weapon.gd" id="2_ew5um"] [ext_resource type="Texture2D" uid="uid://b13al44e8ofsx" path="res://particle_textures/flame_large.tres" id="4_i0ica"] [ext_resource type="Texture2D" uid="uid://b2tpy3y2bpuat" path="res://particle_textures/flame_small.tres" id="5_377p4"] [ext_resource type="Texture2D" uid="uid://bi1s5xrnunw3c" path="res://particle_textures/shell_large.tres" id="6_i0ica"] -[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="6_jfd4t"] [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_377p4"] -resource_local_to_scene = true lifetime_randomness = 0.4 particle_flag_disable_z = true angle_min = -179.99998 @@ -21,7 +18,6 @@ initial_velocity_max = 20.0 gravity = Vector3(0, 0, 0) [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_i0ica"] -resource_local_to_scene = true lifetime_randomness = 0.1 particle_flag_disable_z = true emission_shape = 1 @@ -36,7 +32,6 @@ initial_velocity_max = 20.0 gravity = Vector3(0, 0, 0) [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_jfd4t"] -resource_local_to_scene = true lifetime_randomness = 0.1 particle_flag_disable_z = true emission_shape = 1 @@ -50,119 +45,25 @@ initial_velocity_min = 10.0 initial_velocity_max = 20.0 gravity = Vector3(0, 0, 0) -[sub_resource type="AtlasTexture" id="AtlasTexture_jfd4t"] -atlas = ExtResource("6_jfd4t") -region = Rect2(0, 176, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_i0ica"] -atlas = ExtResource("6_jfd4t") -region = Rect2(32, 176, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_377p4"] -atlas = ExtResource("6_jfd4t") -region = Rect2(64, 176, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_nrbut"] -atlas = ExtResource("6_jfd4t") -region = Rect2(96, 176, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_mk6k8"] -atlas = ExtResource("6_jfd4t") -region = Rect2(128, 176, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_fxfcx"] -atlas = ExtResource("6_jfd4t") -region = Rect2(0, 160, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_dvc0n"] -atlas = ExtResource("6_jfd4t") -region = Rect2(32, 160, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_caj01"] -atlas = ExtResource("6_jfd4t") -region = Rect2(64, 160, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_e28g8"] -atlas = ExtResource("6_jfd4t") -region = Rect2(96, 160, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_f7kmj"] -atlas = ExtResource("6_jfd4t") -region = Rect2(128, 160, 32, 16) - -[sub_resource type="SpriteFrames" id="SpriteFrames_kdf62"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_jfd4t") -}], -"loop": true, -"name": &"enemy_idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_i0ica") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_377p4") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_nrbut") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_mk6k8") -}], -"loop": false, -"name": &"enemy_shot", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_fxfcx") -}], -"loop": true, -"name": &"player_idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_dvc0n") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_caj01") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_e28g8") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_f7kmj") -}], -"loop": false, -"name": &"player_shot", -"speed": 10.0 -}] +[sub_resource type="SpriteFrames" id="SpriteFrames_veer3"] [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_nrbut"] -resource_local_to_scene = true particle_flag_disable_z = true inherit_velocity_ratio = 0.5 direction = Vector3(0, 1, 0) -spread = 15.0 +spread = 5.0 initial_velocity_min = 5.0 initial_velocity_max = 15.0 gravity = Vector3(0, 0, 0) -[node name="CannonWeapon" instance=ExtResource("1_xnbws")] +[node name="AbstractCannonWeapon" instance=ExtResource("1_xnbws")] script = ExtResource("2_ew5um") sector_angle = 1 -Projectile = ExtResource("2_2bjeu") type = 3 [node name="ShotParticles" type="Node2D" parent="." index="0"] [node name="Front" type="GPUParticles2D" parent="ShotParticles" index="0"] -position = Vector2(22, 0) emitting = false amount = 32 texture = ExtResource("4_i0ica") @@ -173,7 +74,6 @@ fixed_fps = 10 process_material = SubResource("ParticleProcessMaterial_377p4") [node name="Left" type="GPUParticles2D" parent="ShotParticles" index="1"] -position = Vector2(17, -4) emitting = false texture = ExtResource("5_377p4") lifetime = 0.4 @@ -182,7 +82,6 @@ fixed_fps = 10 process_material = SubResource("ParticleProcessMaterial_i0ica") [node name="Right" type="GPUParticles2D" parent="ShotParticles" index="2"] -position = Vector2(17, 4) emitting = false texture = ExtResource("5_377p4") lifetime = 0.4 @@ -191,18 +90,14 @@ fixed_fps = 10 process_material = SubResource("ParticleProcessMaterial_jfd4t") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"] -position = Vector2(9, 0) -sprite_frames = SubResource("SpriteFrames_kdf62") -animation = &"player_idle" +sprite_frames = SubResource("SpriteFrames_veer3") [node name="ShellParticles" type="GPUParticles2D" parent="." index="2"] z_index = 1 -position = Vector2(-1, 1) emitting = false amount = 5 texture = ExtResource("6_i0ica") lifetime = 3.0 -one_shot = true fixed_fps = 10 process_material = SubResource("ParticleProcessMaterial_nrbut") @@ -210,8 +105,5 @@ process_material = SubResource("ParticleProcessMaterial_nrbut") wait_time = 1.2 one_shot = true -[node name="Muzzle" parent="." index="4"] -position = Vector2(20, 0) - [connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] [connection signal="timeout" from="CooldownTimer" to="." method="_on_cooldown_timer_timeout"] diff --git a/game/entities/weapons/cannon/cannon_data.tres b/game/entities/weapons/cannon/cannon_data.tres deleted file mode 100644 index 5fe6878..0000000 --- a/game/entities/weapons/cannon/cannon_data.tres +++ /dev/null @@ -1,16 +0,0 @@ -[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://dxap3sahurth4"] - -[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_c34y3"] -[ext_resource type="PackedScene" uid="uid://bccaoirwdkp7n" path="res://game/entities/weapons/cannon/cannon_weapon.tscn" id="3_2dgua"] - -[resource] -script = ExtResource("1_c34y3") -id = "cannon" -name = "Cannon" -group = "explosion" -description = "High damage (explosion) -Low firerate -Moderate velocity -High explosion radius" -scene = ExtResource("3_2dgua") -metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/entities/weapons/cannon/enemy_cannon_projectile.gd b/game/entities/weapons/cannon/enemy_cannon_projectile.gd new file mode 100644 index 0000000..265f991 --- /dev/null +++ b/game/entities/weapons/cannon/enemy_cannon_projectile.gd @@ -0,0 +1,2 @@ +class_name EnemyCannonProjectile +extends AbstractCannonProjectile diff --git a/game/entities/weapons/cannon/enemy_cannon_projectile.gd.uid b/game/entities/weapons/cannon/enemy_cannon_projectile.gd.uid new file mode 100644 index 0000000..1b5c528 --- /dev/null +++ b/game/entities/weapons/cannon/enemy_cannon_projectile.gd.uid @@ -0,0 +1 @@ +uid://crm02yyh6rcu6 diff --git a/game/entities/weapons/cannon/enemy_cannon_projectile.tscn b/game/entities/weapons/cannon/enemy_cannon_projectile.tscn new file mode 100644 index 0000000..bb92b48 --- /dev/null +++ b/game/entities/weapons/cannon/enemy_cannon_projectile.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=3 uid="uid://c78rvwvr3dg5l"] + +[ext_resource type="PackedScene" uid="uid://cgi7wd84kjnyw" path="res://game/entities/weapons/cannon/abstract_cannon_projectile.tscn" id="1_ksga8"] +[ext_resource type="Script" uid="uid://crm02yyh6rcu6" path="res://game/entities/weapons/cannon/enemy_cannon_projectile.gd" id="2_3s0hn"] + +[node name="EnemyCannonProjectile" instance=ExtResource("1_ksga8")] +collision_layer = 16 +collision_mask = 2 +script = ExtResource("2_3s0hn") +direction = Vector2(-1, 0) + +[node name="Blast" parent="." index="3"] +collision_layer = 16 +collision_mask = 2 diff --git a/game/entities/weapons/cannon/enemy_cannon_weapon.gd b/game/entities/weapons/cannon/enemy_cannon_weapon.gd new file mode 100644 index 0000000..f809d2e --- /dev/null +++ b/game/entities/weapons/cannon/enemy_cannon_weapon.gd @@ -0,0 +1,2 @@ +class_name EnemyCannonWeapon +extends AbstractCannonWeapon diff --git a/game/entities/weapons/cannon/enemy_cannon_weapon.gd.uid b/game/entities/weapons/cannon/enemy_cannon_weapon.gd.uid new file mode 100644 index 0000000..edd95e9 --- /dev/null +++ b/game/entities/weapons/cannon/enemy_cannon_weapon.gd.uid @@ -0,0 +1 @@ +uid://ctyvmasefboee diff --git a/game/entities/weapons/cannon/enemy_cannon_weapon.tscn b/game/entities/weapons/cannon/enemy_cannon_weapon.tscn new file mode 100644 index 0000000..65585ba --- /dev/null +++ b/game/entities/weapons/cannon/enemy_cannon_weapon.tscn @@ -0,0 +1,131 @@ +[gd_scene load_steps=15 format=3 uid="uid://d3co2xx0th1d0"] + +[ext_resource type="PackedScene" uid="uid://bccaoirwdkp7n" path="res://game/entities/weapons/cannon/abstract_cannon_weapon.tscn" id="1_pc5pg"] +[ext_resource type="Script" uid="uid://ctyvmasefboee" path="res://game/entities/weapons/cannon/enemy_cannon_weapon.gd" id="2_1qc5g"] +[ext_resource type="PackedScene" uid="uid://c78rvwvr3dg5l" path="res://game/entities/weapons/cannon/enemy_cannon_projectile.tscn" id="2_6eedr"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="3_tvj1r"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_tvj1r"] +lifetime_randomness = 0.4 +particle_flag_disable_z = true +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.2 +direction = Vector3(-1, 0, 0) +spread = 30.0 +initial_velocity_min = 10.0 +initial_velocity_max = 20.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_1qc5g"] +lifetime_randomness = 0.1 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 2.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.2 +direction = Vector3(1, 1, 0) +spread = 5.0 +initial_velocity_min = 10.0 +initial_velocity_max = 20.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_2rup0"] +lifetime_randomness = 0.1 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 2.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.2 +direction = Vector3(1, -1, 0) +spread = 5.0 +initial_velocity_min = 10.0 +initial_velocity_max = 20.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jfd4t"] +atlas = ExtResource("3_tvj1r") +region = Rect2(0, 176, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i0ica"] +atlas = ExtResource("3_tvj1r") +region = Rect2(32, 176, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_377p4"] +atlas = ExtResource("3_tvj1r") +region = Rect2(64, 176, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nrbut"] +atlas = ExtResource("3_tvj1r") +region = Rect2(96, 176, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mk6k8"] +atlas = ExtResource("3_tvj1r") +region = Rect2(128, 176, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_1qc5g"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_jfd4t") +}], +"loop": true, +"name": &"idle", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_i0ica") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_377p4") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_nrbut") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mk6k8") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_vumep"] +particle_flag_disable_z = true +inherit_velocity_ratio = 0.5 +direction = Vector3(0, -1, 0) +spread = 5.0 +initial_velocity_min = 5.0 +initial_velocity_max = 15.0 +gravity = Vector3(0, 0, 0) + +[node name="EnemyCannonWeapon" instance=ExtResource("1_pc5pg")] +script = ExtResource("2_1qc5g") +projectile_scene = ExtResource("2_6eedr") + +[node name="Front" parent="ShotParticles" index="0"] +position = Vector2(-22, 0) +process_material = SubResource("ParticleProcessMaterial_tvj1r") + +[node name="Left" parent="ShotParticles" index="1"] +position = Vector2(-17, 4) +process_material = SubResource("ParticleProcessMaterial_1qc5g") + +[node name="Right" parent="ShotParticles" index="2"] +position = Vector2(-17, -4) +process_material = SubResource("ParticleProcessMaterial_2rup0") + +[node name="AnimatedSprite2D" parent="." index="1"] +position = Vector2(-9, 0) +sprite_frames = SubResource("SpriteFrames_1qc5g") +animation = &"idle" + +[node name="ShellParticles" parent="." index="2"] +position = Vector2(1, -1) +process_material = SubResource("ParticleProcessMaterial_vumep") + +[node name="Muzzle" parent="." index="4"] +position = Vector2(-20, 0) diff --git a/game/entities/weapons/cannon/player_cannon_projectile.gd b/game/entities/weapons/cannon/player_cannon_projectile.gd new file mode 100644 index 0000000..1ece239 --- /dev/null +++ b/game/entities/weapons/cannon/player_cannon_projectile.gd @@ -0,0 +1,2 @@ +class_name PlayerCannonProjectile +extends AbstractCannonProjectile diff --git a/game/entities/weapons/cannon/player_cannon_projectile.gd.uid b/game/entities/weapons/cannon/player_cannon_projectile.gd.uid new file mode 100644 index 0000000..3091024 --- /dev/null +++ b/game/entities/weapons/cannon/player_cannon_projectile.gd.uid @@ -0,0 +1 @@ +uid://82w6uhu0q7su diff --git a/game/entities/weapons/cannon/player_cannon_projectile.tscn b/game/entities/weapons/cannon/player_cannon_projectile.tscn new file mode 100644 index 0000000..e51979d --- /dev/null +++ b/game/entities/weapons/cannon/player_cannon_projectile.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=3 uid="uid://bswe1h1qw7e4x"] + +[ext_resource type="PackedScene" uid="uid://cgi7wd84kjnyw" path="res://game/entities/weapons/cannon/abstract_cannon_projectile.tscn" id="1_66byq"] +[ext_resource type="Script" uid="uid://82w6uhu0q7su" path="res://game/entities/weapons/cannon/player_cannon_projectile.gd" id="2_oftvl"] + +[node name="PlayerCannonProjectile" instance=ExtResource("1_66byq")] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("2_oftvl") +direction = Vector2(1, 0) + +[node name="Blast" parent="." index="3"] +collision_layer = 8 +collision_mask = 4 diff --git a/game/entities/weapons/cannon/player_cannon_weapon.gd b/game/entities/weapons/cannon/player_cannon_weapon.gd new file mode 100644 index 0000000..cefc2a7 --- /dev/null +++ b/game/entities/weapons/cannon/player_cannon_weapon.gd @@ -0,0 +1,2 @@ +class_name PlayerCannonWeapon +extends AbstractCannonWeapon diff --git a/game/entities/weapons/cannon/player_cannon_weapon.gd.uid b/game/entities/weapons/cannon/player_cannon_weapon.gd.uid new file mode 100644 index 0000000..0cfcd54 --- /dev/null +++ b/game/entities/weapons/cannon/player_cannon_weapon.gd.uid @@ -0,0 +1 @@ +uid://bvnecmmrk5e47 diff --git a/game/entities/weapons/cannon/player_cannon_weapon.tscn b/game/entities/weapons/cannon/player_cannon_weapon.tscn new file mode 100644 index 0000000..5238cc4 --- /dev/null +++ b/game/entities/weapons/cannon/player_cannon_weapon.tscn @@ -0,0 +1,130 @@ +[gd_scene load_steps=15 format=3 uid="uid://mpr5kl87nx3f"] + +[ext_resource type="PackedScene" uid="uid://bccaoirwdkp7n" path="res://game/entities/weapons/cannon/abstract_cannon_weapon.tscn" id="1_5v7nv"] +[ext_resource type="PackedScene" uid="uid://bswe1h1qw7e4x" path="res://game/entities/weapons/cannon/player_cannon_projectile.tscn" id="2_bgyjp"] +[ext_resource type="Script" uid="uid://bvnecmmrk5e47" path="res://game/entities/weapons/cannon/player_cannon_weapon.gd" id="2_kkp2r"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_myt65"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_bgyjp"] +lifetime_randomness = 0.4 +particle_flag_disable_z = true +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.2 +spread = 30.0 +initial_velocity_min = 10.0 +initial_velocity_max = 20.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_kkp2r"] +lifetime_randomness = 0.1 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 2.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.2 +direction = Vector3(-1, -1, 0) +spread = 5.0 +initial_velocity_min = 10.0 +initial_velocity_max = 20.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_myt65"] +lifetime_randomness = 0.1 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 2.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.2 +direction = Vector3(-1, 1, 0) +spread = 5.0 +initial_velocity_min = 10.0 +initial_velocity_max = 20.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="AtlasTexture" id="AtlasTexture_byluv"] +atlas = ExtResource("4_myt65") +region = Rect2(0, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_myt65"] +atlas = ExtResource("4_myt65") +region = Rect2(32, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_o2qwc"] +atlas = ExtResource("4_myt65") +region = Rect2(64, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_faaxs"] +atlas = ExtResource("4_myt65") +region = Rect2(96, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_lhw8s"] +atlas = ExtResource("4_myt65") +region = Rect2(128, 160, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_irdfq"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_byluv") +}], +"loop": true, +"name": &"idle", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_myt65") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_o2qwc") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_faaxs") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_lhw8s") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_5v7nv"] +particle_flag_disable_z = true +inherit_velocity_ratio = 0.5 +direction = Vector3(0, 1, 0) +spread = 5.0 +initial_velocity_min = 5.0 +initial_velocity_max = 15.0 +gravity = Vector3(0, 0, 0) + +[node name="PlayerCannonWeapon" instance=ExtResource("1_5v7nv")] +script = ExtResource("2_kkp2r") +projectile_scene = ExtResource("2_bgyjp") + +[node name="Front" parent="ShotParticles" index="0"] +position = Vector2(20, 0) +process_material = SubResource("ParticleProcessMaterial_bgyjp") + +[node name="Left" parent="ShotParticles" index="1"] +position = Vector2(15, -4) +process_material = SubResource("ParticleProcessMaterial_kkp2r") + +[node name="Right" parent="ShotParticles" index="2"] +position = Vector2(15, 4) +process_material = SubResource("ParticleProcessMaterial_myt65") + +[node name="AnimatedSprite2D" parent="." index="1"] +position = Vector2(9, 0) +sprite_frames = SubResource("SpriteFrames_irdfq") +animation = &"shot" + +[node name="ShellParticles" parent="." index="2"] +position = Vector2(-1, 1) +process_material = SubResource("ParticleProcessMaterial_5v7nv") + +[node name="Muzzle" parent="." index="4"] +position = Vector2(18, 0) diff --git a/game/entities/weapons/gatling/abstract_gatling_projectile.gd b/game/entities/weapons/gatling/abstract_gatling_projectile.gd new file mode 100644 index 0000000..4c986f6 --- /dev/null +++ b/game/entities/weapons/gatling/abstract_gatling_projectile.gd @@ -0,0 +1,2 @@ +class_name AbstractGatlingProjectile +extends AbstractDirectHitProjectile diff --git a/game/entities/weapons/gatling/gatling_projectile.gd.uid b/game/entities/weapons/gatling/abstract_gatling_projectile.gd.uid similarity index 100% rename from game/entities/weapons/gatling/gatling_projectile.gd.uid rename to game/entities/weapons/gatling/abstract_gatling_projectile.gd.uid diff --git a/game/entities/weapons/gatling/gatling_projectile.tscn b/game/entities/weapons/gatling/abstract_gatling_projectile.tscn similarity index 78% rename from game/entities/weapons/gatling/gatling_projectile.tscn rename to game/entities/weapons/gatling/abstract_gatling_projectile.tscn index 75ffddb..4a341e0 100644 --- a/game/entities/weapons/gatling/gatling_projectile.tscn +++ b/game/entities/weapons/gatling/abstract_gatling_projectile.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=8 format=3 uid="uid://yfvluap3uy1r"] -[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/direct_hit__projectile.tscn" id="1_3tgt7"] -[ext_resource type="Script" uid="uid://rtsf1n0djorp" path="res://game/entities/weapons/gatling/gatling_projectile.gd" id="2_hbgoq"] -[ext_resource type="Script" uid="uid://bhqvk5cnjg5mv" path="res://game/health_system/damage/kinetic_damage.gd" id="3_2tbeq"] +[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/abstract_direct_hit_projectile.tscn" id="1_3tgt7"] +[ext_resource type="Script" uid="uid://rtsf1n0djorp" path="res://game/entities/weapons/gatling/abstract_gatling_projectile.gd" id="2_hbgoq"] +[ext_resource type="Script" uid="uid://bhqvk5cnjg5mv" path="res://game/data/damage/kinetic_damage.gd" id="3_2tbeq"] [ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="4_ndegg"] [sub_resource type="Resource" id="Resource_ndegg"] @@ -17,13 +17,12 @@ region = Rect2(0, 0, 16, 16) [sub_resource type="CircleShape2D" id="CircleShape2D_2tbeq"] radius = 1.0 -[node name="GatlingProjectile" instance=ExtResource("1_3tgt7")] +[node name="AbstractGatlingProjectile" instance=ExtResource("1_3tgt7")] collision_layer = 0 collision_mask = 0 script = ExtResource("2_hbgoq") damage = SubResource("Resource_ndegg") speed = 600 -piercing = 1 [node name="Sprite2D" type="Sprite2D" parent="." index="0"] texture = SubResource("AtlasTexture_11x32") diff --git a/game/entities/weapons/gatling/gatling_weapon.gd b/game/entities/weapons/gatling/abstract_gatling_weapon.gd similarity index 74% rename from game/entities/weapons/gatling/gatling_weapon.gd rename to game/entities/weapons/gatling/abstract_gatling_weapon.gd index ac9a598..5ffc654 100644 --- a/game/entities/weapons/gatling/gatling_weapon.gd +++ b/game/entities/weapons/gatling/abstract_gatling_weapon.gd @@ -1,3 +1,4 @@ +class_name AbstractGatlingWeapon extends AbstractWeapon @@ -6,17 +7,15 @@ extends AbstractWeapon @onready var shell_particles : GPUParticles2D = $ShellParticles -func set_belonging(belonging: Belonging) -> void: - super.set_belonging(belonging) - - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) +func _ready() -> void: + sprite.play(IDLE_ANIMATION) func shoot(ship_velocity: Vector2) -> bool: var is_shot := super.shoot(ship_velocity) if is_shot: _can_shoot = false - sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX) + sprite.play(SHOT_ANIMATION) shot_particles.restart() shell_particles.emit_particle(Transform2D(), Vector2(), Color(), Color(), 0) @@ -25,3 +24,4 @@ func shoot(ship_velocity: Vector2) -> bool: func _on_animated_sprite_2d_animation_finished() -> void: _can_shoot = true + sprite.play(IDLE_ANIMATION) diff --git a/game/entities/weapons/gatling/gatling_weapon.gd.uid b/game/entities/weapons/gatling/abstract_gatling_weapon.gd.uid similarity index 100% rename from game/entities/weapons/gatling/gatling_weapon.gd.uid rename to game/entities/weapons/gatling/abstract_gatling_weapon.gd.uid diff --git a/game/entities/weapons/gatling/abstract_gatling_weapon.tscn b/game/entities/weapons/gatling/abstract_gatling_weapon.tscn new file mode 100644 index 0000000..a0316d5 --- /dev/null +++ b/game/entities/weapons/gatling/abstract_gatling_weapon.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=8 format=3 uid="uid://c4mlppn5i55bp"] + +[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_5wvix"] +[ext_resource type="Script" uid="uid://c1bsvmj7xhnxe" path="res://game/entities/weapons/gatling/abstract_gatling_weapon.gd" id="2_no4ra"] +[ext_resource type="Texture2D" uid="uid://b2tpy3y2bpuat" path="res://particle_textures/flame_small.tres" id="3_pm5f5"] +[ext_resource type="Texture2D" uid="uid://bib4q76bmnajw" path="res://particle_textures/shell_small.tres" id="5_17k52"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_v064d"] +particle_flag_disable_z = true +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +initial_velocity_min = 5.0 +initial_velocity_max = 25.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="SpriteFrames" id="SpriteFrames_qqle0"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_pjn33"] +resource_local_to_scene = true +particle_flag_disable_z = true +inherit_velocity_ratio = 0.5 +direction = Vector3(0, -1, 0) +spread = 15.0 +initial_velocity_min = 5.0 +initial_velocity_max = 15.0 +gravity = Vector3(0, 0, 0) + +[node name="AbstractGatlingWeapon" instance=ExtResource("1_5wvix")] +script = ExtResource("2_no4ra") +sector_angle = 5 +type = 1 + +[node name="ShotParticles" type="GPUParticles2D" parent="." index="0"] +emitting = false +texture = ExtResource("3_pm5f5") +lifetime = 0.1 +one_shot = true +process_material = SubResource("ParticleProcessMaterial_v064d") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"] +sprite_frames = SubResource("SpriteFrames_qqle0") + +[node name="ShellParticles" type="GPUParticles2D" parent="." index="2"] +z_index = 1 +emitting = false +amount = 20 +texture = ExtResource("5_17k52") +lifetime = 3.0 +one_shot = true +fixed_fps = 10 +process_material = SubResource("ParticleProcessMaterial_pjn33") + +[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] diff --git a/game/entities/weapons/gatling/enemy_gatling_projectile.gd b/game/entities/weapons/gatling/enemy_gatling_projectile.gd new file mode 100644 index 0000000..862dd4e --- /dev/null +++ b/game/entities/weapons/gatling/enemy_gatling_projectile.gd @@ -0,0 +1,2 @@ +class_name EnemyGatlingProjectile +extends AbstractGatlingProjectile diff --git a/game/entities/weapons/gatling/enemy_gatling_projectile.gd.uid b/game/entities/weapons/gatling/enemy_gatling_projectile.gd.uid new file mode 100644 index 0000000..8fe0df0 --- /dev/null +++ b/game/entities/weapons/gatling/enemy_gatling_projectile.gd.uid @@ -0,0 +1 @@ +uid://b63edlkleako8 diff --git a/game/entities/weapons/gatling/enemy_gatling_projectile.tscn b/game/entities/weapons/gatling/enemy_gatling_projectile.tscn new file mode 100644 index 0000000..def0f7d --- /dev/null +++ b/game/entities/weapons/gatling/enemy_gatling_projectile.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://b5qcmktgysdw6"] + +[ext_resource type="PackedScene" uid="uid://yfvluap3uy1r" path="res://game/entities/weapons/gatling/abstract_gatling_projectile.tscn" id="1_qxjms"] +[ext_resource type="Script" uid="uid://b63edlkleako8" path="res://game/entities/weapons/gatling/enemy_gatling_projectile.gd" id="2_uhyou"] + +[node name="EnemyGatlingProjectile" instance=ExtResource("1_qxjms")] +collision_layer = 16 +collision_mask = 2 +script = ExtResource("2_uhyou") +direction = Vector2(-1, 0) diff --git a/game/entities/weapons/gatling/enemy_gatling_weapon.gd b/game/entities/weapons/gatling/enemy_gatling_weapon.gd new file mode 100644 index 0000000..5be5eb5 --- /dev/null +++ b/game/entities/weapons/gatling/enemy_gatling_weapon.gd @@ -0,0 +1,2 @@ +class_name EnemyGatlingWeapon +extends AbstractGatlingWeapon diff --git a/game/entities/weapons/gatling/enemy_gatling_weapon.gd.uid b/game/entities/weapons/gatling/enemy_gatling_weapon.gd.uid new file mode 100644 index 0000000..7958bfe --- /dev/null +++ b/game/entities/weapons/gatling/enemy_gatling_weapon.gd.uid @@ -0,0 +1 @@ +uid://bj6mviyrgggty diff --git a/game/entities/weapons/gatling/enemy_gatling_weapon.tscn b/game/entities/weapons/gatling/enemy_gatling_weapon.tscn new file mode 100644 index 0000000..f7b821f --- /dev/null +++ b/game/entities/weapons/gatling/enemy_gatling_weapon.tscn @@ -0,0 +1,86 @@ +[gd_scene load_steps=12 format=3 uid="uid://b0ajhllwm5qux"] + +[ext_resource type="PackedScene" uid="uid://c4mlppn5i55bp" path="res://game/entities/weapons/gatling/abstract_gatling_weapon.tscn" id="1_dil8o"] +[ext_resource type="Script" uid="uid://bj6mviyrgggty" path="res://game/entities/weapons/gatling/enemy_gatling_weapon.gd" id="2_v0vlv"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="3_2opsk"] +[ext_resource type="PackedScene" uid="uid://b5qcmktgysdw6" path="res://game/entities/weapons/gatling/enemy_gatling_projectile.tscn" id="3_nk3h5"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_2opsk"] +particle_flag_disable_z = true +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +initial_velocity_min = 5.0 +initial_velocity_max = 25.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ydc6p"] +atlas = ExtResource("3_2opsk") +region = Rect2(160, 176, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pjn33"] +atlas = ExtResource("3_2opsk") +region = Rect2(192, 176, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kkima"] +atlas = ExtResource("3_2opsk") +region = Rect2(224, 176, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i25po"] +atlas = ExtResource("3_2opsk") +region = Rect2(160, 176, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_nk3h5"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_ydc6p") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_pjn33") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_kkima") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_i25po") +}], +"loop": false, +"name": &"shot", +"speed": 30.0 +}] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_cxn0h"] +resource_local_to_scene = true +particle_flag_disable_z = true +inherit_velocity_ratio = 0.5 +direction = Vector3(0, -1, 0) +spread = 5.0 +initial_velocity_min = 5.0 +initial_velocity_max = 15.0 +gravity = Vector3(0, 0, 0) + +[node name="EnemyGatlingWeapon" instance=ExtResource("1_dil8o")] +script = ExtResource("2_v0vlv") +projectile_scene = ExtResource("3_nk3h5") + +[node name="ShotParticles" parent="." index="0"] +position = Vector2(-17, 0) +process_material = SubResource("ParticleProcessMaterial_2opsk") + +[node name="AnimatedSprite2D" parent="." index="1"] +position = Vector2(-6, 0) +sprite_frames = SubResource("SpriteFrames_nk3h5") +animation = &"shot" + +[node name="ShellParticles" parent="." index="2"] +position = Vector2(0, 1) +process_material = SubResource("ParticleProcessMaterial_cxn0h") + +[node name="Muzzle" parent="." index="3"] +position = Vector2(-15, 0) diff --git a/game/entities/weapons/gatling/gatling_data.tres b/game/entities/weapons/gatling/gatling_data.tres deleted file mode 100644 index c6c7533..0000000 --- a/game/entities/weapons/gatling/gatling_data.tres +++ /dev/null @@ -1,15 +0,0 @@ -[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://djelo5gu3ybuf"] - -[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_bt4k8"] -[ext_resource type="PackedScene" uid="uid://c4mlppn5i55bp" path="res://game/entities/weapons/gatling/gatling_weapon.tscn" id="3_2rwg6"] - -[resource] -script = ExtResource("1_bt4k8") -id = "gatling" -name = "Gatling" -group = "kinetic" -description = "Low damage (kinetic) -High firerate -Moderate velocity" -scene = ExtResource("3_2rwg6") -metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/entities/weapons/gatling/gatling_projectile.gd b/game/entities/weapons/gatling/gatling_projectile.gd deleted file mode 100644 index 58f4a72..0000000 --- a/game/entities/weapons/gatling/gatling_projectile.gd +++ /dev/null @@ -1,2 +0,0 @@ -class_name GatlingProjectile -extends DirectHitProjectile diff --git a/game/entities/weapons/gatling/gatling_weapon.tscn b/game/entities/weapons/gatling/gatling_weapon.tscn deleted file mode 100644 index 06dcac8..0000000 --- a/game/entities/weapons/gatling/gatling_weapon.tscn +++ /dev/null @@ -1,142 +0,0 @@ -[gd_scene load_steps=18 format=3 uid="uid://c4mlppn5i55bp"] - -[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_gblx7"] -[ext_resource type="Script" uid="uid://c1bsvmj7xhnxe" path="res://game/entities/weapons/gatling/gatling_weapon.gd" id="1_kg6du"] -[ext_resource type="PackedScene" uid="uid://yfvluap3uy1r" path="res://game/entities/weapons/gatling/gatling_projectile.tscn" id="2_ylc0n"] -[ext_resource type="Texture2D" uid="uid://b2tpy3y2bpuat" path="res://particle_textures/flame_small.tres" id="4_ydc6p"] -[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="5_ydc6p"] -[ext_resource type="Texture2D" uid="uid://bib4q76bmnajw" path="res://particle_textures/shell_small.tres" id="6_v064d"] - -[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_v064d"] -particle_flag_disable_z = true -angle_min = -179.99998 -angle_max = 180.00002 -inherit_velocity_ratio = 0.5 -initial_velocity_min = 5.0 -initial_velocity_max = 25.0 -gravity = Vector3(0, 0, 0) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ydc6p"] -atlas = ExtResource("5_ydc6p") -region = Rect2(160, 176, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_pjn33"] -atlas = ExtResource("5_ydc6p") -region = Rect2(192, 176, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_kkima"] -atlas = ExtResource("5_ydc6p") -region = Rect2(224, 176, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_i25po"] -atlas = ExtResource("5_ydc6p") -region = Rect2(160, 176, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_v064d"] -atlas = ExtResource("5_ydc6p") -region = Rect2(160, 160, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_pm1cd"] -atlas = ExtResource("5_ydc6p") -region = Rect2(192, 160, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_t1uk2"] -atlas = ExtResource("5_ydc6p") -region = Rect2(224, 160, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_colwf"] -atlas = ExtResource("5_ydc6p") -region = Rect2(160, 160, 32, 16) - -[sub_resource type="SpriteFrames" id="SpriteFrames_pjn33"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_ydc6p") -}], -"loop": true, -"name": &"enemy_idle", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_pjn33") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_kkima") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_i25po") -}], -"loop": false, -"name": &"enemy_shot", -"speed": 30.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_v064d") -}], -"loop": true, -"name": &"player_idle", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_pm1cd") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_t1uk2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_colwf") -}], -"loop": false, -"name": &"player_shot", -"speed": 30.0 -}] - -[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_pjn33"] -resource_local_to_scene = true -particle_flag_disable_z = true -inherit_velocity_ratio = 0.5 -direction = Vector3(0, -1, 0) -spread = 15.0 -initial_velocity_min = 5.0 -initial_velocity_max = 15.0 -gravity = Vector3(0, 0, 0) - -[node name="GatlingWeapon" instance=ExtResource("1_gblx7")] -script = ExtResource("1_kg6du") -sector_angle = 5 -Projectile = ExtResource("2_ylc0n") -type = 1 - -[node name="ShotParticles" type="GPUParticles2D" parent="." index="0"] -position = Vector2(17, 0) -emitting = false -amount = 32 -texture = ExtResource("4_ydc6p") -lifetime = 0.1 -one_shot = true -process_material = SubResource("ParticleProcessMaterial_v064d") - -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"] -position = Vector2(6, 0) -sprite_frames = SubResource("SpriteFrames_pjn33") -animation = &"player_shot" - -[node name="ShellParticles" type="GPUParticles2D" parent="." index="2"] -z_index = 1 -position = Vector2(0, -1) -emitting = false -amount = 20 -texture = ExtResource("6_v064d") -lifetime = 3.0 -one_shot = true -fixed_fps = 10 -process_material = SubResource("ParticleProcessMaterial_pjn33") - -[node name="Muzzle" parent="." index="3"] -position = Vector2(14, 0) - -[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] diff --git a/game/entities/weapons/gatling/player_gatling_projectile.gd b/game/entities/weapons/gatling/player_gatling_projectile.gd new file mode 100644 index 0000000..6afe744 --- /dev/null +++ b/game/entities/weapons/gatling/player_gatling_projectile.gd @@ -0,0 +1,2 @@ +class_name PlayerGatlingProjectile +extends AbstractGatlingProjectile diff --git a/game/entities/weapons/gatling/player_gatling_projectile.gd.uid b/game/entities/weapons/gatling/player_gatling_projectile.gd.uid new file mode 100644 index 0000000..14ccdaa --- /dev/null +++ b/game/entities/weapons/gatling/player_gatling_projectile.gd.uid @@ -0,0 +1 @@ +uid://b8nunmccyxmkr diff --git a/game/entities/weapons/gatling/player_gatling_projectile.tscn b/game/entities/weapons/gatling/player_gatling_projectile.tscn new file mode 100644 index 0000000..6317b79 --- /dev/null +++ b/game/entities/weapons/gatling/player_gatling_projectile.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://c0dh3x5olsjtd"] + +[ext_resource type="PackedScene" uid="uid://yfvluap3uy1r" path="res://game/entities/weapons/gatling/abstract_gatling_projectile.tscn" id="1_71wkj"] +[ext_resource type="Script" uid="uid://b8nunmccyxmkr" path="res://game/entities/weapons/gatling/player_gatling_projectile.gd" id="2_5ur67"] + +[node name="PlayerGatlingProjectile" instance=ExtResource("1_71wkj")] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("2_5ur67") +direction = Vector2(1, 0) diff --git a/game/entities/weapons/gatling/player_gatling_weapon.gd b/game/entities/weapons/gatling/player_gatling_weapon.gd new file mode 100644 index 0000000..5d0c8c7 --- /dev/null +++ b/game/entities/weapons/gatling/player_gatling_weapon.gd @@ -0,0 +1,2 @@ +class_name PlayerGatlingWeapon +extends AbstractGatlingWeapon diff --git a/game/entities/weapons/gatling/player_gatling_weapon.gd.uid b/game/entities/weapons/gatling/player_gatling_weapon.gd.uid new file mode 100644 index 0000000..3597c2b --- /dev/null +++ b/game/entities/weapons/gatling/player_gatling_weapon.gd.uid @@ -0,0 +1 @@ +uid://622qtvleceha diff --git a/game/entities/weapons/gatling/player_gatling_weapon.tscn b/game/entities/weapons/gatling/player_gatling_weapon.tscn new file mode 100644 index 0000000..95b1244 --- /dev/null +++ b/game/entities/weapons/gatling/player_gatling_weapon.tscn @@ -0,0 +1,86 @@ +[gd_scene load_steps=12 format=3 uid="uid://ca2cjffcrfxkq"] + +[ext_resource type="PackedScene" uid="uid://c4mlppn5i55bp" path="res://game/entities/weapons/gatling/abstract_gatling_weapon.tscn" id="1_y0rod"] +[ext_resource type="Script" uid="uid://622qtvleceha" path="res://game/entities/weapons/gatling/player_gatling_weapon.gd" id="2_5q7qs"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="3_5q7qs"] +[ext_resource type="PackedScene" uid="uid://c0dh3x5olsjtd" path="res://game/entities/weapons/gatling/player_gatling_projectile.tscn" id="3_gqtte"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_gqtte"] +particle_flag_disable_z = true +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +initial_velocity_min = 5.0 +initial_velocity_max = 25.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="AtlasTexture" id="AtlasTexture_v064d"] +atlas = ExtResource("3_5q7qs") +region = Rect2(160, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pm1cd"] +atlas = ExtResource("3_5q7qs") +region = Rect2(192, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_t1uk2"] +atlas = ExtResource("3_5q7qs") +region = Rect2(224, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_colwf"] +atlas = ExtResource("3_5q7qs") +region = Rect2(160, 160, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_34dp1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_v064d") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_pm1cd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_t1uk2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_colwf") +}], +"loop": false, +"name": &"shot", +"speed": 30.0 +}] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_5smu4"] +resource_local_to_scene = true +particle_flag_disable_z = true +inherit_velocity_ratio = 0.5 +direction = Vector3(0, -1, 0) +spread = 5.0 +initial_velocity_min = 5.0 +initial_velocity_max = 15.0 +gravity = Vector3(0, 0, 0) + +[node name="PlayerGatlingWeapon" instance=ExtResource("1_y0rod")] +script = ExtResource("2_5q7qs") +projectile_scene = ExtResource("3_gqtte") + +[node name="ShotParticles" parent="." index="0"] +position = Vector2(17, 0) +process_material = SubResource("ParticleProcessMaterial_gqtte") + +[node name="AnimatedSprite2D" parent="." index="1"] +position = Vector2(6, 0) +sprite_frames = SubResource("SpriteFrames_34dp1") +animation = &"shot" + +[node name="ShellParticles" parent="." index="2"] +position = Vector2(0, -1) +process_material = SubResource("ParticleProcessMaterial_5smu4") + +[node name="Muzzle" parent="." index="3"] +position = Vector2(15, 0) diff --git a/game/entities/weapons/laser/laser_projectile.gd b/game/entities/weapons/laser/abstract_laser_projectile.gd similarity index 84% rename from game/entities/weapons/laser/laser_projectile.gd rename to game/entities/weapons/laser/abstract_laser_projectile.gd index 05450b6..e9f9446 100644 --- a/game/entities/weapons/laser/laser_projectile.gd +++ b/game/entities/weapons/laser/abstract_laser_projectile.gd @@ -1,5 +1,5 @@ -class_name LaserProjectile -extends DirectHitProjectile +class_name AbstractLaserProjectile +extends AbstractDirectHitProjectile @onready var particles : GPUParticles2D = $GPUParticles2D diff --git a/game/entities/weapons/laser/laser_projectile.gd.uid b/game/entities/weapons/laser/abstract_laser_projectile.gd.uid similarity index 100% rename from game/entities/weapons/laser/laser_projectile.gd.uid rename to game/entities/weapons/laser/abstract_laser_projectile.gd.uid diff --git a/game/entities/weapons/laser/laser_projectile.tscn b/game/entities/weapons/laser/abstract_laser_projectile.tscn similarity index 74% rename from game/entities/weapons/laser/laser_projectile.tscn rename to game/entities/weapons/laser/abstract_laser_projectile.tscn index 4949e49..89cd8bc 100644 --- a/game/entities/weapons/laser/laser_projectile.tscn +++ b/game/entities/weapons/laser/abstract_laser_projectile.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=8 format=3 uid="uid://cmni0xrbbfcy5"] -[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/direct_hit__projectile.tscn" id="1_3a8fg"] -[ext_resource type="Script" uid="uid://bdxq4aflhc8vd" path="res://game/entities/weapons/laser/laser_projectile.gd" id="2_je1a2"] -[ext_resource type="Script" uid="uid://c27v705giygv4" path="res://game/health_system/damage/energy_damage.gd" id="3_ylokk"] +[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/abstract_direct_hit_projectile.tscn" id="1_3a8fg"] +[ext_resource type="Script" uid="uid://bdxq4aflhc8vd" path="res://game/entities/weapons/laser/abstract_laser_projectile.gd" id="2_je1a2"] +[ext_resource type="Script" uid="uid://c27v705giygv4" path="res://game/data/damage/energy_damage.gd" id="3_ylokk"] [ext_resource type="Texture2D" uid="uid://dk3t14mrgjmma" path="res://particle_textures/energy_medium.tres" id="4_bytws"] [sub_resource type="Resource" id="Resource_bytws"] @@ -16,15 +16,16 @@ radius = 1.0 [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_7dd03"] resource_local_to_scene = true particle_flag_disable_z = true +emission_shape = 3 +emission_box_extents = Vector3(8, 0, 1) angle_min = -179.99998 angle_max = 180.00002 inherit_velocity_ratio = 1.0 +direction = Vector3(0, 0, 0) spread = 0.0 -initial_velocity_min = -250.0 -initial_velocity_max = -250.0 gravity = Vector3(0, 0, 0) -[node name="LaserProjectile" instance=ExtResource("1_3a8fg")] +[node name="AbstractLaserProjectile" instance=ExtResource("1_3a8fg")] collision_layer = 0 collision_mask = 0 script = ExtResource("2_je1a2") @@ -35,7 +36,8 @@ speed = 500 shape = SubResource("CircleShape2D_ylokk") [node name="GPUParticles2D" type="GPUParticles2D" parent="." index="2"] -amount = 64 +amount = 16 texture = ExtResource("4_bytws") -lifetime = 0.2 +lifetime = 0.09999999999999999 +fixed_fps = 20 process_material = SubResource("ParticleProcessMaterial_7dd03") diff --git a/game/entities/weapons/laser/laser_weapon.gd b/game/entities/weapons/laser/abstract_laser_weapon.gd similarity index 75% rename from game/entities/weapons/laser/laser_weapon.gd rename to game/entities/weapons/laser/abstract_laser_weapon.gd index 966f2aa..bdc46c4 100644 --- a/game/entities/weapons/laser/laser_weapon.gd +++ b/game/entities/weapons/laser/abstract_laser_weapon.gd @@ -1,3 +1,4 @@ +class_name AbstractLaserWeapon extends AbstractWeapon @@ -5,10 +6,8 @@ extends AbstractWeapon @onready var cooldown_timer : Timer = $CooldownTimer -func set_belonging(belonging: Belonging) -> void: - super.set_belonging(belonging) - - sprite.play(PREFIXES[_belonging]) +func _ready() -> void: + sprite.play(SHOT_ANIMATION) func shoot(ship_velocity: Vector2) -> bool: diff --git a/game/entities/weapons/laser/laser_weapon.gd.uid b/game/entities/weapons/laser/abstract_laser_weapon.gd.uid similarity index 100% rename from game/entities/weapons/laser/laser_weapon.gd.uid rename to game/entities/weapons/laser/abstract_laser_weapon.gd.uid diff --git a/game/entities/weapons/laser/abstract_laser_weapon.tscn b/game/entities/weapons/laser/abstract_laser_weapon.tscn new file mode 100644 index 0000000..4139d6b --- /dev/null +++ b/game/entities/weapons/laser/abstract_laser_weapon.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=4 format=3 uid="uid://def1alrel4ioo"] + +[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_pki4x"] +[ext_resource type="Script" uid="uid://bxr150at8ul2a" path="res://game/entities/weapons/laser/abstract_laser_weapon.gd" id="2_lbdvb"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_btyhf"] + +[node name="AbstractLaserWeapon" instance=ExtResource("1_pki4x")] +script = ExtResource("2_lbdvb") +bullet_per_shot = 2 +type = 2 + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] +sprite_frames = SubResource("SpriteFrames_btyhf") + +[node name="CooldownTimer" type="Timer" parent="." index="1"] +process_callback = 0 +wait_time = 0.05 +one_shot = true + +[connection signal="timeout" from="CooldownTimer" to="." method="_on_cooldown_timer_timeout"] diff --git a/game/entities/weapons/laser/enemy_laser_projectile.gd b/game/entities/weapons/laser/enemy_laser_projectile.gd new file mode 100644 index 0000000..1feab0b --- /dev/null +++ b/game/entities/weapons/laser/enemy_laser_projectile.gd @@ -0,0 +1,2 @@ +class_name EnemyLaserProjectile +extends AbstractLaserProjectile diff --git a/game/entities/weapons/laser/enemy_laser_projectile.gd.uid b/game/entities/weapons/laser/enemy_laser_projectile.gd.uid new file mode 100644 index 0000000..ec57be4 --- /dev/null +++ b/game/entities/weapons/laser/enemy_laser_projectile.gd.uid @@ -0,0 +1 @@ +uid://1tw0n0y7c3n4 diff --git a/game/entities/weapons/laser/enemy_laser_projectile.tscn b/game/entities/weapons/laser/enemy_laser_projectile.tscn new file mode 100644 index 0000000..5075a66 --- /dev/null +++ b/game/entities/weapons/laser/enemy_laser_projectile.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=4 format=3 uid="uid://cq8vnjrk70iby"] + +[ext_resource type="PackedScene" uid="uid://cmni0xrbbfcy5" path="res://game/entities/weapons/laser/abstract_laser_projectile.tscn" id="1_6hudn"] +[ext_resource type="Script" uid="uid://1tw0n0y7c3n4" path="res://game/entities/weapons/laser/enemy_laser_projectile.gd" id="2_2l4gg"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_2l4gg"] +resource_local_to_scene = true +particle_flag_disable_z = true +emission_shape = 3 +emission_box_extents = Vector3(16, 0, 1) +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 1.0 +direction = Vector3(-1, 0, 0) +spread = 0.0 +gravity = Vector3(0, 0, 0) + +[node name="EnemyLaserProjectile" instance=ExtResource("1_6hudn")] +collision_layer = 16 +collision_mask = 2 +script = ExtResource("2_2l4gg") +direction = Vector2(-1, 0) + +[node name="GPUParticles2D" parent="." index="2"] +process_material = SubResource("ParticleProcessMaterial_2l4gg") diff --git a/game/entities/weapons/laser/enemy_laser_weapon.gd b/game/entities/weapons/laser/enemy_laser_weapon.gd new file mode 100644 index 0000000..47c09e2 --- /dev/null +++ b/game/entities/weapons/laser/enemy_laser_weapon.gd @@ -0,0 +1,2 @@ +class_name EnemyLaserWeapon +extends AbstractLaserWeapon diff --git a/game/entities/weapons/laser/enemy_laser_weapon.gd.uid b/game/entities/weapons/laser/enemy_laser_weapon.gd.uid new file mode 100644 index 0000000..d530dda --- /dev/null +++ b/game/entities/weapons/laser/enemy_laser_weapon.gd.uid @@ -0,0 +1 @@ +uid://bckua73myf5v7 diff --git a/game/entities/weapons/laser/enemy_laser_weapon.tscn b/game/entities/weapons/laser/enemy_laser_weapon.tscn new file mode 100644 index 0000000..9b47c66 --- /dev/null +++ b/game/entities/weapons/laser/enemy_laser_weapon.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=10 format=3 uid="uid://mjt8xj8k28vi"] + +[ext_resource type="PackedScene" uid="uid://def1alrel4ioo" path="res://game/entities/weapons/laser/abstract_laser_weapon.tscn" id="1_wwqbk"] +[ext_resource type="Script" uid="uid://bckua73myf5v7" path="res://game/entities/weapons/laser/enemy_laser_weapon.gd" id="2_preya"] +[ext_resource type="PackedScene" uid="uid://cq8vnjrk70iby" path="res://game/entities/weapons/laser/enemy_laser_projectile.tscn" id="3_yr2si"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_a3m6t"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_dggsl"] +atlas = ExtResource("4_a3m6t") +region = Rect2(128, 80, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gbu7x"] +atlas = ExtResource("4_a3m6t") +region = Rect2(160, 80, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2prsi"] +atlas = ExtResource("4_a3m6t") +region = Rect2(192, 80, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jgejx"] +atlas = ExtResource("4_a3m6t") +region = Rect2(224, 80, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_ga5wd"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_dggsl") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gbu7x") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2prsi") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jgejx") +}], +"loop": true, +"name": &"shot", +"speed": 10.0 +}] + +[node name="EnemyLaserWeapon" instance=ExtResource("1_wwqbk")] +script = ExtResource("2_preya") +projectile_scene = ExtResource("3_yr2si") + +[node name="AnimatedSprite2D" parent="." index="0"] +position = Vector2(-3, 0) +sprite_frames = SubResource("SpriteFrames_ga5wd") +animation = &"shot" + +[node name="Muzzle" parent="." index="2"] +position = Vector2(-5, 0) diff --git a/game/entities/weapons/laser/laser_data.tres b/game/entities/weapons/laser/laser_data.tres deleted file mode 100644 index c45c0f3..0000000 --- a/game/entities/weapons/laser/laser_data.tres +++ /dev/null @@ -1,15 +0,0 @@ -[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://y7ccba1uqf2d"] - -[ext_resource type="PackedScene" uid="uid://def1alrel4ioo" path="res://game/entities/weapons/laser/laser_weapon.tscn" id="1_aey1r"] -[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_ipxhy"] - -[resource] -script = ExtResource("1_ipxhy") -id = "laser" -name = "Laser" -group = "energy" -description = "Low damage (energetic) -High firerate -Low velocity" -scene = ExtResource("1_aey1r") -metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/entities/weapons/laser/laser_weapon.tscn b/game/entities/weapons/laser/laser_weapon.tscn deleted file mode 100644 index 49b982b..0000000 --- a/game/entities/weapons/laser/laser_weapon.tscn +++ /dev/null @@ -1,93 +0,0 @@ -[gd_scene load_steps=14 format=3 uid="uid://def1alrel4ioo"] - -[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_pki4x"] -[ext_resource type="PackedScene" uid="uid://cmni0xrbbfcy5" path="res://game/entities/weapons/laser/laser_projectile.tscn" id="2_fecho"] -[ext_resource type="Script" uid="uid://bxr150at8ul2a" path="res://game/entities/weapons/laser/laser_weapon.gd" id="2_lbdvb"] -[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="6_c8tb4"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_dggsl"] -atlas = ExtResource("6_c8tb4") -region = Rect2(128, 80, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_gbu7x"] -atlas = ExtResource("6_c8tb4") -region = Rect2(160, 80, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_2prsi"] -atlas = ExtResource("6_c8tb4") -region = Rect2(192, 80, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jgejx"] -atlas = ExtResource("6_c8tb4") -region = Rect2(224, 80, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_5c4fv"] -atlas = ExtResource("6_c8tb4") -region = Rect2(128, 64, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_2jgsd"] -atlas = ExtResource("6_c8tb4") -region = Rect2(160, 64, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_4n6qh"] -atlas = ExtResource("6_c8tb4") -region = Rect2(192, 64, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_amoq0"] -atlas = ExtResource("6_c8tb4") -region = Rect2(224, 64, 32, 16) - -[sub_resource type="SpriteFrames" id="SpriteFrames_c8tb4"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_dggsl") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_gbu7x") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_2prsi") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jgejx") -}], -"loop": true, -"name": &"enemy", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_5c4fv") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_2jgsd") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_4n6qh") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_amoq0") -}], -"loop": true, -"name": &"player", -"speed": 10.0 -}] - -[node name="LaserWeapon" instance=ExtResource("1_pki4x")] -script = ExtResource("2_lbdvb") -bullet_per_shot = 2 -Projectile = ExtResource("2_fecho") -type = 2 - -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] -position = Vector2(3, 0) -sprite_frames = SubResource("SpriteFrames_c8tb4") -animation = &"player" - -[node name="CooldownTimer" type="Timer" parent="." index="1"] -process_callback = 0 -wait_time = 0.05 -one_shot = true - -[connection signal="timeout" from="CooldownTimer" to="." method="_on_cooldown_timer_timeout"] diff --git a/game/entities/weapons/laser/player_laser_projectile.gd b/game/entities/weapons/laser/player_laser_projectile.gd new file mode 100644 index 0000000..2435e22 --- /dev/null +++ b/game/entities/weapons/laser/player_laser_projectile.gd @@ -0,0 +1,2 @@ +class_name PlayerLaserProjectile +extends AbstractLaserProjectile diff --git a/game/entities/weapons/laser/player_laser_projectile.gd.uid b/game/entities/weapons/laser/player_laser_projectile.gd.uid new file mode 100644 index 0000000..f857efe --- /dev/null +++ b/game/entities/weapons/laser/player_laser_projectile.gd.uid @@ -0,0 +1 @@ +uid://v7pcdd8yxdse diff --git a/game/entities/weapons/laser/player_laser_projectile.tscn b/game/entities/weapons/laser/player_laser_projectile.tscn new file mode 100644 index 0000000..36939f5 --- /dev/null +++ b/game/entities/weapons/laser/player_laser_projectile.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=4 format=3 uid="uid://cyskk1kc88lgf"] + +[ext_resource type="PackedScene" uid="uid://cmni0xrbbfcy5" path="res://game/entities/weapons/laser/abstract_laser_projectile.tscn" id="1_q67uk"] +[ext_resource type="Script" uid="uid://v7pcdd8yxdse" path="res://game/entities/weapons/laser/player_laser_projectile.gd" id="2_truhp"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_truhp"] +resource_local_to_scene = true +particle_flag_disable_z = true +emission_shape = 3 +emission_box_extents = Vector3(16, 0, 1) +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 1.0 +spread = 0.0 +gravity = Vector3(0, 0, 0) + +[node name="PlayerLaserProjectile" instance=ExtResource("1_q67uk")] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("2_truhp") +direction = Vector2(1, 0) + +[node name="GPUParticles2D" parent="." index="2"] +process_material = SubResource("ParticleProcessMaterial_truhp") diff --git a/game/entities/weapons/laser/player_laser_weapon.gd b/game/entities/weapons/laser/player_laser_weapon.gd new file mode 100644 index 0000000..f731795 --- /dev/null +++ b/game/entities/weapons/laser/player_laser_weapon.gd @@ -0,0 +1,2 @@ +class_name PlayerLaserWeapon +extends AbstractLaserWeapon diff --git a/game/entities/weapons/laser/player_laser_weapon.gd.uid b/game/entities/weapons/laser/player_laser_weapon.gd.uid new file mode 100644 index 0000000..efd4f6d --- /dev/null +++ b/game/entities/weapons/laser/player_laser_weapon.gd.uid @@ -0,0 +1 @@ +uid://824ta0lbinkb diff --git a/game/entities/weapons/laser/player_laser_weapon.tscn b/game/entities/weapons/laser/player_laser_weapon.tscn new file mode 100644 index 0000000..77d1227 --- /dev/null +++ b/game/entities/weapons/laser/player_laser_weapon.tscn @@ -0,0 +1,54 @@ +[gd_scene load_steps=10 format=3 uid="uid://cargptjtnale2"] + +[ext_resource type="PackedScene" uid="uid://def1alrel4ioo" path="res://game/entities/weapons/laser/abstract_laser_weapon.tscn" id="1_nky8c"] +[ext_resource type="Script" uid="uid://824ta0lbinkb" path="res://game/entities/weapons/laser/player_laser_weapon.gd" id="2_oqbns"] +[ext_resource type="PackedScene" uid="uid://cyskk1kc88lgf" path="res://game/entities/weapons/laser/player_laser_projectile.tscn" id="3_62i0g"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_oaprh"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_5c4fv"] +atlas = ExtResource("4_oaprh") +region = Rect2(128, 64, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2jgsd"] +atlas = ExtResource("4_oaprh") +region = Rect2(160, 64, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4n6qh"] +atlas = ExtResource("4_oaprh") +region = Rect2(192, 64, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_amoq0"] +atlas = ExtResource("4_oaprh") +region = Rect2(224, 64, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_geipx"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_5c4fv") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2jgsd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4n6qh") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_amoq0") +}], +"loop": true, +"name": &"shot", +"speed": 10.0 +}] + +[node name="PlayerLaserWeapon" instance=ExtResource("1_nky8c")] +script = ExtResource("2_oqbns") +projectile_scene = ExtResource("3_62i0g") + +[node name="AnimatedSprite2D" parent="." index="0"] +position = Vector2(3, 0) +sprite_frames = SubResource("SpriteFrames_geipx") +animation = &"shot" + +[node name="Muzzle" parent="." index="2"] +position = Vector2(5, 0) diff --git a/game/entities/weapons/launcher/launcher_projectile.gd b/game/entities/weapons/launcher/abstract_launcher_projectile.gd similarity index 89% rename from game/entities/weapons/launcher/launcher_projectile.gd rename to game/entities/weapons/launcher/abstract_launcher_projectile.gd index a121472..17d8a0f 100644 --- a/game/entities/weapons/launcher/launcher_projectile.gd +++ b/game/entities/weapons/launcher/abstract_launcher_projectile.gd @@ -1,5 +1,5 @@ -class_name LauncherProjectile -extends BlastProjectile +class_name AbstractLauncherProjectile +extends AbstractBlastProjectile @export_range(0, 360) var rotation_speed: int @@ -9,8 +9,8 @@ var target : AbstractShip = null @onready var sprites : Array[Sprite2D] = [ - $Sprite2D_E, $Sprite2D_SE, $Sprite2D_S, $Sprite2D_SW, - $Sprite2D_W, $Sprite2D_NW, $Sprite2D_N, $Sprite2D_NE, + $Sprites/E, $Sprites/SE, $Sprites/S, $Sprites/SW, + $Sprites/W, $Sprites/NW, $Sprites/N, $Sprites/NE, ] @onready var explosion_particles : ExplosionParticles = $ExplosionParticles diff --git a/game/entities/weapons/launcher/launcher_projectile.gd.uid b/game/entities/weapons/launcher/abstract_launcher_projectile.gd.uid similarity index 100% rename from game/entities/weapons/launcher/launcher_projectile.gd.uid rename to game/entities/weapons/launcher/abstract_launcher_projectile.gd.uid diff --git a/game/entities/weapons/launcher/launcher_projectile.tscn b/game/entities/weapons/launcher/abstract_launcher_projectile.tscn similarity index 75% rename from game/entities/weapons/launcher/launcher_projectile.tscn rename to game/entities/weapons/launcher/abstract_launcher_projectile.tscn index 88159fa..b55941b 100644 --- a/game/entities/weapons/launcher/launcher_projectile.tscn +++ b/game/entities/weapons/launcher/abstract_launcher_projectile.tscn @@ -1,17 +1,17 @@ [gd_scene load_steps=20 format=3 uid="uid://dukgbg13ujkv2"] -[ext_resource type="PackedScene" uid="uid://betr5ry5tc75e" path="res://game/entities/weapons/blast_projectile.tscn" id="1_0mcat"] -[ext_resource type="Script" uid="uid://dkvur5bdwg3sr" path="res://game/entities/weapons/launcher/launcher_projectile.gd" id="2_6hdsf"] -[ext_resource type="PackedScene" uid="uid://bhxib2ltpkcbf" path="res://game/entities/other/explosion_particles.tscn" id="3_iqm85"] +[ext_resource type="PackedScene" uid="uid://betr5ry5tc75e" path="res://game/entities/weapons/abstract_blast_projectile.tscn" id="1_0mcat"] +[ext_resource type="Script" uid="uid://dkvur5bdwg3sr" path="res://game/entities/weapons/launcher/abstract_launcher_projectile.gd" id="2_6hdsf"] +[ext_resource type="PackedScene" uid="uid://bhxib2ltpkcbf" path="res://game/entities/explosions/explosion_particles.tscn" id="3_iqm85"] [ext_resource type="Texture2D" uid="uid://gh7mwehpqfco" path="res://particle_textures/flame_medium.tres" id="3_kos01"] -[ext_resource type="Script" uid="uid://dftb7hg5f06b5" path="res://game/health_system/damage/explosion_damage.gd" id="3_ycnsk"] +[ext_resource type="Script" uid="uid://dftb7hg5f06b5" path="res://game/data/damage/explosion_damage.gd" id="3_ycnsk"] [ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="4_kxgpk"] [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_kxgpk"] lifetime_randomness = 0.5 particle_flag_disable_z = true emission_shape = 1 -emission_sphere_radius = 2.0 +emission_sphere_radius = 1.0 angle_min = -179.99998 angle_max = 180.00002 spread = 15.0 @@ -73,7 +73,7 @@ gravity = Vector3(0, 0, 0) turbulence_enabled = true turbulence_noise_speed = Vector3(0.1, 0.1, 0.1) -[node name="LauncherProjectile" instance=ExtResource("1_0mcat")] +[node name="AbstractLauncherProjectile" instance=ExtResource("1_0mcat")] collision_layer = 0 collision_mask = 0 script = ExtResource("2_6hdsf") @@ -86,44 +86,46 @@ texture = ExtResource("3_kos01") lifetime = 0.1 process_material = SubResource("ParticleProcessMaterial_kxgpk") -[node name="Sprite2D_E" type="Sprite2D" parent="." index="1"] +[node name="Sprites" type="Node2D" parent="." index="1"] + +[node name="E" type="Sprite2D" parent="Sprites" index="0"] texture = SubResource("AtlasTexture_kxgpk") -[node name="Sprite2D_SE" type="Sprite2D" parent="." index="2"] +[node name="SE" type="Sprite2D" parent="Sprites" index="1"] texture = SubResource("AtlasTexture_kos01") -[node name="Sprite2D_S" type="Sprite2D" parent="." index="3"] +[node name="S" type="Sprite2D" parent="Sprites" index="2"] texture = SubResource("AtlasTexture_iqm85") -[node name="Sprite2D_SW" type="Sprite2D" parent="." index="4"] +[node name="SW" type="Sprite2D" parent="Sprites" index="3"] texture = SubResource("AtlasTexture_rno65") -[node name="Sprite2D_W" type="Sprite2D" parent="." index="5"] +[node name="W" type="Sprite2D" parent="Sprites" index="4"] texture = SubResource("AtlasTexture_f648y") -[node name="Sprite2D_NW" type="Sprite2D" parent="." index="6"] +[node name="NW" type="Sprite2D" parent="Sprites" index="5"] texture = SubResource("AtlasTexture_she3g") -[node name="Sprite2D_N" type="Sprite2D" parent="." index="7"] +[node name="N" type="Sprite2D" parent="Sprites" index="6"] texture = SubResource("AtlasTexture_4wwm4") -[node name="Sprite2D_NE" type="Sprite2D" parent="." index="8"] +[node name="NE" type="Sprite2D" parent="Sprites" index="7"] texture = SubResource("AtlasTexture_dl8vu") -[node name="CollisionShape2D" parent="." index="9"] +[node name="CollisionShape2D" parent="." index="2"] shape = SubResource("CapsuleShape2D_6hdsf") -[node name="Blast" parent="." index="11"] +[node name="Blast" parent="." index="4"] collision_layer = 0 collision_mask = 0 damage = SubResource("Resource_kos01") shape = SubResource("CircleShape2D_kxgpk") -[node name="ExplosionParticles" parent="." index="12" instance=ExtResource("3_iqm85")] +[node name="ExplosionParticles" parent="." index="5" instance=ExtResource("3_iqm85")] process_material = SubResource("ParticleProcessMaterial_iqm85") amount_ratio = 0.05 -[node name="OutOfScreenTimer" parent="." index="13"] +[node name="OutOfScreenTimer" parent="." index="6"] wait_time = 3.0 [connection signal="finished" from="ExplosionParticles" to="." method="_on_explosion_particles_finished"] diff --git a/game/entities/weapons/launcher/launcher_weapon.gd b/game/entities/weapons/launcher/abstract_launcher_weapon.gd similarity index 76% rename from game/entities/weapons/launcher/launcher_weapon.gd rename to game/entities/weapons/launcher/abstract_launcher_weapon.gd index 184a4d0..d8007f9 100644 --- a/game/entities/weapons/launcher/launcher_weapon.gd +++ b/game/entities/weapons/launcher/abstract_launcher_weapon.gd @@ -1,8 +1,7 @@ +class_name AbstractLauncherWeapon extends AbstractWeapon -@onready var player_sprite : Sprite2D = $PlayerSprite -@onready var enemy_sprite : Sprite2D = $EnemySprite @onready var cooldown_timer : Timer = $CooldownTimer @@ -19,18 +18,6 @@ var _muzzle_index := 0 ] -func set_belonging(belonging: Belonging) -> void: - super.set_belonging(belonging) - - match _belonging: - Belonging.PLAYER: - player_sprite.show() - enemy_sprite.hide() - Belonging.ENEMY: - player_sprite.hide() - enemy_sprite.show() - - func shoot(ship_velocity: Vector2) -> bool: var is_shot := super.shoot(ship_velocity) if is_shot: diff --git a/game/entities/weapons/launcher/launcher_weapon.gd.uid b/game/entities/weapons/launcher/abstract_launcher_weapon.gd.uid similarity index 100% rename from game/entities/weapons/launcher/launcher_weapon.gd.uid rename to game/entities/weapons/launcher/abstract_launcher_weapon.gd.uid diff --git a/game/entities/weapons/launcher/launcher_weapon.tscn b/game/entities/weapons/launcher/abstract_launcher_weapon.tscn similarity index 58% rename from game/entities/weapons/launcher/launcher_weapon.tscn rename to game/entities/weapons/launcher/abstract_launcher_weapon.tscn index 59c0b3a..6cb403a 100644 --- a/game/entities/weapons/launcher/launcher_weapon.tscn +++ b/game/entities/weapons/launcher/abstract_launcher_weapon.tscn @@ -1,10 +1,8 @@ -[gd_scene load_steps=10 format=3 uid="uid://c3l866fdqt7pf"] +[gd_scene load_steps=6 format=3 uid="uid://c3l866fdqt7pf"] [ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_sk5u1"] -[ext_resource type="Script" uid="uid://lauvvj5xhbud" path="res://game/entities/weapons/launcher/launcher_weapon.gd" id="2_mxjpe"] -[ext_resource type="PackedScene" uid="uid://dukgbg13ujkv2" path="res://game/entities/weapons/launcher/launcher_projectile.tscn" id="3_fsoo2"] +[ext_resource type="Script" uid="uid://lauvvj5xhbud" path="res://game/entities/weapons/launcher/abstract_launcher_weapon.gd" id="2_mxjpe"] [ext_resource type="Texture2D" uid="uid://gh7mwehpqfco" path="res://particle_textures/flame_medium.tres" id="4_0brql"] -[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="6_3cw5x"] [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_u8eh0"] lifetime_randomness = 0.5 @@ -34,22 +32,12 @@ initial_velocity_min = 30.0 initial_velocity_max = 50.0 gravity = Vector3(0, 0, 0) -[sub_resource type="AtlasTexture" id="AtlasTexture_u8eh0"] -atlas = ExtResource("6_3cw5x") -region = Rect2(224, 128, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ylgjm"] -atlas = ExtResource("6_3cw5x") -region = Rect2(224, 144, 32, 16) - -[node name="LauncherWeapon" instance=ExtResource("1_sk5u1")] +[node name="AbstractLauncherWeapon" instance=ExtResource("1_sk5u1")] script = ExtResource("2_mxjpe") sector_angle = 5 -Projectile = ExtResource("3_fsoo2") type = 4 [node name="LeftParticles" type="GPUParticles2D" parent="." index="0"] -position = Vector2(-4, -3) emitting = false amount = 16 texture = ExtResource("4_0brql") @@ -58,7 +46,6 @@ one_shot = true process_material = SubResource("ParticleProcessMaterial_u8eh0") [node name="RightParticles" type="GPUParticles2D" parent="." index="1"] -position = Vector2(-4, 3) emitting = false amount = 16 texture = ExtResource("4_0brql") @@ -66,22 +53,10 @@ lifetime = 0.3 one_shot = true process_material = SubResource("ParticleProcessMaterial_0brql") -[node name="PlayerSprite" type="Sprite2D" parent="." index="2"] -position = Vector2(4, 0) -texture = SubResource("AtlasTexture_u8eh0") - -[node name="EnemySprite" type="Sprite2D" parent="." index="3"] -position = Vector2(4, 0) -texture = SubResource("AtlasTexture_ylgjm") - -[node name="CooldownTimer" type="Timer" parent="." index="4"] +[node name="CooldownTimer" type="Timer" parent="." index="2"] wait_time = 0.5 one_shot = true -[node name="Muzzle" parent="." index="5"] -position = Vector2(11, -3) - -[node name="SecondMuzzle" type="Node2D" parent="." index="6"] -position = Vector2(11, 3) +[node name="SecondMuzzle" type="Node2D" parent="." index="4"] [connection signal="timeout" from="CooldownTimer" to="." method="_on_cooldown_timer_timeout"] diff --git a/game/entities/weapons/launcher/enemy_launcher_projectile.gd b/game/entities/weapons/launcher/enemy_launcher_projectile.gd new file mode 100644 index 0000000..d456634 --- /dev/null +++ b/game/entities/weapons/launcher/enemy_launcher_projectile.gd @@ -0,0 +1,2 @@ +class_name EnemyLauncherProjectile +extends AbstractLauncherProjectile diff --git a/game/entities/weapons/launcher/enemy_launcher_projectile.gd.uid b/game/entities/weapons/launcher/enemy_launcher_projectile.gd.uid new file mode 100644 index 0000000..8d70bda --- /dev/null +++ b/game/entities/weapons/launcher/enemy_launcher_projectile.gd.uid @@ -0,0 +1 @@ +uid://bgl2wo0bdgh5j diff --git a/game/entities/weapons/launcher/enemy_launcher_projectile.tscn b/game/entities/weapons/launcher/enemy_launcher_projectile.tscn new file mode 100644 index 0000000..b0a0815 --- /dev/null +++ b/game/entities/weapons/launcher/enemy_launcher_projectile.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=3 uid="uid://dpbighfm8o7ij"] + +[ext_resource type="PackedScene" uid="uid://dukgbg13ujkv2" path="res://game/entities/weapons/launcher/abstract_launcher_projectile.tscn" id="1_ek3l7"] +[ext_resource type="Script" uid="uid://bgl2wo0bdgh5j" path="res://game/entities/weapons/launcher/enemy_launcher_projectile.gd" id="2_idk0a"] + +[node name="EnemyLauncherProjectile" instance=ExtResource("1_ek3l7")] +collision_layer = 16 +collision_mask = 2 +script = ExtResource("2_idk0a") +direction = Vector2(-1, 0) + +[node name="Blast" parent="." index="4"] +collision_layer = 16 +collision_mask = 2 diff --git a/game/entities/weapons/launcher/enemy_launcher_weapon.gd b/game/entities/weapons/launcher/enemy_launcher_weapon.gd new file mode 100644 index 0000000..6381d6c --- /dev/null +++ b/game/entities/weapons/launcher/enemy_launcher_weapon.gd @@ -0,0 +1,2 @@ +class_name EnemyLauncherWeapon +extends AbstractLauncherWeapon diff --git a/game/entities/weapons/launcher/enemy_launcher_weapon.gd.uid b/game/entities/weapons/launcher/enemy_launcher_weapon.gd.uid new file mode 100644 index 0000000..9dfecb9 --- /dev/null +++ b/game/entities/weapons/launcher/enemy_launcher_weapon.gd.uid @@ -0,0 +1 @@ +uid://3b4ft0vrkvn1 diff --git a/game/entities/weapons/launcher/enemy_launcher_weapon.tscn b/game/entities/weapons/launcher/enemy_launcher_weapon.tscn new file mode 100644 index 0000000..2bad170 --- /dev/null +++ b/game/entities/weapons/launcher/enemy_launcher_weapon.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=8 format=3 uid="uid://b757rcwc231o2"] + +[ext_resource type="PackedScene" uid="uid://c3l866fdqt7pf" path="res://game/entities/weapons/launcher/abstract_launcher_weapon.tscn" id="1_co8ul"] +[ext_resource type="Script" uid="uid://3b4ft0vrkvn1" path="res://game/entities/weapons/launcher/enemy_launcher_weapon.gd" id="2_qdxuw"] +[ext_resource type="PackedScene" uid="uid://dpbighfm8o7ij" path="res://game/entities/weapons/launcher/enemy_launcher_projectile.tscn" id="3_qdxuw"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_xtc8h"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_xtc8h"] +lifetime_randomness = 0.5 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 1.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +spread = 15.0 +initial_velocity_min = 30.0 +initial_velocity_max = 50.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_avyie"] +lifetime_randomness = 0.5 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 1.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +spread = 15.0 +initial_velocity_min = 30.0 +initial_velocity_max = 50.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ylgjm"] +atlas = ExtResource("4_xtc8h") +region = Rect2(224, 144, 32, 16) + +[node name="EnemyLauncherWeapon" instance=ExtResource("1_co8ul")] +script = ExtResource("2_qdxuw") +projectile_scene = ExtResource("3_qdxuw") + +[node name="LeftParticles" parent="." index="0"] +position = Vector2(4, 3) +process_material = SubResource("ParticleProcessMaterial_xtc8h") + +[node name="RightParticles" parent="." index="1"] +position = Vector2(4, -3) +process_material = SubResource("ParticleProcessMaterial_avyie") + +[node name="Muzzle" parent="." index="3"] +position = Vector2(-11, 3) + +[node name="SecondMuzzle" parent="." index="4"] +position = Vector2(-11, -3) + +[node name="Sprite2D" type="Sprite2D" parent="." index="5"] +position = Vector2(-4, 0) +texture = SubResource("AtlasTexture_ylgjm") diff --git a/game/entities/weapons/launcher/launcher_data.tres b/game/entities/weapons/launcher/launcher_data.tres deleted file mode 100644 index 73fa6e0..0000000 --- a/game/entities/weapons/launcher/launcher_data.tres +++ /dev/null @@ -1,17 +0,0 @@ -[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://ddgggndifycge"] - -[ext_resource type="PackedScene" uid="uid://c3l866fdqt7pf" path="res://game/entities/weapons/launcher/launcher_weapon.tscn" id="1_3oqtq"] -[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_tcis2"] - -[resource] -script = ExtResource("1_tcis2") -id = "launcher" -name = "Launcher" -group = "explosion" -description = "Moderate damage (explosion) -Moderate firerate -Low velocity -Small explosion radius -Homing" -scene = ExtResource("1_3oqtq") -metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/entities/weapons/launcher/player_launcher_projectile.gd b/game/entities/weapons/launcher/player_launcher_projectile.gd new file mode 100644 index 0000000..78fce80 --- /dev/null +++ b/game/entities/weapons/launcher/player_launcher_projectile.gd @@ -0,0 +1,2 @@ +class_name PlayerLauncherProjectile +extends AbstractLauncherProjectile diff --git a/game/entities/weapons/launcher/player_launcher_projectile.gd.uid b/game/entities/weapons/launcher/player_launcher_projectile.gd.uid new file mode 100644 index 0000000..2c6b27c --- /dev/null +++ b/game/entities/weapons/launcher/player_launcher_projectile.gd.uid @@ -0,0 +1 @@ +uid://jxx2b1mcovtx diff --git a/game/entities/weapons/launcher/player_launcher_projectile.tscn b/game/entities/weapons/launcher/player_launcher_projectile.tscn new file mode 100644 index 0000000..0ada8bb --- /dev/null +++ b/game/entities/weapons/launcher/player_launcher_projectile.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=3 uid="uid://ds0xsi84rp1kb"] + +[ext_resource type="PackedScene" uid="uid://dukgbg13ujkv2" path="res://game/entities/weapons/launcher/abstract_launcher_projectile.tscn" id="1_cd4up"] +[ext_resource type="Script" uid="uid://jxx2b1mcovtx" path="res://game/entities/weapons/launcher/player_launcher_projectile.gd" id="2_gkh2w"] + +[node name="PlayerLauncherProjectile" instance=ExtResource("1_cd4up")] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("2_gkh2w") +direction = Vector2(1, 0) + +[node name="Blast" parent="." index="4"] +collision_layer = 8 +collision_mask = 4 diff --git a/game/entities/weapons/launcher/player_launcher_weapon.gd b/game/entities/weapons/launcher/player_launcher_weapon.gd new file mode 100644 index 0000000..8256ec6 --- /dev/null +++ b/game/entities/weapons/launcher/player_launcher_weapon.gd @@ -0,0 +1,2 @@ +class_name PlayerLauncherWeapon +extends AbstractLauncherWeapon diff --git a/game/entities/weapons/launcher/player_launcher_weapon.gd.uid b/game/entities/weapons/launcher/player_launcher_weapon.gd.uid new file mode 100644 index 0000000..52ff738 --- /dev/null +++ b/game/entities/weapons/launcher/player_launcher_weapon.gd.uid @@ -0,0 +1 @@ +uid://c3asrkguw01q2 diff --git a/game/entities/weapons/launcher/player_launcher_weapon.tscn b/game/entities/weapons/launcher/player_launcher_weapon.tscn new file mode 100644 index 0000000..d4d5a63 --- /dev/null +++ b/game/entities/weapons/launcher/player_launcher_weapon.tscn @@ -0,0 +1,60 @@ +[gd_scene load_steps=8 format=3 uid="uid://bmn3cxk1ajydl"] + +[ext_resource type="PackedScene" uid="uid://c3l866fdqt7pf" path="res://game/entities/weapons/launcher/abstract_launcher_weapon.tscn" id="1_d6r67"] +[ext_resource type="Script" uid="uid://c3asrkguw01q2" path="res://game/entities/weapons/launcher/player_launcher_weapon.gd" id="2_10o3e"] +[ext_resource type="PackedScene" uid="uid://ds0xsi84rp1kb" path="res://game/entities/weapons/launcher/player_launcher_projectile.tscn" id="3_10o3e"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_v6ybh"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_v6ybh"] +lifetime_randomness = 0.5 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 1.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +direction = Vector3(-1, 0, 0) +spread = 15.0 +initial_velocity_min = 30.0 +initial_velocity_max = 50.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_8lwsi"] +lifetime_randomness = 0.5 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 1.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +direction = Vector3(-1, 0, 0) +spread = 15.0 +initial_velocity_min = 30.0 +initial_velocity_max = 50.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u8eh0"] +atlas = ExtResource("4_v6ybh") +region = Rect2(224, 128, 32, 16) + +[node name="PlayerLauncherWeapon" instance=ExtResource("1_d6r67")] +script = ExtResource("2_10o3e") +projectile_scene = ExtResource("3_10o3e") + +[node name="LeftParticles" parent="." index="0"] +position = Vector2(-4, -3) +process_material = SubResource("ParticleProcessMaterial_v6ybh") + +[node name="RightParticles" parent="." index="1"] +position = Vector2(-4, 3) +process_material = SubResource("ParticleProcessMaterial_8lwsi") + +[node name="Muzzle" parent="." index="3"] +position = Vector2(11, -3) + +[node name="SecondMuzzle" parent="." index="4"] +position = Vector2(11, 3) + +[node name="Sprite2D" type="Sprite2D" parent="." index="5"] +position = Vector2(4, 0) +texture = SubResource("AtlasTexture_u8eh0") diff --git a/game/entities/weapons/minelayer/minelayer_projectile.gd b/game/entities/weapons/minelayer/abstract_minelayer_projectile.gd similarity index 97% rename from game/entities/weapons/minelayer/minelayer_projectile.gd rename to game/entities/weapons/minelayer/abstract_minelayer_projectile.gd index 6a85971..300533b 100644 --- a/game/entities/weapons/minelayer/minelayer_projectile.gd +++ b/game/entities/weapons/minelayer/abstract_minelayer_projectile.gd @@ -1,5 +1,5 @@ -class_name MinelayerProjectile -extends BlastProjectile +class_name AbstractMinelayerProjectile +extends AbstractBlastProjectile enum SpriteState { diff --git a/game/entities/weapons/minelayer/minelayer_projectile.gd.uid b/game/entities/weapons/minelayer/abstract_minelayer_projectile.gd.uid similarity index 100% rename from game/entities/weapons/minelayer/minelayer_projectile.gd.uid rename to game/entities/weapons/minelayer/abstract_minelayer_projectile.gd.uid diff --git a/game/entities/weapons/minelayer/minelayer_projectile.tscn b/game/entities/weapons/minelayer/abstract_minelayer_projectile.tscn similarity index 88% rename from game/entities/weapons/minelayer/minelayer_projectile.tscn rename to game/entities/weapons/minelayer/abstract_minelayer_projectile.tscn index d1fbeb7..c1eaf97 100644 --- a/game/entities/weapons/minelayer/minelayer_projectile.tscn +++ b/game/entities/weapons/minelayer/abstract_minelayer_projectile.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=12 format=3 uid="uid://4mkklqt1g14f"] -[ext_resource type="PackedScene" uid="uid://betr5ry5tc75e" path="res://game/entities/weapons/blast_projectile.tscn" id="1_ufc4r"] -[ext_resource type="Script" uid="uid://76swcukelnii" path="res://game/entities/weapons/minelayer/minelayer_projectile.gd" id="2_hwwfa"] -[ext_resource type="Script" uid="uid://dftb7hg5f06b5" path="res://game/health_system/damage/explosion_damage.gd" id="3_hll7s"] +[ext_resource type="PackedScene" uid="uid://betr5ry5tc75e" path="res://game/entities/weapons/abstract_blast_projectile.tscn" id="1_ufc4r"] +[ext_resource type="Script" uid="uid://76swcukelnii" path="res://game/entities/weapons/minelayer/abstract_minelayer_projectile.gd" id="2_hwwfa"] +[ext_resource type="Script" uid="uid://dftb7hg5f06b5" path="res://game/data/damage/explosion_damage.gd" id="3_hll7s"] [ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="4_px1i2"] -[ext_resource type="PackedScene" uid="uid://bhxib2ltpkcbf" path="res://game/entities/other/explosion_particles.tscn" id="5_ckqco"] +[ext_resource type="PackedScene" uid="uid://bhxib2ltpkcbf" path="res://game/entities/explosions/explosion_particles.tscn" id="5_ckqco"] [sub_resource type="AtlasTexture" id="AtlasTexture_ckqco"] atlas = ExtResource("4_px1i2") @@ -37,7 +37,7 @@ gravity = Vector3(0, 0, 0) turbulence_enabled = true turbulence_noise_speed = Vector3(0.1, 0.1, 0.1) -[node name="MinelayerProjectile" instance=ExtResource("1_ufc4r")] +[node name="AbstractMinelayerProjectile" instance=ExtResource("1_ufc4r")] collision_layer = 0 collision_mask = 0 script = ExtResource("2_hwwfa") diff --git a/game/entities/weapons/minelayer/minelayer_weapon.gd b/game/entities/weapons/minelayer/abstract_minelayer_weapon.gd similarity index 56% rename from game/entities/weapons/minelayer/minelayer_weapon.gd rename to game/entities/weapons/minelayer/abstract_minelayer_weapon.gd index 913269f..f8b81f6 100644 --- a/game/entities/weapons/minelayer/minelayer_weapon.gd +++ b/game/entities/weapons/minelayer/abstract_minelayer_weapon.gd @@ -1,24 +1,22 @@ +class_name AbstractMinelayerWeapon extends AbstractWeapon @onready var sprite : AnimatedSprite2D = $AnimatedSprite2D - -func set_belonging(belonging: Belonging) -> void: - super.set_belonging(belonging) - - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) +func _ready() -> void: + sprite.play(IDLE_ANIMATION) func shoot(ship_velocity: Vector2) -> bool: var is_shot := super.shoot(ship_velocity) if is_shot: _can_shoot = false - sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX) + sprite.play(SHOT_ANIMATION) return is_shot func _on_animated_sprite_2d_animation_finished() -> void: - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) + sprite.play(IDLE_ANIMATION) _can_shoot = true diff --git a/game/entities/weapons/minelayer/minelayer_weapon.gd.uid b/game/entities/weapons/minelayer/abstract_minelayer_weapon.gd.uid similarity index 100% rename from game/entities/weapons/minelayer/minelayer_weapon.gd.uid rename to game/entities/weapons/minelayer/abstract_minelayer_weapon.gd.uid diff --git a/game/entities/weapons/minelayer/minelayer_weapon.tscn b/game/entities/weapons/minelayer/abstract_minelayer_weapon.tscn similarity index 90% rename from game/entities/weapons/minelayer/minelayer_weapon.tscn rename to game/entities/weapons/minelayer/abstract_minelayer_weapon.tscn index f1e87a4..c64386b 100644 --- a/game/entities/weapons/minelayer/minelayer_weapon.tscn +++ b/game/entities/weapons/minelayer/abstract_minelayer_weapon.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=20 format=3 uid="uid://j3yht6q4ru4e"] +[gd_scene load_steps=19 format=3 uid="uid://j3yht6q4ru4e"] [ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_12l3k"] -[ext_resource type="PackedScene" uid="uid://4mkklqt1g14f" path="res://game/entities/weapons/minelayer/minelayer_projectile.tscn" id="2_7y446"] -[ext_resource type="Script" uid="uid://c3ckkpjaef5jn" path="res://game/entities/weapons/minelayer/minelayer_weapon.gd" id="2_mmhtn"] +[ext_resource type="Script" uid="uid://c3ckkpjaef5jn" path="res://game/entities/weapons/minelayer/abstract_minelayer_weapon.gd" id="2_mmhtn"] [ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="6_ais8e"] [sub_resource type="AtlasTexture" id="AtlasTexture_ais8e"] @@ -126,10 +125,9 @@ animations = [{ "speed": 10.0 }] -[node name="MinelayerWeapon" instance=ExtResource("1_12l3k")] +[node name="AbstractMinelayerWeapon" instance=ExtResource("1_12l3k")] script = ExtResource("2_mmhtn") sector_angle = 10 -Projectile = ExtResource("2_7y446") type = 5 [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] diff --git a/game/entities/weapons/minelayer/enemy_minelayer_projectile.gd b/game/entities/weapons/minelayer/enemy_minelayer_projectile.gd new file mode 100644 index 0000000..9e9323b --- /dev/null +++ b/game/entities/weapons/minelayer/enemy_minelayer_projectile.gd @@ -0,0 +1,2 @@ +class_name EnemyMinelayerProjectile +extends AbstractMinelayerProjectile diff --git a/game/entities/weapons/minelayer/enemy_minelayer_projectile.gd.uid b/game/entities/weapons/minelayer/enemy_minelayer_projectile.gd.uid new file mode 100644 index 0000000..d37a555 --- /dev/null +++ b/game/entities/weapons/minelayer/enemy_minelayer_projectile.gd.uid @@ -0,0 +1 @@ +uid://fyoiuye4fvk3 diff --git a/game/entities/weapons/minelayer/enemy_minelayer_projectile.tscn b/game/entities/weapons/minelayer/enemy_minelayer_projectile.tscn new file mode 100644 index 0000000..fa9ced8 --- /dev/null +++ b/game/entities/weapons/minelayer/enemy_minelayer_projectile.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=3 uid="uid://bs3wo34es7q10"] + +[ext_resource type="PackedScene" uid="uid://4mkklqt1g14f" path="res://game/entities/weapons/minelayer/abstract_minelayer_projectile.tscn" id="1_uiwyj"] +[ext_resource type="Script" uid="uid://fyoiuye4fvk3" path="res://game/entities/weapons/minelayer/enemy_minelayer_projectile.gd" id="2_2o7sx"] + +[node name="EnemyMinelayerProjectile" instance=ExtResource("1_uiwyj")] +collision_layer = 16 +collision_mask = 2 +script = ExtResource("2_2o7sx") +direction = Vector2(-1, 0) + +[node name="Blast" parent="." index="4"] +collision_layer = 16 +collision_mask = 2 diff --git a/game/entities/weapons/minelayer/enemy_minelayer_weapon.gd b/game/entities/weapons/minelayer/enemy_minelayer_weapon.gd new file mode 100644 index 0000000..12c2d26 --- /dev/null +++ b/game/entities/weapons/minelayer/enemy_minelayer_weapon.gd @@ -0,0 +1,2 @@ +class_name EnemyMinelayerWeapon +extends AbstractMinelayerWeapon diff --git a/game/entities/weapons/minelayer/enemy_minelayer_weapon.gd.uid b/game/entities/weapons/minelayer/enemy_minelayer_weapon.gd.uid new file mode 100644 index 0000000..98ec0dd --- /dev/null +++ b/game/entities/weapons/minelayer/enemy_minelayer_weapon.gd.uid @@ -0,0 +1 @@ +uid://dmnqjbog6df2x diff --git a/game/entities/weapons/minelayer/enemy_minelayer_weapon.tscn b/game/entities/weapons/minelayer/enemy_minelayer_weapon.tscn new file mode 100644 index 0000000..709cef8 --- /dev/null +++ b/game/entities/weapons/minelayer/enemy_minelayer_weapon.tscn @@ -0,0 +1,76 @@ +[gd_scene load_steps=13 format=3 uid="uid://bjbfi6vvikk15"] + +[ext_resource type="PackedScene" uid="uid://j3yht6q4ru4e" path="res://game/entities/weapons/minelayer/abstract_minelayer_weapon.tscn" id="1_8qj2c"] +[ext_resource type="Script" uid="uid://dmnqjbog6df2x" path="res://game/entities/weapons/minelayer/enemy_minelayer_weapon.gd" id="2_n3m0w"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="3_jx7o2"] +[ext_resource type="PackedScene" uid="uid://bs3wo34es7q10" path="res://game/entities/weapons/minelayer/enemy_minelayer_projectile.tscn" id="3_nkog1"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_ais8e"] +atlas = ExtResource("3_jx7o2") +region = Rect2(0, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_a7h2a"] +atlas = ExtResource("3_jx7o2") +region = Rect2(32, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_5u2pu"] +atlas = ExtResource("3_jx7o2") +region = Rect2(64, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_iwxdg"] +atlas = ExtResource("3_jx7o2") +region = Rect2(96, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_oyt37"] +atlas = ExtResource("3_jx7o2") +region = Rect2(128, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fvahc"] +atlas = ExtResource("3_jx7o2") +region = Rect2(160, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_c2np6"] +atlas = ExtResource("3_jx7o2") +region = Rect2(192, 144, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_nkog1"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_ais8e") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_a7h2a") +}, { +"duration": 9.0, +"texture": SubResource("AtlasTexture_5u2pu") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_iwxdg") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_oyt37") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_fvahc") +}, { +"duration": 2.0, +"texture": SubResource("AtlasTexture_c2np6") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[node name="EnemyMinelayerWeapon" instance=ExtResource("1_8qj2c")] +script = ExtResource("2_n3m0w") +projectile_scene = ExtResource("3_nkog1") + +[node name="AnimatedSprite2D" parent="." index="0"] +sprite_frames = SubResource("SpriteFrames_nkog1") +animation = &"shot" diff --git a/game/entities/weapons/minelayer/minelayer_data.tres b/game/entities/weapons/minelayer/minelayer_data.tres deleted file mode 100644 index 7e4e2c2..0000000 --- a/game/entities/weapons/minelayer/minelayer_data.tres +++ /dev/null @@ -1,17 +0,0 @@ -[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://40sshnf6g80k"] - -[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_152qt"] -[ext_resource type="PackedScene" uid="uid://j3yht6q4ru4e" path="res://game/entities/weapons/minelayer/minelayer_weapon.tscn" id="1_fh5qv"] - -[resource] -script = ExtResource("1_152qt") -id = "minelayer" -name = "Minelayer" -group = "explosion" -description = "High damage (explosion) -Low firerate -Low velocity -Medium explosion radius -Short range" -scene = ExtResource("1_fh5qv") -metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/entities/weapons/minelayer/player_minelayer_projectile.gd b/game/entities/weapons/minelayer/player_minelayer_projectile.gd new file mode 100644 index 0000000..096cff7 --- /dev/null +++ b/game/entities/weapons/minelayer/player_minelayer_projectile.gd @@ -0,0 +1,2 @@ +class_name PlayerMinelayerProjectile +extends AbstractMinelayerProjectile diff --git a/game/entities/weapons/minelayer/player_minelayer_projectile.gd.uid b/game/entities/weapons/minelayer/player_minelayer_projectile.gd.uid new file mode 100644 index 0000000..d52e382 --- /dev/null +++ b/game/entities/weapons/minelayer/player_minelayer_projectile.gd.uid @@ -0,0 +1 @@ +uid://cw25lysow3qad diff --git a/game/entities/weapons/minelayer/player_minelayer_projectile.tscn b/game/entities/weapons/minelayer/player_minelayer_projectile.tscn new file mode 100644 index 0000000..84484d3 --- /dev/null +++ b/game/entities/weapons/minelayer/player_minelayer_projectile.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=3 uid="uid://dnculk5rcfxly"] + +[ext_resource type="PackedScene" uid="uid://4mkklqt1g14f" path="res://game/entities/weapons/minelayer/abstract_minelayer_projectile.tscn" id="1_c222g"] +[ext_resource type="Script" uid="uid://cw25lysow3qad" path="res://game/entities/weapons/minelayer/player_minelayer_projectile.gd" id="2_5gcsg"] + +[node name="PlayerMinelayerProjectile" instance=ExtResource("1_c222g")] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("2_5gcsg") +direction = Vector2(1, 0) + +[node name="Blast" parent="." index="4"] +collision_layer = 8 +collision_mask = 4 diff --git a/game/entities/weapons/minelayer/player_minelayer_weapon.gd b/game/entities/weapons/minelayer/player_minelayer_weapon.gd new file mode 100644 index 0000000..c62f2e6 --- /dev/null +++ b/game/entities/weapons/minelayer/player_minelayer_weapon.gd @@ -0,0 +1,2 @@ +class_name PlayerMinelayerWeapon +extends AbstractMinelayerWeapon diff --git a/game/entities/weapons/minelayer/player_minelayer_weapon.gd.uid b/game/entities/weapons/minelayer/player_minelayer_weapon.gd.uid new file mode 100644 index 0000000..4cabb95 --- /dev/null +++ b/game/entities/weapons/minelayer/player_minelayer_weapon.gd.uid @@ -0,0 +1 @@ +uid://c5txlsof4wtk2 diff --git a/game/entities/weapons/minelayer/player_minelayer_weapon.tscn b/game/entities/weapons/minelayer/player_minelayer_weapon.tscn new file mode 100644 index 0000000..2ab4725 --- /dev/null +++ b/game/entities/weapons/minelayer/player_minelayer_weapon.tscn @@ -0,0 +1,76 @@ +[gd_scene load_steps=13 format=3 uid="uid://dxh4m1upio4fx"] + +[ext_resource type="PackedScene" uid="uid://j3yht6q4ru4e" path="res://game/entities/weapons/minelayer/abstract_minelayer_weapon.tscn" id="1_j3u5v"] +[ext_resource type="Script" uid="uid://c5txlsof4wtk2" path="res://game/entities/weapons/minelayer/player_minelayer_weapon.gd" id="2_mvhh7"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="3_mvhh7"] +[ext_resource type="PackedScene" uid="uid://dnculk5rcfxly" path="res://game/entities/weapons/minelayer/player_minelayer_projectile.tscn" id="3_u0als"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_6718t"] +atlas = ExtResource("3_mvhh7") +region = Rect2(0, 128, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wwpdh"] +atlas = ExtResource("3_mvhh7") +region = Rect2(32, 128, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_m6clj"] +atlas = ExtResource("3_mvhh7") +region = Rect2(64, 128, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_tqqar"] +atlas = ExtResource("3_mvhh7") +region = Rect2(96, 128, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mq3tp"] +atlas = ExtResource("3_mvhh7") +region = Rect2(128, 128, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_8yhut"] +atlas = ExtResource("3_mvhh7") +region = Rect2(160, 128, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xddqm"] +atlas = ExtResource("3_mvhh7") +region = Rect2(192, 128, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_u0als"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_6718t") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_wwpdh") +}, { +"duration": 9.0, +"texture": SubResource("AtlasTexture_m6clj") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_tqqar") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_mq3tp") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_8yhut") +}, { +"duration": 2.0, +"texture": SubResource("AtlasTexture_xddqm") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[node name="PlayerMinelayerWeapon" instance=ExtResource("1_j3u5v")] +script = ExtResource("2_mvhh7") +projectile_scene = ExtResource("3_u0als") + +[node name="AnimatedSprite2D" parent="." index="0"] +sprite_frames = SubResource("SpriteFrames_u0als") +animation = &"shot" diff --git a/game/entities/weapons/plasma/abstract_plasma_projectile.gd b/game/entities/weapons/plasma/abstract_plasma_projectile.gd new file mode 100644 index 0000000..e2f7df9 --- /dev/null +++ b/game/entities/weapons/plasma/abstract_plasma_projectile.gd @@ -0,0 +1,2 @@ +class_name AbstractPlasmaProjectile +extends AbstractDirectHitProjectile diff --git a/game/entities/weapons/plasma/plasma_projectile.gd.uid b/game/entities/weapons/plasma/abstract_plasma_projectile.gd.uid similarity index 100% rename from game/entities/weapons/plasma/plasma_projectile.gd.uid rename to game/entities/weapons/plasma/abstract_plasma_projectile.gd.uid diff --git a/game/entities/weapons/plasma/plasma_projectile.tscn b/game/entities/weapons/plasma/abstract_plasma_projectile.tscn similarity index 83% rename from game/entities/weapons/plasma/plasma_projectile.tscn rename to game/entities/weapons/plasma/abstract_plasma_projectile.tscn index 7c8fb3f..f2e8fb0 100644 --- a/game/entities/weapons/plasma/plasma_projectile.tscn +++ b/game/entities/weapons/plasma/abstract_plasma_projectile.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=8 format=3 uid="uid://cgvb0hjrl5h4s"] -[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/direct_hit__projectile.tscn" id="1_x58hw"] -[ext_resource type="Script" uid="uid://bu5sjoh4hwkhn" path="res://game/entities/weapons/plasma/plasma_projectile.gd" id="2_0deih"] -[ext_resource type="Script" uid="uid://c27v705giygv4" path="res://game/health_system/damage/energy_damage.gd" id="3_dlvdm"] +[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/abstract_direct_hit_projectile.tscn" id="1_x58hw"] +[ext_resource type="Script" uid="uid://bu5sjoh4hwkhn" path="res://game/entities/weapons/plasma/abstract_plasma_projectile.gd" id="2_0deih"] +[ext_resource type="Script" uid="uid://c27v705giygv4" path="res://game/data/damage/energy_damage.gd" id="3_dlvdm"] [ext_resource type="Texture2D" uid="uid://dk3t14mrgjmma" path="res://particle_textures/energy_medium.tres" id="4_5enq5"] [sub_resource type="Resource" id="Resource_5enq5"] @@ -24,7 +24,7 @@ angle_max = 180.00002 inherit_velocity_ratio = 0.5 gravity = Vector3(0, 0, 0) -[node name="PlasmaProjectile" instance=ExtResource("1_x58hw")] +[node name="AbstractPlasmaProjectile" instance=ExtResource("1_x58hw")] collision_layer = 0 collision_mask = 0 script = ExtResource("2_0deih") diff --git a/game/entities/weapons/plasma/plasma_weapon.gd b/game/entities/weapons/plasma/abstract_plasma_weapon.gd similarity index 59% rename from game/entities/weapons/plasma/plasma_weapon.gd rename to game/entities/weapons/plasma/abstract_plasma_weapon.gd index 8d70d70..9f11039 100644 --- a/game/entities/weapons/plasma/plasma_weapon.gd +++ b/game/entities/weapons/plasma/abstract_plasma_weapon.gd @@ -1,20 +1,18 @@ +class_name AbstractPlasmaWeapon extends AbstractWeapon @onready var sprite : AnimatedSprite2D = $AnimatedSprite2D @onready var cooldown_timer : Timer = $CooldownTimer - -func set_belonging(belonging: Belonging) -> void: - super.set_belonging(belonging) - - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) +func _ready() -> void: + sprite.play(IDLE_ANIMATION) func shoot(ship_velocity: Vector2) -> bool: var is_shot := super.shoot(ship_velocity) if is_shot: - sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX) + sprite.play(SHOT_ANIMATION) _can_shoot = false cooldown_timer.start() @@ -22,9 +20,9 @@ func shoot(ship_velocity: Vector2) -> bool: func _on_animated_sprite_2d_animation_finished() -> void: - sprite.play(PREFIXES[_belonging] + RELOAD_POSTFIX) + sprite.play(RELOAD_ANIMATION) func _on_cooldown_timer_timeout() -> void: - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) + sprite.play(IDLE_ANIMATION) _can_shoot = true diff --git a/game/entities/weapons/plasma/plasma_weapon.gd.uid b/game/entities/weapons/plasma/abstract_plasma_weapon.gd.uid similarity index 100% rename from game/entities/weapons/plasma/plasma_weapon.gd.uid rename to game/entities/weapons/plasma/abstract_plasma_weapon.gd.uid diff --git a/game/entities/weapons/plasma/abstract_plasma_weapon.tscn b/game/entities/weapons/plasma/abstract_plasma_weapon.tscn new file mode 100644 index 0000000..81f03a3 --- /dev/null +++ b/game/entities/weapons/plasma/abstract_plasma_weapon.tscn @@ -0,0 +1,22 @@ +[gd_scene load_steps=4 format=3 uid="uid://cj1jclfterepm"] + +[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_pkk8e"] +[ext_resource type="Script" uid="uid://cu6ck2oqqdem8" path="res://game/entities/weapons/plasma/abstract_plasma_weapon.gd" id="2_fnsb7"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_j5go4"] + +[node name="AbstractPlasmaWeapon" instance=ExtResource("1_pkk8e")] +script = ExtResource("2_fnsb7") +sector_angle = 2 +type = 2 + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] +sprite_frames = SubResource("SpriteFrames_j5go4") + +[node name="CooldownTimer" type="Timer" parent="." index="1"] +process_callback = 0 +wait_time = 0.4 +one_shot = true + +[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] +[connection signal="timeout" from="CooldownTimer" to="." method="_on_cooldown_timer_timeout"] diff --git a/game/entities/weapons/plasma/enemy_plasma_projectile.gd b/game/entities/weapons/plasma/enemy_plasma_projectile.gd new file mode 100644 index 0000000..8fb4d4c --- /dev/null +++ b/game/entities/weapons/plasma/enemy_plasma_projectile.gd @@ -0,0 +1,2 @@ +class_name EnemyPlasmaProjectile +extends AbstractPlasmaProjectile diff --git a/game/entities/weapons/plasma/enemy_plasma_projectile.gd.uid b/game/entities/weapons/plasma/enemy_plasma_projectile.gd.uid new file mode 100644 index 0000000..a4b1b0a --- /dev/null +++ b/game/entities/weapons/plasma/enemy_plasma_projectile.gd.uid @@ -0,0 +1 @@ +uid://c74fy73pue7dj diff --git a/game/entities/weapons/plasma/enemy_plasma_projectile.tscn b/game/entities/weapons/plasma/enemy_plasma_projectile.tscn new file mode 100644 index 0000000..962d7a3 --- /dev/null +++ b/game/entities/weapons/plasma/enemy_plasma_projectile.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://yr3sadet3ds1"] + +[ext_resource type="PackedScene" uid="uid://cgvb0hjrl5h4s" path="res://game/entities/weapons/plasma/abstract_plasma_projectile.tscn" id="1_mmivs"] +[ext_resource type="Script" uid="uid://c74fy73pue7dj" path="res://game/entities/weapons/plasma/enemy_plasma_projectile.gd" id="2_h1fou"] + +[node name="EnemyPlasmaProjectile" instance=ExtResource("1_mmivs")] +collision_layer = 16 +collision_mask = 2 +script = ExtResource("2_h1fou") +direction = Vector2(-1, 0) diff --git a/game/entities/weapons/plasma/enemy_plasma_weapon.gd b/game/entities/weapons/plasma/enemy_plasma_weapon.gd new file mode 100644 index 0000000..1955abf --- /dev/null +++ b/game/entities/weapons/plasma/enemy_plasma_weapon.gd @@ -0,0 +1,2 @@ +class_name EnemyPlasmaWeapon +extends AbstractPlasmaWeapon diff --git a/game/entities/weapons/plasma/enemy_plasma_weapon.gd.uid b/game/entities/weapons/plasma/enemy_plasma_weapon.gd.uid new file mode 100644 index 0000000..c7b2f65 --- /dev/null +++ b/game/entities/weapons/plasma/enemy_plasma_weapon.gd.uid @@ -0,0 +1 @@ +uid://dliivclhsvxq8 diff --git a/game/entities/weapons/plasma/enemy_plasma_weapon.tscn b/game/entities/weapons/plasma/enemy_plasma_weapon.tscn new file mode 100644 index 0000000..08a98de --- /dev/null +++ b/game/entities/weapons/plasma/enemy_plasma_weapon.tscn @@ -0,0 +1,67 @@ +[gd_scene load_steps=10 format=3 uid="uid://dtl3d7soletdn"] + +[ext_resource type="PackedScene" uid="uid://cj1jclfterepm" path="res://game/entities/weapons/plasma/abstract_plasma_weapon.tscn" id="1_cuvu2"] +[ext_resource type="Script" uid="uid://dliivclhsvxq8" path="res://game/entities/weapons/plasma/enemy_plasma_weapon.gd" id="2_82g15"] +[ext_resource type="PackedScene" uid="uid://yr3sadet3ds1" path="res://game/entities/weapons/plasma/enemy_plasma_projectile.tscn" id="3_82g15"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="3_437d6"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_vj3ee"] +atlas = ExtResource("3_437d6") +region = Rect2(0, 48, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u6d2q"] +atlas = ExtResource("3_437d6") +region = Rect2(96, 48, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ity8s"] +atlas = ExtResource("3_437d6") +region = Rect2(32, 48, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dm1ox"] +atlas = ExtResource("3_437d6") +region = Rect2(64, 48, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_82g15"] +resource_local_to_scene = true +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_vj3ee") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_u6d2q") +}], +"loop": true, +"name": &"reloading", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_ity8s") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_dm1ox") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[node name="EnemyPlasmaWeapon" instance=ExtResource("1_cuvu2")] +script = ExtResource("2_82g15") +sector_angle = 0 +projectile_scene = ExtResource("3_82g15") +type = 0 + +[node name="AnimatedSprite2D" parent="." index="0"] +position = Vector2(-8, 0) +sprite_frames = SubResource("SpriteFrames_82g15") +animation = &"shot" + +[node name="Muzzle" parent="." index="2"] +position = Vector2(-9, -2) diff --git a/game/entities/weapons/plasma/plasma_data.tres b/game/entities/weapons/plasma/plasma_data.tres deleted file mode 100644 index e123d2e..0000000 --- a/game/entities/weapons/plasma/plasma_data.tres +++ /dev/null @@ -1,15 +0,0 @@ -[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://dq0pjpg3slr8s"] - -[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_3fasx"] -[ext_resource type="PackedScene" uid="uid://cj1jclfterepm" path="res://game/entities/weapons/plasma/plasma_weapon.tscn" id="1_rcvob"] - -[resource] -script = ExtResource("1_3fasx") -id = "plasma" -name = "Plasma" -group = "energy" -description = "Moderate damage (energetic) -Moderate firerate -Moderate velocity" -scene = ExtResource("1_rcvob") -metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/entities/weapons/plasma/plasma_projectile.gd b/game/entities/weapons/plasma/plasma_projectile.gd deleted file mode 100644 index 66e9e25..0000000 --- a/game/entities/weapons/plasma/plasma_projectile.gd +++ /dev/null @@ -1,2 +0,0 @@ -class_name PlasmaProjectile -extends DirectHitProjectile diff --git a/game/entities/weapons/plasma/plasma_weapon.tscn b/game/entities/weapons/plasma/plasma_weapon.tscn deleted file mode 100644 index 10e4799..0000000 --- a/game/entities/weapons/plasma/plasma_weapon.tscn +++ /dev/null @@ -1,118 +0,0 @@ -[gd_scene load_steps=14 format=3 uid="uid://cj1jclfterepm"] - -[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_pkk8e"] -[ext_resource type="Script" uid="uid://cu6ck2oqqdem8" path="res://game/entities/weapons/plasma/plasma_weapon.gd" id="2_fnsb7"] -[ext_resource type="PackedScene" uid="uid://cgvb0hjrl5h4s" path="res://game/entities/weapons/plasma/plasma_projectile.tscn" id="2_yluvp"] -[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="6_u6d2q"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_vj3ee"] -atlas = ExtResource("6_u6d2q") -region = Rect2(0, 48, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_u6d2q"] -atlas = ExtResource("6_u6d2q") -region = Rect2(96, 48, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ity8s"] -atlas = ExtResource("6_u6d2q") -region = Rect2(32, 48, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_dm1ox"] -atlas = ExtResource("6_u6d2q") -region = Rect2(64, 48, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_x71d5"] -atlas = ExtResource("6_u6d2q") -region = Rect2(0, 32, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_j64vb"] -atlas = ExtResource("6_u6d2q") -region = Rect2(96, 32, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_pevdi"] -atlas = ExtResource("6_u6d2q") -region = Rect2(32, 32, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_40asj"] -atlas = ExtResource("6_u6d2q") -region = Rect2(64, 32, 32, 16) - -[sub_resource type="SpriteFrames" id="SpriteFrames_hyw35"] -resource_local_to_scene = true -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_vj3ee") -}], -"loop": true, -"name": &"enemy_idle", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_u6d2q") -}], -"loop": true, -"name": &"enemy_reloading", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_ity8s") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_dm1ox") -}], -"loop": false, -"name": &"enemy_shot", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_x71d5") -}], -"loop": true, -"name": &"player_idle", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_j64vb") -}], -"loop": true, -"name": &"player_reloading", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_pevdi") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_40asj") -}], -"loop": false, -"name": &"player_shot", -"speed": 10.0 -}] - -[node name="PlasmaWeapon" instance=ExtResource("1_pkk8e")] -script = ExtResource("2_fnsb7") -sector_angle = 2 -Projectile = ExtResource("2_yluvp") -type = 2 - -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] -position = Vector2(8, 0) -sprite_frames = SubResource("SpriteFrames_hyw35") -animation = &"player_reloading" - -[node name="CooldownTimer" type="Timer" parent="." index="1"] -process_callback = 0 -wait_time = 0.4 -one_shot = true - -[node name="Muzzle" parent="." index="2"] -position = Vector2(9, 2) - -[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] -[connection signal="timeout" from="CooldownTimer" to="." method="_on_cooldown_timer_timeout"] diff --git a/game/entities/weapons/plasma/player_plasma_projectile.gd b/game/entities/weapons/plasma/player_plasma_projectile.gd new file mode 100644 index 0000000..c8e1645 --- /dev/null +++ b/game/entities/weapons/plasma/player_plasma_projectile.gd @@ -0,0 +1,2 @@ +class_name PlayerPlasmaProjectile +extends AbstractPlasmaProjectile diff --git a/game/entities/weapons/plasma/player_plasma_projectile.gd.uid b/game/entities/weapons/plasma/player_plasma_projectile.gd.uid new file mode 100644 index 0000000..13f2730 --- /dev/null +++ b/game/entities/weapons/plasma/player_plasma_projectile.gd.uid @@ -0,0 +1 @@ +uid://c5fn0axm8b3hq diff --git a/game/entities/weapons/plasma/player_plasma_projectile.tscn b/game/entities/weapons/plasma/player_plasma_projectile.tscn new file mode 100644 index 0000000..5f11545 --- /dev/null +++ b/game/entities/weapons/plasma/player_plasma_projectile.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://cnjka7edh3tlt"] + +[ext_resource type="PackedScene" uid="uid://cgvb0hjrl5h4s" path="res://game/entities/weapons/plasma/abstract_plasma_projectile.tscn" id="1_04w4k"] +[ext_resource type="Script" uid="uid://c5fn0axm8b3hq" path="res://game/entities/weapons/plasma/player_plasma_projectile.gd" id="2_7eiay"] + +[node name="PlayerPlasmaProjectile" instance=ExtResource("1_04w4k")] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("2_7eiay") +direction = Vector2(1, 0) diff --git a/game/entities/weapons/plasma/player_plasma_weapon.gd b/game/entities/weapons/plasma/player_plasma_weapon.gd new file mode 100644 index 0000000..6d0e4cb --- /dev/null +++ b/game/entities/weapons/plasma/player_plasma_weapon.gd @@ -0,0 +1,2 @@ +class_name PlayerPlasmaWeapon +extends AbstractPlasmaWeapon diff --git a/game/entities/weapons/plasma/player_plasma_weapon.gd.uid b/game/entities/weapons/plasma/player_plasma_weapon.gd.uid new file mode 100644 index 0000000..6c0184d --- /dev/null +++ b/game/entities/weapons/plasma/player_plasma_weapon.gd.uid @@ -0,0 +1 @@ +uid://btp6bb7dvtxl6 diff --git a/game/entities/weapons/plasma/player_plasma_weapon.tscn b/game/entities/weapons/plasma/player_plasma_weapon.tscn new file mode 100644 index 0000000..81b7cce --- /dev/null +++ b/game/entities/weapons/plasma/player_plasma_weapon.tscn @@ -0,0 +1,64 @@ +[gd_scene load_steps=10 format=3 uid="uid://dd8juohu1x2xo"] + +[ext_resource type="PackedScene" uid="uid://cj1jclfterepm" path="res://game/entities/weapons/plasma/abstract_plasma_weapon.tscn" id="1_ee068"] +[ext_resource type="Script" uid="uid://btp6bb7dvtxl6" path="res://game/entities/weapons/plasma/player_plasma_weapon.gd" id="2_hxkfe"] +[ext_resource type="PackedScene" uid="uid://cnjka7edh3tlt" path="res://game/entities/weapons/plasma/player_plasma_projectile.tscn" id="3_hxkfe"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="3_l4q6k"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_x71d5"] +atlas = ExtResource("3_l4q6k") +region = Rect2(0, 32, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_j64vb"] +atlas = ExtResource("3_l4q6k") +region = Rect2(96, 32, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_pevdi"] +atlas = ExtResource("3_l4q6k") +region = Rect2(32, 32, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_40asj"] +atlas = ExtResource("3_l4q6k") +region = Rect2(64, 32, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_hxkfe"] +resource_local_to_scene = true +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_x71d5") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_j64vb") +}], +"loop": true, +"name": &"reloading", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_pevdi") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_40asj") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[node name="PlayerPlasmaWeapon" instance=ExtResource("1_ee068")] +script = ExtResource("2_hxkfe") +projectile_scene = ExtResource("3_hxkfe") + +[node name="AnimatedSprite2D" parent="." index="0"] +sprite_frames = SubResource("SpriteFrames_hxkfe") +animation = &"shot" + +[node name="Muzzle" parent="." index="2"] +position = Vector2(1, 2) diff --git a/game/entities/weapons/railgun/abstract_railgun_projectile.gd b/game/entities/weapons/railgun/abstract_railgun_projectile.gd new file mode 100644 index 0000000..f858526 --- /dev/null +++ b/game/entities/weapons/railgun/abstract_railgun_projectile.gd @@ -0,0 +1,12 @@ +class_name AbstractRailgunProjectile +extends AbstractDirectHitProjectile + + +@export_range(1, 10) var piercing: int = 1 + + +func _process_hit_for_projectile(_collided_body: Node2D) -> void: + if piercing == 0: + queue_free() + else: + piercing -= 1 diff --git a/game/entities/weapons/railgun/railgun_projectile.gd.uid b/game/entities/weapons/railgun/abstract_railgun_projectile.gd.uid similarity index 100% rename from game/entities/weapons/railgun/railgun_projectile.gd.uid rename to game/entities/weapons/railgun/abstract_railgun_projectile.gd.uid diff --git a/game/entities/weapons/railgun/railgun_projectile.tscn b/game/entities/weapons/railgun/abstract_railgun_projectile.tscn similarity index 58% rename from game/entities/weapons/railgun/railgun_projectile.tscn rename to game/entities/weapons/railgun/abstract_railgun_projectile.tscn index e2d37c5..21b4ee6 100644 --- a/game/entities/weapons/railgun/railgun_projectile.tscn +++ b/game/entities/weapons/railgun/abstract_railgun_projectile.tscn @@ -1,14 +1,13 @@ -[gd_scene load_steps=11 format=3 uid="uid://bab3bopsw74cb"] +[gd_scene load_steps=8 format=3 uid="uid://bab3bopsw74cb"] -[ext_resource type="Script" uid="uid://n3h1e3pj02g0" path="res://game/entities/weapons/railgun/railgun_projectile.gd" id="1_hycpq"] -[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/direct_hit__projectile.tscn" id="1_rfd1j"] -[ext_resource type="Script" uid="uid://bhqvk5cnjg5mv" path="res://game/health_system/damage/kinetic_damage.gd" id="3_wbdf3"] -[ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="4_u82jm"] +[ext_resource type="Script" uid="uid://n3h1e3pj02g0" path="res://game/entities/weapons/railgun/abstract_railgun_projectile.gd" id="1_hycpq"] +[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/abstract_direct_hit_projectile.tscn" id="1_rfd1j"] +[ext_resource type="Script" uid="uid://bhqvk5cnjg5mv" path="res://game/data/damage/kinetic_damage.gd" id="3_wbdf3"] [ext_resource type="Texture2D" uid="uid://c6aixtu6lbfud" path="res://particle_textures/energy_small.tres" id="4_whmfh"] [sub_resource type="Resource" id="Resource_u82jm"] script = ExtResource("3_wbdf3") -value = 45 +value = 50 metadata/_custom_type_script = "uid://bhqvk5cnjg5mv" [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_yedu2"] @@ -26,19 +25,11 @@ turbulence_enabled = true turbulence_noise_strength = 2.0 turbulence_noise_speed_random = 1.0 -[sub_resource type="AtlasTexture" id="AtlasTexture_u82jm"] -atlas = ExtResource("4_u82jm") -region = Rect2(32, 0, 16, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_whmfh"] -atlas = ExtResource("4_u82jm") -region = Rect2(16, 0, 16, 16) - [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_u82jm"] radius = 1.0 height = 8.0 -[node name="RailgunProjectile" instance=ExtResource("1_rfd1j")] +[node name="AbstractRailgunProjectile" instance=ExtResource("1_rfd1j")] collision_layer = 0 collision_mask = 0 script = ExtResource("1_hycpq") @@ -52,11 +43,5 @@ texture = ExtResource("4_whmfh") lifetime = 0.4 process_material = SubResource("ParticleProcessMaterial_yedu2") -[node name="Sprite2D_Left" type="Sprite2D" parent="." index="1"] -texture = SubResource("AtlasTexture_u82jm") - -[node name="Sprite2D_Right" type="Sprite2D" parent="." index="2"] -texture = SubResource("AtlasTexture_whmfh") - -[node name="CollisionShape2D" parent="." index="3"] +[node name="CollisionShape2D" parent="." index="1"] shape = SubResource("CapsuleShape2D_u82jm") diff --git a/game/entities/weapons/railgun/abstract_railgun_weapon.gd b/game/entities/weapons/railgun/abstract_railgun_weapon.gd new file mode 100644 index 0000000..972a88a --- /dev/null +++ b/game/entities/weapons/railgun/abstract_railgun_weapon.gd @@ -0,0 +1,26 @@ +class_name AbstractRailgunWeapon +extends AbstractWeapon + + +@onready var sprite : AnimatedSprite2D = $AnimatedSprite2D + + +func _ready() -> void: + sprite.play(IDLE_ANIMATION) + + +func shoot(ship_velocity: Vector2) -> bool: + var is_shot := super.shoot(ship_velocity) + if is_shot: + sprite.play(SHOT_ANIMATION) + _can_shoot = false + + return is_shot + + +func _on_animated_sprite_2d_animation_finished() -> void: + if sprite.animation == SHOT_ANIMATION: + sprite.play(RELOAD_ANIMATION) + else: + sprite.play(IDLE_ANIMATION) + _can_shoot = true diff --git a/game/entities/weapons/railgun/railgun_weapon.gd.uid b/game/entities/weapons/railgun/abstract_railgun_weapon.gd.uid similarity index 100% rename from game/entities/weapons/railgun/railgun_weapon.gd.uid rename to game/entities/weapons/railgun/abstract_railgun_weapon.gd.uid diff --git a/game/entities/weapons/railgun/abstract_railgun_weapon.tscn b/game/entities/weapons/railgun/abstract_railgun_weapon.tscn new file mode 100644 index 0000000..0cf9909 --- /dev/null +++ b/game/entities/weapons/railgun/abstract_railgun_weapon.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=4 format=3 uid="uid://do6h77gmnreho"] + +[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_0nxvu"] +[ext_resource type="Script" uid="uid://drnofu4ium56e" path="res://game/entities/weapons/railgun/abstract_railgun_weapon.gd" id="1_5nhwg"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_26k3l"] + +[node name="AbstractRailgunWeapon" instance=ExtResource("1_0nxvu")] +script = ExtResource("1_5nhwg") +type = 3 + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] +sprite_frames = SubResource("SpriteFrames_26k3l") + +[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] diff --git a/game/entities/weapons/railgun/enemy_railgun_projectile.gd b/game/entities/weapons/railgun/enemy_railgun_projectile.gd new file mode 100644 index 0000000..6bc3a84 --- /dev/null +++ b/game/entities/weapons/railgun/enemy_railgun_projectile.gd @@ -0,0 +1,2 @@ +class_name EnemyRailgunProjectile +extends AbstractRailgunProjectile diff --git a/game/entities/weapons/railgun/enemy_railgun_projectile.gd.uid b/game/entities/weapons/railgun/enemy_railgun_projectile.gd.uid new file mode 100644 index 0000000..a18346f --- /dev/null +++ b/game/entities/weapons/railgun/enemy_railgun_projectile.gd.uid @@ -0,0 +1 @@ +uid://c8m661bctu67t diff --git a/game/entities/weapons/railgun/enemy_railgun_projectile.tscn b/game/entities/weapons/railgun/enemy_railgun_projectile.tscn new file mode 100644 index 0000000..22c5893 --- /dev/null +++ b/game/entities/weapons/railgun/enemy_railgun_projectile.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=5 format=3 uid="uid://cxcitgofg7nwm"] + +[ext_resource type="PackedScene" uid="uid://bab3bopsw74cb" path="res://game/entities/weapons/railgun/abstract_railgun_projectile.tscn" id="1_gmlv2"] +[ext_resource type="Script" uid="uid://c8m661bctu67t" path="res://game/entities/weapons/railgun/enemy_railgun_projectile.gd" id="2_m4kh0"] +[ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="3_p7y7c"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_u82jm"] +atlas = ExtResource("3_p7y7c") +region = Rect2(32, 0, 16, 16) + +[node name="EnemyRailgunProjectile" instance=ExtResource("1_gmlv2")] +collision_layer = 16 +collision_mask = 2 +script = ExtResource("2_m4kh0") +direction = Vector2(-1, 0) + +[node name="Sprite2D" type="Sprite2D" parent="." index="2"] +texture = SubResource("AtlasTexture_u82jm") diff --git a/game/entities/weapons/railgun/enemy_railgun_weapon.gd b/game/entities/weapons/railgun/enemy_railgun_weapon.gd new file mode 100644 index 0000000..8f956e8 --- /dev/null +++ b/game/entities/weapons/railgun/enemy_railgun_weapon.gd @@ -0,0 +1,2 @@ +class_name EnemyRailgunWeapon +extends AbstractRailgunWeapon diff --git a/game/entities/weapons/railgun/enemy_railgun_weapon.gd.uid b/game/entities/weapons/railgun/enemy_railgun_weapon.gd.uid new file mode 100644 index 0000000..c5cffa4 --- /dev/null +++ b/game/entities/weapons/railgun/enemy_railgun_weapon.gd.uid @@ -0,0 +1 @@ +uid://b0eg0ye5mx8ao diff --git a/game/entities/weapons/railgun/enemy_railgun_weapon.tscn b/game/entities/weapons/railgun/enemy_railgun_weapon.tscn new file mode 100644 index 0000000..0de668a --- /dev/null +++ b/game/entities/weapons/railgun/enemy_railgun_weapon.tscn @@ -0,0 +1,93 @@ +[gd_scene load_steps=14 format=3 uid="uid://chgf0tdlikwlb"] + +[ext_resource type="PackedScene" uid="uid://do6h77gmnreho" path="res://game/entities/weapons/railgun/abstract_railgun_weapon.tscn" id="1_rp2u5"] +[ext_resource type="Script" uid="uid://b0eg0ye5mx8ao" path="res://game/entities/weapons/railgun/enemy_railgun_weapon.gd" id="2_0wswa"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="2_nfcq7"] +[ext_resource type="PackedScene" uid="uid://cxcitgofg7nwm" path="res://game/entities/weapons/railgun/enemy_railgun_projectile.tscn" id="3_0wswa"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_qxcog"] +atlas = ExtResource("2_nfcq7") +region = Rect2(0, 112, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6uyey"] +atlas = ExtResource("2_nfcq7") +region = Rect2(96, 112, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_knads"] +atlas = ExtResource("2_nfcq7") +region = Rect2(128, 112, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jxlhs"] +atlas = ExtResource("2_nfcq7") +region = Rect2(160, 112, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_o0am2"] +atlas = ExtResource("2_nfcq7") +region = Rect2(192, 112, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gxvdx"] +atlas = ExtResource("2_nfcq7") +region = Rect2(224, 112, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_caa1b"] +atlas = ExtResource("2_nfcq7") +region = Rect2(32, 112, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dshqd"] +atlas = ExtResource("2_nfcq7") +region = Rect2(64, 112, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_nfcq7"] +resource_local_to_scene = true +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_qxcog") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 6.0, +"texture": SubResource("AtlasTexture_6uyey") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_knads") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jxlhs") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_o0am2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_gxvdx") +}], +"loop": false, +"name": &"reloading", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_caa1b") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_dshqd") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[node name="EnemyRailgunWeapon" instance=ExtResource("1_rp2u5")] +script = ExtResource("2_0wswa") +projectile_scene = ExtResource("3_0wswa") + +[node name="AnimatedSprite2D" parent="." index="0"] +position = Vector2(-5, 0) +sprite_frames = SubResource("SpriteFrames_nfcq7") +animation = &"reloading" + +[node name="Muzzle" parent="." index="1"] +position = Vector2(-11, 0) diff --git a/game/entities/weapons/railgun/player_railgun_projectile.gd b/game/entities/weapons/railgun/player_railgun_projectile.gd new file mode 100644 index 0000000..1415316 --- /dev/null +++ b/game/entities/weapons/railgun/player_railgun_projectile.gd @@ -0,0 +1,2 @@ +class_name PlayerRailgunProjectile +extends AbstractRailgunProjectile diff --git a/game/entities/weapons/railgun/player_railgun_projectile.gd.uid b/game/entities/weapons/railgun/player_railgun_projectile.gd.uid new file mode 100644 index 0000000..2a07f38 --- /dev/null +++ b/game/entities/weapons/railgun/player_railgun_projectile.gd.uid @@ -0,0 +1 @@ +uid://51vaxrloo65r diff --git a/game/entities/weapons/railgun/player_railgun_projectile.tscn b/game/entities/weapons/railgun/player_railgun_projectile.tscn new file mode 100644 index 0000000..94b3ead --- /dev/null +++ b/game/entities/weapons/railgun/player_railgun_projectile.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=5 format=3 uid="uid://cgq4yobd2bq5l"] + +[ext_resource type="PackedScene" uid="uid://bab3bopsw74cb" path="res://game/entities/weapons/railgun/abstract_railgun_projectile.tscn" id="1_xytr4"] +[ext_resource type="Script" uid="uid://51vaxrloo65r" path="res://game/entities/weapons/railgun/player_railgun_projectile.gd" id="2_sy2xa"] +[ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="3_xm7by"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_whmfh"] +atlas = ExtResource("3_xm7by") +region = Rect2(16, 0, 16, 16) + +[node name="PlayerRailgunProjectile" instance=ExtResource("1_xytr4")] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("2_sy2xa") +direction = Vector2(1, 0) + +[node name="Sprite2D" type="Sprite2D" parent="." index="3"] +texture = SubResource("AtlasTexture_whmfh") diff --git a/game/entities/weapons/railgun/player_railgun_weapon.gd b/game/entities/weapons/railgun/player_railgun_weapon.gd new file mode 100644 index 0000000..80cb56c --- /dev/null +++ b/game/entities/weapons/railgun/player_railgun_weapon.gd @@ -0,0 +1,2 @@ +class_name PlayerRailgunWeapon +extends AbstractRailgunWeapon diff --git a/game/entities/weapons/railgun/player_railgun_weapon.gd.uid b/game/entities/weapons/railgun/player_railgun_weapon.gd.uid new file mode 100644 index 0000000..e69459f --- /dev/null +++ b/game/entities/weapons/railgun/player_railgun_weapon.gd.uid @@ -0,0 +1 @@ +uid://dixftp6f0w8ss diff --git a/game/entities/weapons/railgun/player_railgun_weapon.tscn b/game/entities/weapons/railgun/player_railgun_weapon.tscn new file mode 100644 index 0000000..4fa0893 --- /dev/null +++ b/game/entities/weapons/railgun/player_railgun_weapon.tscn @@ -0,0 +1,93 @@ +[gd_scene load_steps=14 format=3 uid="uid://b745401et1bom"] + +[ext_resource type="PackedScene" uid="uid://do6h77gmnreho" path="res://game/entities/weapons/railgun/abstract_railgun_weapon.tscn" id="1_1bsls"] +[ext_resource type="Script" uid="uid://dixftp6f0w8ss" path="res://game/entities/weapons/railgun/player_railgun_weapon.gd" id="2_cw8e6"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="2_yykqk"] +[ext_resource type="PackedScene" uid="uid://cgq4yobd2bq5l" path="res://game/entities/weapons/railgun/player_railgun_projectile.tscn" id="3_cw8e6"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_12cl3"] +atlas = ExtResource("2_yykqk") +region = Rect2(0, 96, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_q6uk7"] +atlas = ExtResource("2_yykqk") +region = Rect2(96, 96, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ggjt2"] +atlas = ExtResource("2_yykqk") +region = Rect2(128, 96, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jra8e"] +atlas = ExtResource("2_yykqk") +region = Rect2(160, 96, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hqd47"] +atlas = ExtResource("2_yykqk") +region = Rect2(192, 96, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_hu0my"] +atlas = ExtResource("2_yykqk") +region = Rect2(224, 96, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kjbu2"] +atlas = ExtResource("2_yykqk") +region = Rect2(32, 96, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_2g4rr"] +atlas = ExtResource("2_yykqk") +region = Rect2(64, 96, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_yykqk"] +resource_local_to_scene = true +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_12cl3") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 6.0, +"texture": SubResource("AtlasTexture_q6uk7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ggjt2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_jra8e") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hqd47") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_hu0my") +}], +"loop": false, +"name": &"reloading", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_kjbu2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_2g4rr") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[node name="PlayerRailgunWeapon" instance=ExtResource("1_1bsls")] +script = ExtResource("2_cw8e6") +projectile_scene = ExtResource("3_cw8e6") + +[node name="AnimatedSprite2D" parent="." index="0"] +position = Vector2(5, 0) +sprite_frames = SubResource("SpriteFrames_yykqk") +animation = &"idle" + +[node name="Muzzle" parent="." index="1"] +position = Vector2(11, 0) diff --git a/game/entities/weapons/railgun/railgun_data.tres b/game/entities/weapons/railgun/railgun_data.tres deleted file mode 100644 index 7451b57..0000000 --- a/game/entities/weapons/railgun/railgun_data.tres +++ /dev/null @@ -1,16 +0,0 @@ -[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://dtpk5apjti4vh"] - -[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_6lcn5"] -[ext_resource type="PackedScene" uid="uid://do6h77gmnreho" path="res://game/entities/weapons/railgun/railgun_weapon.tscn" id="1_cbt0i"] - -[resource] -script = ExtResource("1_6lcn5") -id = "railgun" -name = "Railgun" -group = "kinetic" -description = "High damage (kinetic) -Low firerate -High velocity -Can pierce enemies" -scene = ExtResource("1_cbt0i") -metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/entities/weapons/railgun/railgun_projectile.gd b/game/entities/weapons/railgun/railgun_projectile.gd deleted file mode 100644 index db3a704..0000000 --- a/game/entities/weapons/railgun/railgun_projectile.gd +++ /dev/null @@ -1,32 +0,0 @@ -class_name RailgunProjectile -extends DirectHitProjectile - - -@export_range(1, 10) var piercing: int = 1 - - -@onready var sprite_left := $Sprite2D_Left -@onready var sprite_right := $Sprite2D_Right - - -func _ready() -> void: - super._ready() - _update_sprite(_velocity) - - -func _update_sprite(velocity: Vector2) -> void: - var angle := posmod(floor(rad_to_deg(velocity.angle())), 360) - - if angle > 90 and angle < 270: - sprite_left.show() - sprite_right.hide() - else: - sprite_left.hide() - sprite_right.show() - - -func _process_hit_for_projectile(_collided_body: Node2D) -> void: - if piercing == 0: - queue_free() - else: - piercing -= 1 diff --git a/game/entities/weapons/railgun/railgun_weapon.gd b/game/entities/weapons/railgun/railgun_weapon.gd deleted file mode 100644 index 1807b45..0000000 --- a/game/entities/weapons/railgun/railgun_weapon.gd +++ /dev/null @@ -1,27 +0,0 @@ -extends AbstractWeapon - - -@onready var sprite : AnimatedSprite2D = $AnimatedSprite2D - - -func set_belonging(belonging: Belonging) -> void: - super.set_belonging(belonging) - - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) - - -func shoot(ship_velocity: Vector2) -> bool: - var is_shot := super.shoot(ship_velocity) - if is_shot: - sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX) - _can_shoot = false - - return is_shot - - -func _on_animated_sprite_2d_animation_finished() -> void: - if sprite.animation.ends_with(SHOT_POSTFIX): - sprite.play(PREFIXES[_belonging] + RELOAD_POSTFIX) - else: - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) - _can_shoot = true diff --git a/game/entities/weapons/railgun/railgun_weapon.tscn b/game/entities/weapons/railgun/railgun_weapon.tscn deleted file mode 100644 index e6cb591..0000000 --- a/game/entities/weapons/railgun/railgun_weapon.tscn +++ /dev/null @@ -1,167 +0,0 @@ -[gd_scene load_steps=22 format=3 uid="uid://do6h77gmnreho"] - -[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_0nxvu"] -[ext_resource type="Script" uid="uid://drnofu4ium56e" path="res://game/entities/weapons/railgun/railgun_weapon.gd" id="1_5nhwg"] -[ext_resource type="PackedScene" uid="uid://bab3bopsw74cb" path="res://game/entities/weapons/railgun/railgun_projectile.tscn" id="2_cbsia"] -[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_qxcog"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_qxcog"] -atlas = ExtResource("4_qxcog") -region = Rect2(0, 112, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_6uyey"] -atlas = ExtResource("4_qxcog") -region = Rect2(96, 112, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_knads"] -atlas = ExtResource("4_qxcog") -region = Rect2(128, 112, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jxlhs"] -atlas = ExtResource("4_qxcog") -region = Rect2(160, 112, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_o0am2"] -atlas = ExtResource("4_qxcog") -region = Rect2(192, 112, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_gxvdx"] -atlas = ExtResource("4_qxcog") -region = Rect2(224, 112, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_caa1b"] -atlas = ExtResource("4_qxcog") -region = Rect2(32, 112, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_dshqd"] -atlas = ExtResource("4_qxcog") -region = Rect2(64, 112, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_12cl3"] -atlas = ExtResource("4_qxcog") -region = Rect2(0, 96, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_q6uk7"] -atlas = ExtResource("4_qxcog") -region = Rect2(96, 96, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ggjt2"] -atlas = ExtResource("4_qxcog") -region = Rect2(128, 96, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_jra8e"] -atlas = ExtResource("4_qxcog") -region = Rect2(160, 96, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_hqd47"] -atlas = ExtResource("4_qxcog") -region = Rect2(192, 96, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_hu0my"] -atlas = ExtResource("4_qxcog") -region = Rect2(224, 96, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_kjbu2"] -atlas = ExtResource("4_qxcog") -region = Rect2(32, 96, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_2g4rr"] -atlas = ExtResource("4_qxcog") -region = Rect2(64, 96, 32, 16) - -[sub_resource type="SpriteFrames" id="SpriteFrames_caa1b"] -resource_local_to_scene = true -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_qxcog") -}], -"loop": true, -"name": &"enemy_idle", -"speed": 10.0 -}, { -"frames": [{ -"duration": 6.0, -"texture": SubResource("AtlasTexture_6uyey") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_knads") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jxlhs") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_o0am2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_gxvdx") -}], -"loop": false, -"name": &"enemy_reloading", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_caa1b") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_dshqd") -}], -"loop": false, -"name": &"enemy_shot", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_12cl3") -}], -"loop": true, -"name": &"player_idle", -"speed": 10.0 -}, { -"frames": [{ -"duration": 6.0, -"texture": SubResource("AtlasTexture_q6uk7") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ggjt2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_jra8e") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_hqd47") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_hu0my") -}], -"loop": false, -"name": &"player_reloading", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_kjbu2") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_2g4rr") -}], -"loop": false, -"name": &"player_shot", -"speed": 10.0 -}] - -[node name="RailgunWeapon" instance=ExtResource("1_0nxvu")] -script = ExtResource("1_5nhwg") -Projectile = ExtResource("2_cbsia") -type = 3 - -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] -position = Vector2(5, 0) -sprite_frames = SubResource("SpriteFrames_caa1b") -animation = &"enemy_reloading" - -[node name="Muzzle" parent="." index="1"] -position = Vector2(11, 0) - -[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] diff --git a/game/entities/weapons/shrapnel/shrapnel_projectile.gd b/game/entities/weapons/shrapnel/abstract_shrapnel_projectile.gd similarity index 82% rename from game/entities/weapons/shrapnel/shrapnel_projectile.gd rename to game/entities/weapons/shrapnel/abstract_shrapnel_projectile.gd index 04c5c61..c613017 100644 --- a/game/entities/weapons/shrapnel/shrapnel_projectile.gd +++ b/game/entities/weapons/shrapnel/abstract_shrapnel_projectile.gd @@ -1,5 +1,5 @@ -class_name ShrapnelProjectile -extends DirectHitProjectile +class_name AbstractShrapnelProjectile +extends AbstractDirectHitProjectile @export var max_distance : int diff --git a/game/entities/weapons/shrapnel/shrapnel_projectile.gd.uid b/game/entities/weapons/shrapnel/abstract_shrapnel_projectile.gd.uid similarity index 100% rename from game/entities/weapons/shrapnel/shrapnel_projectile.gd.uid rename to game/entities/weapons/shrapnel/abstract_shrapnel_projectile.gd.uid diff --git a/game/entities/weapons/shrapnel/shrapnel_projectile.tscn b/game/entities/weapons/shrapnel/abstract_shrapnel_projectile.tscn similarity index 78% rename from game/entities/weapons/shrapnel/shrapnel_projectile.tscn rename to game/entities/weapons/shrapnel/abstract_shrapnel_projectile.tscn index f82803b..c0a19b2 100644 --- a/game/entities/weapons/shrapnel/shrapnel_projectile.tscn +++ b/game/entities/weapons/shrapnel/abstract_shrapnel_projectile.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=8 format=3 uid="uid://bsx23u3a2obbj"] -[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/direct_hit__projectile.tscn" id="1_yu2c6"] -[ext_resource type="Script" uid="uid://ctnje7pjanaws" path="res://game/entities/weapons/shrapnel/shrapnel_projectile.gd" id="2_2jiy6"] -[ext_resource type="Script" uid="uid://bhqvk5cnjg5mv" path="res://game/health_system/damage/kinetic_damage.gd" id="3_kj16s"] +[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/abstract_direct_hit_projectile.tscn" id="1_yu2c6"] +[ext_resource type="Script" uid="uid://ctnje7pjanaws" path="res://game/entities/weapons/shrapnel/abstract_shrapnel_projectile.gd" id="2_2jiy6"] +[ext_resource type="Script" uid="uid://bhqvk5cnjg5mv" path="res://game/data/damage/kinetic_damage.gd" id="3_kj16s"] [ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="4_klguu"] [sub_resource type="Resource" id="Resource_klguu"] @@ -17,7 +17,7 @@ region = Rect2(48, 0, 16, 16) [sub_resource type="CircleShape2D" id="CircleShape2D_2jiy6"] radius = 1.0 -[node name="ShrapnelProjectile" instance=ExtResource("1_yu2c6")] +[node name="AbstractShrapnelProjectile" instance=ExtResource("1_yu2c6")] collision_layer = 0 collision_mask = 0 script = ExtResource("2_2jiy6") diff --git a/game/entities/weapons/shrapnel/shrapnel_weapon.gd b/game/entities/weapons/shrapnel/abstract_shrapnel_weapon.gd similarity index 73% rename from game/entities/weapons/shrapnel/shrapnel_weapon.gd rename to game/entities/weapons/shrapnel/abstract_shrapnel_weapon.gd index f394ac5..11f44de 100644 --- a/game/entities/weapons/shrapnel/shrapnel_weapon.gd +++ b/game/entities/weapons/shrapnel/abstract_shrapnel_weapon.gd @@ -1,3 +1,4 @@ +class_name AbstractShrapnelWeapon extends AbstractWeapon @@ -7,16 +8,14 @@ extends AbstractWeapon @onready var shell_particles : GPUParticles2D = $ShellParticles -func set_belonging(belonging: Belonging) -> void: - super.set_belonging(belonging) - - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) +func _ready() -> void: + sprite.play(IDLE_ANIMATION) func shoot(ship_velocity: Vector2) -> bool: var is_shot := super.shoot(ship_velocity) if is_shot: - sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX) + sprite.play(SHOT_ANIMATION) _can_shoot = false cooldown_timer.start() shot_particles.restart() @@ -26,7 +25,7 @@ func shoot(ship_velocity: Vector2) -> bool: func _on_animated_sprite_2d_animation_finished() -> void: - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) + sprite.play(IDLE_ANIMATION) func _on_cooldown_timer_timeout() -> void: diff --git a/game/entities/weapons/shrapnel/shrapnel_weapon.gd.uid b/game/entities/weapons/shrapnel/abstract_shrapnel_weapon.gd.uid similarity index 100% rename from game/entities/weapons/shrapnel/shrapnel_weapon.gd.uid rename to game/entities/weapons/shrapnel/abstract_shrapnel_weapon.gd.uid diff --git a/game/entities/weapons/shrapnel/abstract_shrapnel_weapon.tscn b/game/entities/weapons/shrapnel/abstract_shrapnel_weapon.tscn new file mode 100644 index 0000000..1998815 --- /dev/null +++ b/game/entities/weapons/shrapnel/abstract_shrapnel_weapon.tscn @@ -0,0 +1,65 @@ +[gd_scene load_steps=8 format=3 uid="uid://r7wnk762jbfy"] + +[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_xk300"] +[ext_resource type="Script" uid="uid://gxwbsiicuqh5" path="res://game/entities/weapons/shrapnel/abstract_shrapnel_weapon.gd" id="2_1bd18"] +[ext_resource type="Texture2D" uid="uid://b2tpy3y2bpuat" path="res://particle_textures/flame_small.tres" id="4_0tw2i"] +[ext_resource type="Texture2D" uid="uid://dxcxybr27kkra" path="res://particle_textures/shell_medium.tres" id="6_gdolk"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_a22j7"] +resource_local_to_scene = true +lifetime_randomness = 0.5 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 2.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +spread = 60.0 +initial_velocity_min = 10.0 +initial_velocity_max = 15.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="SpriteFrames" id="SpriteFrames_asm6v"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_t57yr"] +resource_local_to_scene = true +particle_flag_disable_z = true +inherit_velocity_ratio = 0.5 +direction = Vector3(0, 1, 0) +spread = 15.0 +initial_velocity_min = 15.0 +initial_velocity_max = 25.0 +gravity = Vector3(0, 0, 0) + +[node name="AbstractShrapnelWeapon" instance=ExtResource("1_xk300")] +script = ExtResource("2_1bd18") +bullet_per_shot = 20 +sector_angle = 30 +type = 1 + +[node name="ShotParticles" type="GPUParticles2D" parent="." index="0"] +emitting = false +amount = 32 +texture = ExtResource("4_0tw2i") +lifetime = 0.3 +one_shot = true +process_material = SubResource("ParticleProcessMaterial_a22j7") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"] +sprite_frames = SubResource("SpriteFrames_asm6v") + +[node name="ShellParticles" type="GPUParticles2D" parent="." index="2"] +z_index = 1 +emitting = false +amount = 15 +texture = ExtResource("6_gdolk") +lifetime = 3.0 +one_shot = true +process_material = SubResource("ParticleProcessMaterial_t57yr") + +[node name="CooldownTimer" type="Timer" parent="." index="3"] +wait_time = 0.6 +one_shot = true + +[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] +[connection signal="timeout" from="CooldownTimer" to="." method="_on_cooldown_timer_timeout"] diff --git a/game/entities/weapons/shrapnel/enemy_shrapnel_projectile.gd b/game/entities/weapons/shrapnel/enemy_shrapnel_projectile.gd new file mode 100644 index 0000000..ae4499e --- /dev/null +++ b/game/entities/weapons/shrapnel/enemy_shrapnel_projectile.gd @@ -0,0 +1,2 @@ +class_name EnemyShrapnelProjectile +extends AbstractShrapnelProjectile diff --git a/game/entities/weapons/shrapnel/enemy_shrapnel_projectile.gd.uid b/game/entities/weapons/shrapnel/enemy_shrapnel_projectile.gd.uid new file mode 100644 index 0000000..6f8c613 --- /dev/null +++ b/game/entities/weapons/shrapnel/enemy_shrapnel_projectile.gd.uid @@ -0,0 +1 @@ +uid://c803i8oaj4dgp diff --git a/game/entities/weapons/shrapnel/enemy_shrapnel_projectile.tscn b/game/entities/weapons/shrapnel/enemy_shrapnel_projectile.tscn new file mode 100644 index 0000000..ff0a86c --- /dev/null +++ b/game/entities/weapons/shrapnel/enemy_shrapnel_projectile.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://bmusx2hpk7m76"] + +[ext_resource type="PackedScene" uid="uid://bsx23u3a2obbj" path="res://game/entities/weapons/shrapnel/abstract_shrapnel_projectile.tscn" id="1_6xicu"] +[ext_resource type="Script" uid="uid://c803i8oaj4dgp" path="res://game/entities/weapons/shrapnel/enemy_shrapnel_projectile.gd" id="2_ir0ih"] + +[node name="EnemyShrapnelProjectile" instance=ExtResource("1_6xicu")] +collision_layer = 16 +collision_mask = 2 +script = ExtResource("2_ir0ih") +direction = Vector2(-1, 0) diff --git a/game/entities/weapons/shrapnel/enemy_shrapnel_weapon.gd b/game/entities/weapons/shrapnel/enemy_shrapnel_weapon.gd new file mode 100644 index 0000000..00783bd --- /dev/null +++ b/game/entities/weapons/shrapnel/enemy_shrapnel_weapon.gd @@ -0,0 +1,2 @@ +class_name EnemyShrapnelWeapon +extends AbstractShrapnelWeapon diff --git a/game/entities/weapons/shrapnel/enemy_shrapnel_weapon.gd.uid b/game/entities/weapons/shrapnel/enemy_shrapnel_weapon.gd.uid new file mode 100644 index 0000000..c1cc08e --- /dev/null +++ b/game/entities/weapons/shrapnel/enemy_shrapnel_weapon.gd.uid @@ -0,0 +1 @@ +uid://d30syotjwdwlu diff --git a/game/entities/weapons/shrapnel/enemy_shrapnel_weapon.tscn b/game/entities/weapons/shrapnel/enemy_shrapnel_weapon.tscn new file mode 100644 index 0000000..50b72e3 --- /dev/null +++ b/game/entities/weapons/shrapnel/enemy_shrapnel_weapon.tscn @@ -0,0 +1,92 @@ +[gd_scene load_steps=12 format=3 uid="uid://df816hasxkglk"] + +[ext_resource type="PackedScene" uid="uid://r7wnk762jbfy" path="res://game/entities/weapons/shrapnel/abstract_shrapnel_weapon.tscn" id="1_1p630"] +[ext_resource type="Script" uid="uid://d30syotjwdwlu" path="res://game/entities/weapons/shrapnel/enemy_shrapnel_weapon.gd" id="2_ttncl"] +[ext_resource type="PackedScene" uid="uid://bmusx2hpk7m76" path="res://game/entities/weapons/shrapnel/enemy_shrapnel_projectile.tscn" id="3_p5apf"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_ctn2a"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_ctn2a"] +resource_local_to_scene = true +lifetime_randomness = 0.5 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 2.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +direction = Vector3(-1, 0, 0) +spread = 60.0 +initial_velocity_min = 10.0 +initial_velocity_max = 15.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="AtlasTexture" id="AtlasTexture_gdolk"] +atlas = ExtResource("4_ctn2a") +region = Rect2(128, 48, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_a22j7"] +atlas = ExtResource("4_ctn2a") +region = Rect2(160, 48, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_t57yr"] +atlas = ExtResource("4_ctn2a") +region = Rect2(192, 48, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_cogj5"] +atlas = ExtResource("4_ctn2a") +region = Rect2(224, 48, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_fcnom"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_gdolk") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_a22j7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_t57yr") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_cogj5") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_fcnom"] +resource_local_to_scene = true +particle_flag_disable_z = true +inherit_velocity_ratio = 0.5 +direction = Vector3(0, -1, 0) +spread = 5.0 +initial_velocity_min = 15.0 +initial_velocity_max = 25.0 +gravity = Vector3(0, 0, 0) + +[node name="EnemyShrapnelWeapon" instance=ExtResource("1_1p630")] +script = ExtResource("2_ttncl") +projectile_scene = ExtResource("3_p5apf") + +[node name="ShotParticles" parent="." index="0"] +position = Vector2(-18, 0) +process_material = SubResource("ParticleProcessMaterial_ctn2a") + +[node name="AnimatedSprite2D" parent="." index="1"] +position = Vector2(-7, 0) +sprite_frames = SubResource("SpriteFrames_fcnom") +animation = &"idle" + +[node name="ShellParticles" parent="." index="2"] +position = Vector2(0, -3) +process_material = SubResource("ParticleProcessMaterial_fcnom") + +[node name="Muzzle" parent="." index="4"] +position = Vector2(-14, 0) diff --git a/game/entities/weapons/shrapnel/player_shrapnel_projectile.gd b/game/entities/weapons/shrapnel/player_shrapnel_projectile.gd new file mode 100644 index 0000000..9939790 --- /dev/null +++ b/game/entities/weapons/shrapnel/player_shrapnel_projectile.gd @@ -0,0 +1,2 @@ +class_name PlayerShrapnelProjectile +extends AbstractShrapnelProjectile diff --git a/game/entities/weapons/shrapnel/player_shrapnel_projectile.gd.uid b/game/entities/weapons/shrapnel/player_shrapnel_projectile.gd.uid new file mode 100644 index 0000000..8111a7c --- /dev/null +++ b/game/entities/weapons/shrapnel/player_shrapnel_projectile.gd.uid @@ -0,0 +1 @@ +uid://cfngvotdmb1fj diff --git a/game/entities/weapons/shrapnel/player_shrapnel_projectile.tscn b/game/entities/weapons/shrapnel/player_shrapnel_projectile.tscn new file mode 100644 index 0000000..316d837 --- /dev/null +++ b/game/entities/weapons/shrapnel/player_shrapnel_projectile.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=3 uid="uid://cswhydwmia3fh"] + +[ext_resource type="PackedScene" uid="uid://bsx23u3a2obbj" path="res://game/entities/weapons/shrapnel/abstract_shrapnel_projectile.tscn" id="1_q8vdx"] +[ext_resource type="Script" uid="uid://cfngvotdmb1fj" path="res://game/entities/weapons/shrapnel/player_shrapnel_projectile.gd" id="2_3sxqk"] + +[node name="PlayerShrapnelProjectile" instance=ExtResource("1_q8vdx")] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("2_3sxqk") +direction = Vector2(1, 0) diff --git a/game/entities/weapons/shrapnel/player_shrapnel_weapon.gd b/game/entities/weapons/shrapnel/player_shrapnel_weapon.gd new file mode 100644 index 0000000..2d18418 --- /dev/null +++ b/game/entities/weapons/shrapnel/player_shrapnel_weapon.gd @@ -0,0 +1,2 @@ +class_name PlayerShrapnelWeapon +extends AbstractShrapnelWeapon diff --git a/game/entities/weapons/shrapnel/player_shrapnel_weapon.gd.uid b/game/entities/weapons/shrapnel/player_shrapnel_weapon.gd.uid new file mode 100644 index 0000000..27347c1 --- /dev/null +++ b/game/entities/weapons/shrapnel/player_shrapnel_weapon.gd.uid @@ -0,0 +1 @@ +uid://b4nr6mwn11xx6 diff --git a/game/entities/weapons/shrapnel/player_shrapnel_weapon.tscn b/game/entities/weapons/shrapnel/player_shrapnel_weapon.tscn new file mode 100644 index 0000000..ab6743f --- /dev/null +++ b/game/entities/weapons/shrapnel/player_shrapnel_weapon.tscn @@ -0,0 +1,91 @@ +[gd_scene load_steps=12 format=3 uid="uid://cvtwks2ooetxp"] + +[ext_resource type="PackedScene" uid="uid://r7wnk762jbfy" path="res://game/entities/weapons/shrapnel/abstract_shrapnel_weapon.tscn" id="1_fhgjq"] +[ext_resource type="Script" uid="uid://b4nr6mwn11xx6" path="res://game/entities/weapons/shrapnel/player_shrapnel_weapon.gd" id="2_kcdeu"] +[ext_resource type="PackedScene" uid="uid://cswhydwmia3fh" path="res://game/entities/weapons/shrapnel/player_shrapnel_projectile.tscn" id="3_kcdeu"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_kupqk"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_kcdeu"] +resource_local_to_scene = true +lifetime_randomness = 0.5 +particle_flag_disable_z = true +emission_shape = 1 +emission_sphere_radius = 2.0 +angle_min = -179.99998 +angle_max = 180.00002 +inherit_velocity_ratio = 0.5 +spread = 60.0 +initial_velocity_min = 10.0 +initial_velocity_max = 15.0 +gravity = Vector3(0, 0, 0) + +[sub_resource type="AtlasTexture" id="AtlasTexture_t4pcy"] +atlas = ExtResource("4_kupqk") +region = Rect2(128, 32, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_25rnd"] +atlas = ExtResource("4_kupqk") +region = Rect2(160, 32, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_02grq"] +atlas = ExtResource("4_kupqk") +region = Rect2(192, 32, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6pv2s"] +atlas = ExtResource("4_kupqk") +region = Rect2(224, 32, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_867ok"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_t4pcy") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_25rnd") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_02grq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_6pv2s") +}], +"loop": false, +"name": &"shot", +"speed": 10.0 +}] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_kupqk"] +resource_local_to_scene = true +particle_flag_disable_z = true +inherit_velocity_ratio = 0.5 +direction = Vector3(0, 1, 0) +spread = 5.0 +initial_velocity_min = 15.0 +initial_velocity_max = 25.0 +gravity = Vector3(0, 0, 0) + +[node name="PlayerShrapnelWeapon" instance=ExtResource("1_fhgjq")] +script = ExtResource("2_kcdeu") +projectile_scene = ExtResource("3_kcdeu") + +[node name="ShotParticles" parent="." index="0"] +position = Vector2(18, 0) +process_material = SubResource("ParticleProcessMaterial_kcdeu") + +[node name="AnimatedSprite2D" parent="." index="1"] +position = Vector2(7, 0) +sprite_frames = SubResource("SpriteFrames_867ok") +animation = &"idle" + +[node name="ShellParticles" parent="." index="2"] +position = Vector2(-1, 1) +process_material = SubResource("ParticleProcessMaterial_kupqk") + +[node name="Muzzle" parent="." index="4"] +position = Vector2(14, 0) diff --git a/game/entities/weapons/shrapnel/shrapnel_data.tres b/game/entities/weapons/shrapnel/shrapnel_data.tres deleted file mode 100644 index 3e74dfd..0000000 --- a/game/entities/weapons/shrapnel/shrapnel_data.tres +++ /dev/null @@ -1,17 +0,0 @@ -[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://d1kc2gvye2f28"] - -[ext_resource type="PackedScene" uid="uid://r7wnk762jbfy" path="res://game/entities/weapons/shrapnel/shrapnel_weapon.tscn" id="1_8lpql"] -[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_xds2o"] - -[resource] -script = ExtResource("1_xds2o") -id = "shrapnel" -name = "Shrapnel" -group = "kinetic" -description = "High damage (kinetic) -Moderate firerate -Moderate velocity -Short range -Multiple projectiles" -scene = ExtResource("1_8lpql") -metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/entities/weapons/shrapnel/shrapnel_weapon.tscn b/game/entities/weapons/shrapnel/shrapnel_weapon.tscn deleted file mode 100644 index ad8277c..0000000 --- a/game/entities/weapons/shrapnel/shrapnel_weapon.tscn +++ /dev/null @@ -1,152 +0,0 @@ -[gd_scene load_steps=18 format=3 uid="uid://r7wnk762jbfy"] - -[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_xk300"] -[ext_resource type="Script" uid="uid://gxwbsiicuqh5" path="res://game/entities/weapons/shrapnel/shrapnel_weapon.gd" id="2_1bd18"] -[ext_resource type="PackedScene" uid="uid://bsx23u3a2obbj" path="res://game/entities/weapons/shrapnel/shrapnel_projectile.tscn" id="2_xvd4y"] -[ext_resource type="Texture2D" uid="uid://b2tpy3y2bpuat" path="res://particle_textures/flame_small.tres" id="4_0tw2i"] -[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="6_0tw2i"] -[ext_resource type="Texture2D" uid="uid://dxcxybr27kkra" path="res://particle_textures/shell_medium.tres" id="6_gdolk"] - -[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_a22j7"] -resource_local_to_scene = true -lifetime_randomness = 0.5 -particle_flag_disable_z = true -emission_shape = 1 -emission_sphere_radius = 2.0 -angle_min = -179.99998 -angle_max = 180.00002 -inherit_velocity_ratio = 0.5 -spread = 60.0 -initial_velocity_min = 10.0 -initial_velocity_max = 15.0 -gravity = Vector3(0, 0, 0) - -[sub_resource type="AtlasTexture" id="AtlasTexture_gdolk"] -atlas = ExtResource("6_0tw2i") -region = Rect2(128, 48, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_a22j7"] -atlas = ExtResource("6_0tw2i") -region = Rect2(160, 48, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_t57yr"] -atlas = ExtResource("6_0tw2i") -region = Rect2(192, 48, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_cogj5"] -atlas = ExtResource("6_0tw2i") -region = Rect2(224, 48, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_t4pcy"] -atlas = ExtResource("6_0tw2i") -region = Rect2(128, 32, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_25rnd"] -atlas = ExtResource("6_0tw2i") -region = Rect2(160, 32, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_02grq"] -atlas = ExtResource("6_0tw2i") -region = Rect2(192, 32, 32, 16) - -[sub_resource type="AtlasTexture" id="AtlasTexture_6pv2s"] -atlas = ExtResource("6_0tw2i") -region = Rect2(224, 32, 32, 16) - -[sub_resource type="SpriteFrames" id="SpriteFrames_he4pe"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_gdolk") -}], -"loop": true, -"name": &"enemy_idle", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_a22j7") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_t57yr") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_cogj5") -}], -"loop": false, -"name": &"enemy_shot", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_t4pcy") -}], -"loop": true, -"name": &"player_idle", -"speed": 10.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_25rnd") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_02grq") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_6pv2s") -}], -"loop": false, -"name": &"player_shot", -"speed": 10.0 -}] - -[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_t57yr"] -resource_local_to_scene = true -particle_flag_disable_z = true -inherit_velocity_ratio = 0.5 -direction = Vector3(0, 1, 0) -spread = 15.0 -initial_velocity_min = 15.0 -initial_velocity_max = 25.0 -gravity = Vector3(0, 0, 0) - -[node name="ShrapnelWeapon" instance=ExtResource("1_xk300")] -script = ExtResource("2_1bd18") -bullet_per_shot = 20 -sector_angle = 30 -Projectile = ExtResource("2_xvd4y") -type = 1 - -[node name="ShotParticles" type="GPUParticles2D" parent="." index="0"] -position = Vector2(17, 0) -emitting = false -amount = 32 -texture = ExtResource("4_0tw2i") -lifetime = 0.3 -one_shot = true -process_material = SubResource("ParticleProcessMaterial_a22j7") - -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"] -position = Vector2(7, 0) -sprite_frames = SubResource("SpriteFrames_he4pe") -animation = &"player_shot" - -[node name="ShellParticles" type="GPUParticles2D" parent="." index="2"] -z_index = 1 -position = Vector2(-1, 1) -emitting = false -amount = 15 -texture = ExtResource("6_gdolk") -lifetime = 3.0 -one_shot = true -process_material = SubResource("ParticleProcessMaterial_t57yr") - -[node name="CooldownTimer" type="Timer" parent="." index="3"] -wait_time = 0.6 -one_shot = true - -[node name="Muzzle" parent="." index="4"] -position = Vector2(14, 0) - -[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] -[connection signal="timeout" from="CooldownTimer" to="." method="_on_cooldown_timer_timeout"] diff --git a/game/entities/weapons/tesla/tesla_projectile.gd b/game/entities/weapons/tesla/abstract_tesla_projectile.gd similarity index 96% rename from game/entities/weapons/tesla/tesla_projectile.gd rename to game/entities/weapons/tesla/abstract_tesla_projectile.gd index 6b8a12d..6800703 100644 --- a/game/entities/weapons/tesla/tesla_projectile.gd +++ b/game/entities/weapons/tesla/abstract_tesla_projectile.gd @@ -1,5 +1,5 @@ -class_name TeslaProjectile -extends DirectHitProjectile +class_name AbstractTeslaProjectile +extends AbstractDirectHitProjectile @export_range(0.01, 0.5) var jink_min_delay: float = 0.01 diff --git a/game/entities/weapons/tesla/tesla_projectile.gd.uid b/game/entities/weapons/tesla/abstract_tesla_projectile.gd.uid similarity index 100% rename from game/entities/weapons/tesla/tesla_projectile.gd.uid rename to game/entities/weapons/tesla/abstract_tesla_projectile.gd.uid diff --git a/game/entities/weapons/tesla/tesla_projectile.tscn b/game/entities/weapons/tesla/abstract_tesla_projectile.tscn similarity index 90% rename from game/entities/weapons/tesla/tesla_projectile.tscn rename to game/entities/weapons/tesla/abstract_tesla_projectile.tscn index 0d3bce5..538fb25 100644 --- a/game/entities/weapons/tesla/tesla_projectile.tscn +++ b/game/entities/weapons/tesla/abstract_tesla_projectile.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=11 format=3 uid="uid://bi64687wtxi4d"] -[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/direct_hit__projectile.tscn" id="1_1oexk"] -[ext_resource type="Script" uid="uid://bxcoa2eps0tt1" path="res://game/entities/weapons/tesla/tesla_projectile.gd" id="2_q73is"] -[ext_resource type="Script" uid="uid://c27v705giygv4" path="res://game/health_system/damage/energy_damage.gd" id="3_l65ib"] +[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/abstract_direct_hit_projectile.tscn" id="1_1oexk"] +[ext_resource type="Script" uid="uid://bxcoa2eps0tt1" path="res://game/entities/weapons/tesla/abstract_tesla_projectile.gd" id="2_q73is"] +[ext_resource type="Script" uid="uid://c27v705giygv4" path="res://game/data/damage/energy_damage.gd" id="3_l65ib"] [ext_resource type="Texture2D" uid="uid://cqdctagygc0c0" path="res://particle_textures/energy_large.tres" id="4_1121u"] [ext_resource type="Texture2D" uid="uid://d2k7bcwqr5v2q" path="res://particle_textures/energy_huge.tres" id="4_wtuxv"] [ext_resource type="Texture2D" uid="uid://dk3t14mrgjmma" path="res://particle_textures/energy_medium.tres" id="5_wtuxv"] @@ -30,7 +30,7 @@ initial_velocity_max = 1.0 gravity = Vector3(0, 0, 0) turbulence_enabled = true -[node name="TeslaProjectile" instance=ExtResource("1_1oexk")] +[node name="AbstractTeslaProjectile" instance=ExtResource("1_1oexk")] collision_layer = 0 collision_mask = 0 script = ExtResource("2_q73is") diff --git a/game/entities/weapons/tesla/tesla_weapon.gd b/game/entities/weapons/tesla/abstract_tesla_weapon.gd similarity index 73% rename from game/entities/weapons/tesla/tesla_weapon.gd rename to game/entities/weapons/tesla/abstract_tesla_weapon.gd index d6c4d03..fa80024 100644 --- a/game/entities/weapons/tesla/tesla_weapon.gd +++ b/game/entities/weapons/tesla/abstract_tesla_weapon.gd @@ -1,14 +1,12 @@ +class_name AbstractTeslaWeapon extends AbstractWeapon @onready var sprite : AnimatedSprite2D = $AnimatedSprite2D @onready var cooldown_timer : Timer = $CooldownTimer - -func set_belonging(belonging: Belonging) -> void: - super.set_belonging(belonging) - - sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) +func _ready() -> void: + sprite.play(IDLE_ANIMATION) func shoot(ship_velocity: Vector2) -> bool: diff --git a/game/entities/weapons/tesla/tesla_weapon.gd.uid b/game/entities/weapons/tesla/abstract_tesla_weapon.gd.uid similarity index 100% rename from game/entities/weapons/tesla/tesla_weapon.gd.uid rename to game/entities/weapons/tesla/abstract_tesla_weapon.gd.uid diff --git a/game/entities/weapons/tesla/tesla_weapon.tscn b/game/entities/weapons/tesla/abstract_tesla_weapon.tscn similarity index 92% rename from game/entities/weapons/tesla/tesla_weapon.tscn rename to game/entities/weapons/tesla/abstract_tesla_weapon.tscn index e53ea55..44e18de 100644 --- a/game/entities/weapons/tesla/tesla_weapon.tscn +++ b/game/entities/weapons/tesla/abstract_tesla_weapon.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=24 format=3 uid="uid://dyebeblayioji"] +[gd_scene load_steps=23 format=3 uid="uid://dyebeblayioji"] [ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_rpud7"] -[ext_resource type="PackedScene" uid="uid://bi64687wtxi4d" path="res://game/entities/weapons/tesla/tesla_projectile.tscn" id="2_1rrdy"] -[ext_resource type="Script" uid="uid://ctv408wdwvttc" path="res://game/entities/weapons/tesla/tesla_weapon.gd" id="2_08si3"] +[ext_resource type="Script" uid="uid://ctv408wdwvttc" path="res://game/entities/weapons/tesla/abstract_tesla_weapon.gd" id="2_08si3"] [ext_resource type="Texture2D" uid="uid://c6aixtu6lbfud" path="res://particle_textures/energy_small.tres" id="5_dhfvk"] [ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="7_ub67s"] @@ -142,10 +141,9 @@ initial_velocity_min = 15.0 initial_velocity_max = 25.0 gravity = Vector3(0, 0, 0) -[node name="TeslaWeapon" instance=ExtResource("1_rpud7")] +[node name="AbstractTeslaWeapon" instance=ExtResource("1_rpud7")] script = ExtResource("2_08si3") sector_angle = 10 -Projectile = ExtResource("2_1rrdy") type = 4 [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0"] diff --git a/game/entities/weapons/tesla/enemy_tesla_projectile.gd b/game/entities/weapons/tesla/enemy_tesla_projectile.gd new file mode 100644 index 0000000..c2c2cea --- /dev/null +++ b/game/entities/weapons/tesla/enemy_tesla_projectile.gd @@ -0,0 +1,2 @@ +class_name EnemyTeslaProjectile +extends AbstractTeslaProjectile diff --git a/game/entities/weapons/tesla/enemy_tesla_projectile.gd.uid b/game/entities/weapons/tesla/enemy_tesla_projectile.gd.uid new file mode 100644 index 0000000..4117174 --- /dev/null +++ b/game/entities/weapons/tesla/enemy_tesla_projectile.gd.uid @@ -0,0 +1 @@ +uid://c23oegr5fvmwl diff --git a/game/entities/weapons/tesla/enemy_tesla_projectile.tscn b/game/entities/weapons/tesla/enemy_tesla_projectile.tscn new file mode 100644 index 0000000..6c18c48 --- /dev/null +++ b/game/entities/weapons/tesla/enemy_tesla_projectile.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=5 format=3 uid="uid://cpqpc1h3egvid"] + +[ext_resource type="PackedScene" uid="uid://bi64687wtxi4d" path="res://game/entities/weapons/tesla/abstract_tesla_projectile.tscn" id="1_om3b2"] +[ext_resource type="Script" uid="uid://c27v705giygv4" path="res://game/data/damage/energy_damage.gd" id="2_d0a42"] +[ext_resource type="Script" uid="uid://c23oegr5fvmwl" path="res://game/entities/weapons/tesla/enemy_tesla_projectile.gd" id="2_fxxjv"] + +[sub_resource type="Resource" id="Resource_fxxjv"] +resource_local_to_scene = true +script = ExtResource("2_d0a42") +value = 30 +metadata/_custom_type_script = "uid://c27v705giygv4" + +[node name="EnemyTeslaProjectile" instance=ExtResource("1_om3b2")] +collision_layer = 16 +collision_mask = 2 +script = ExtResource("2_fxxjv") +damage = SubResource("Resource_fxxjv") +direction = Vector2(-1, 0) diff --git a/game/entities/weapons/tesla/enemy_tesla_weapon.gd b/game/entities/weapons/tesla/enemy_tesla_weapon.gd new file mode 100644 index 0000000..cf08699 --- /dev/null +++ b/game/entities/weapons/tesla/enemy_tesla_weapon.gd @@ -0,0 +1,2 @@ +class_name EnemyTeslaWeapon +extends AbstractTeslaWeapon diff --git a/game/entities/weapons/tesla/enemy_tesla_weapon.gd.uid b/game/entities/weapons/tesla/enemy_tesla_weapon.gd.uid new file mode 100644 index 0000000..2d9ed9f --- /dev/null +++ b/game/entities/weapons/tesla/enemy_tesla_weapon.gd.uid @@ -0,0 +1 @@ +uid://ermhuy56qrok diff --git a/game/entities/weapons/tesla/enemy_tesla_weapon.tscn b/game/entities/weapons/tesla/enemy_tesla_weapon.tscn new file mode 100644 index 0000000..7d56804 --- /dev/null +++ b/game/entities/weapons/tesla/enemy_tesla_weapon.tscn @@ -0,0 +1,78 @@ +[gd_scene load_steps=14 format=3 uid="uid://dqgybquvuw0v6"] + +[ext_resource type="PackedScene" uid="uid://dyebeblayioji" path="res://game/entities/weapons/tesla/abstract_tesla_weapon.tscn" id="1_k6lmk"] +[ext_resource type="Script" uid="uid://ermhuy56qrok" path="res://game/entities/weapons/tesla/enemy_tesla_weapon.gd" id="2_cxr41"] +[ext_resource type="PackedScene" uid="uid://cpqpc1h3egvid" path="res://game/entities/weapons/tesla/enemy_tesla_projectile.tscn" id="3_i0gkc"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_b2pb7"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_ucdpq"] +atlas = ExtResource("4_b2pb7") +region = Rect2(0, 16, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ifsj2"] +atlas = ExtResource("4_b2pb7") +region = Rect2(32, 16, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_x1fov"] +atlas = ExtResource("4_b2pb7") +region = Rect2(64, 16, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_u727i"] +atlas = ExtResource("4_b2pb7") +region = Rect2(96, 16, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_l8rch"] +atlas = ExtResource("4_b2pb7") +region = Rect2(128, 16, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w3n8b"] +atlas = ExtResource("4_b2pb7") +region = Rect2(160, 16, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_4xemq"] +atlas = ExtResource("4_b2pb7") +region = Rect2(192, 16, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ekb5u"] +atlas = ExtResource("4_b2pb7") +region = Rect2(224, 16, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_sv7dk"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_ucdpq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ifsj2") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_x1fov") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_u727i") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_l8rch") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_w3n8b") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_4xemq") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ekb5u") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}] + +[node name="EnemyTeslaWeapon" instance=ExtResource("1_k6lmk")] +script = ExtResource("2_cxr41") +projectile_scene = ExtResource("3_i0gkc") + +[node name="AnimatedSprite2D" parent="." index="0"] +sprite_frames = SubResource("SpriteFrames_sv7dk") +animation = &"idle" diff --git a/game/entities/weapons/tesla/player_tesla_projectile.gd b/game/entities/weapons/tesla/player_tesla_projectile.gd new file mode 100644 index 0000000..0e29146 --- /dev/null +++ b/game/entities/weapons/tesla/player_tesla_projectile.gd @@ -0,0 +1,2 @@ +class_name PlayerTeslaProjectile +extends AbstractTeslaProjectile diff --git a/game/entities/weapons/tesla/player_tesla_projectile.gd.uid b/game/entities/weapons/tesla/player_tesla_projectile.gd.uid new file mode 100644 index 0000000..d40cbe0 --- /dev/null +++ b/game/entities/weapons/tesla/player_tesla_projectile.gd.uid @@ -0,0 +1 @@ +uid://d2afef30y5oa7 diff --git a/game/entities/weapons/tesla/player_tesla_projectile.tscn b/game/entities/weapons/tesla/player_tesla_projectile.tscn new file mode 100644 index 0000000..fa2ac30 --- /dev/null +++ b/game/entities/weapons/tesla/player_tesla_projectile.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=5 format=3 uid="uid://bvrsk14t6m061"] + +[ext_resource type="PackedScene" uid="uid://bi64687wtxi4d" path="res://game/entities/weapons/tesla/abstract_tesla_projectile.tscn" id="1_t7qf7"] +[ext_resource type="Script" uid="uid://c27v705giygv4" path="res://game/data/damage/energy_damage.gd" id="2_mk8o6"] +[ext_resource type="Script" uid="uid://d2afef30y5oa7" path="res://game/entities/weapons/tesla/player_tesla_projectile.gd" id="2_yocnc"] + +[sub_resource type="Resource" id="Resource_yocnc"] +resource_local_to_scene = true +script = ExtResource("2_mk8o6") +value = 30 +metadata/_custom_type_script = "uid://c27v705giygv4" + +[node name="PlayerTeslaProjectile" instance=ExtResource("1_t7qf7")] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("2_yocnc") +damage = SubResource("Resource_yocnc") +direction = Vector2(1, 0) diff --git a/game/entities/weapons/tesla/player_tesla_weapon.gd b/game/entities/weapons/tesla/player_tesla_weapon.gd new file mode 100644 index 0000000..79786c9 --- /dev/null +++ b/game/entities/weapons/tesla/player_tesla_weapon.gd @@ -0,0 +1,2 @@ +class_name PlayerTeslaWeapon +extends AbstractTeslaWeapon diff --git a/game/entities/weapons/tesla/player_tesla_weapon.gd.uid b/game/entities/weapons/tesla/player_tesla_weapon.gd.uid new file mode 100644 index 0000000..bfbe3a3 --- /dev/null +++ b/game/entities/weapons/tesla/player_tesla_weapon.gd.uid @@ -0,0 +1 @@ +uid://d2qtsjtu56c21 diff --git a/game/entities/weapons/tesla/player_tesla_weapon.tscn b/game/entities/weapons/tesla/player_tesla_weapon.tscn new file mode 100644 index 0000000..d25fa1f --- /dev/null +++ b/game/entities/weapons/tesla/player_tesla_weapon.tscn @@ -0,0 +1,78 @@ +[gd_scene load_steps=14 format=3 uid="uid://u6hpohk5i3eu"] + +[ext_resource type="PackedScene" uid="uid://dyebeblayioji" path="res://game/entities/weapons/tesla/abstract_tesla_weapon.tscn" id="1_0i0tl"] +[ext_resource type="Script" uid="uid://d2qtsjtu56c21" path="res://game/entities/weapons/tesla/player_tesla_weapon.gd" id="2_ve1yj"] +[ext_resource type="PackedScene" uid="uid://bvrsk14t6m061" path="res://game/entities/weapons/tesla/player_tesla_projectile.tscn" id="3_io2od"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_mjxwr"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_7ksu7"] +atlas = ExtResource("4_mjxwr") +region = Rect2(0, 0, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_14sqy"] +atlas = ExtResource("4_mjxwr") +region = Rect2(32, 0, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_57vww"] +atlas = ExtResource("4_mjxwr") +region = Rect2(64, 0, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ook02"] +atlas = ExtResource("4_mjxwr") +region = Rect2(96, 0, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_w4veo"] +atlas = ExtResource("4_mjxwr") +region = Rect2(128, 0, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xa0we"] +atlas = ExtResource("4_mjxwr") +region = Rect2(160, 0, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_50pvw"] +atlas = ExtResource("4_mjxwr") +region = Rect2(192, 0, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vagjq"] +atlas = ExtResource("4_mjxwr") +region = Rect2(224, 0, 32, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_sjgub"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": SubResource("AtlasTexture_7ksu7") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_14sqy") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_57vww") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ook02") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_w4veo") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_xa0we") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_50pvw") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_vagjq") +}], +"loop": true, +"name": &"idle", +"speed": 10.0 +}] + +[node name="PlayerTeslaWeapon" instance=ExtResource("1_0i0tl")] +script = ExtResource("2_ve1yj") +projectile_scene = ExtResource("3_io2od") + +[node name="AnimatedSprite2D" parent="." index="0"] +sprite_frames = SubResource("SpriteFrames_sjgub") +animation = &"idle" diff --git a/game/entities/weapons/tesla/tesla_data.tres b/game/entities/weapons/tesla/tesla_data.tres deleted file mode 100644 index db770b2..0000000 --- a/game/entities/weapons/tesla/tesla_data.tres +++ /dev/null @@ -1,17 +0,0 @@ -[gd_resource type="Resource" script_class="WeaponData" load_steps=3 format=3 uid="uid://c7tim0uie3m35"] - -[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/world/data/weapon_data.gd" id="1_a16gw"] -[ext_resource type="PackedScene" uid="uid://dyebeblayioji" path="res://game/entities/weapons/tesla/tesla_weapon.tscn" id="1_uxb6m"] - -[resource] -script = ExtResource("1_a16gw") -id = "tesla" -name = "Tesla" -group = "energy" -description = "Moderate damage (energetic) -Low firerate -High velocity -Hits nearest target -Can pierce enemies" -scene = ExtResource("1_uxb6m") -metadata/_custom_type_script = "uid://870r1efinhqd" diff --git a/game/background.gd b/game/entities/world/background.gd similarity index 100% rename from game/background.gd rename to game/entities/world/background.gd diff --git a/game/background.gd.uid b/game/entities/world/background.gd.uid similarity index 100% rename from game/background.gd.uid rename to game/entities/world/background.gd.uid diff --git a/game/background.tscn b/game/entities/world/background.tscn similarity index 96% rename from game/background.tscn rename to game/entities/world/background.tscn index 2e6a64d..9a8868b 100644 --- a/game/background.tscn +++ b/game/entities/world/background.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=6 format=3 uid="uid://chdrjc7c6bdpb"] -[ext_resource type="Script" uid="uid://ddp4unooscflj" path="res://game/background.gd" id="1_fypbl"] +[ext_resource type="Script" uid="uid://ddp4unooscflj" path="res://game/entities/world/background.gd" id="1_fypbl"] [ext_resource type="Texture2D" uid="uid://mvcnpsfsyiq6" path="res://images/passage/background.png" id="1_hvye4"] [sub_resource type="AtlasTexture" id="AtlasTexture_yetnv"] diff --git a/game/game.gd b/game/entities/world/game.gd similarity index 95% rename from game/game.gd rename to game/entities/world/game.gd index e852819..5d9d001 100644 --- a/game/game.gd +++ b/game/entities/world/game.gd @@ -2,9 +2,9 @@ class_name Game extends Node -const PASSAGE = preload("res://game/passage.tscn") +const PASSAGE = preload("res://game/entities/world/passage.tscn") const AREA_MAP = preload("res://game/area_map/area_map.tscn") -const WEAPON_SELECTION_SCREEN = preload("res://menu/ingame/weapon_selection_screen.tscn") +const WEAPON_SELECTION_SCREEN = preload("res://game/menu/ingame/weapon_selection_screen.tscn") var world_data : WorldData @@ -149,7 +149,7 @@ func _show_main_menu() -> void: SaveManager.save() get_tree().paused = false - get_tree().change_scene_to_file("res://menu/main/title_screen.tscn") + get_tree().change_scene_to_file("res://game/menu/main/title_screen.tscn") func _on_passage_player_died() -> void: diff --git a/game/game.gd.uid b/game/entities/world/game.gd.uid similarity index 100% rename from game/game.gd.uid rename to game/entities/world/game.gd.uid diff --git a/game/game.tscn b/game/entities/world/game.tscn similarity index 83% rename from game/game.tscn rename to game/entities/world/game.tscn index 392162c..ba0bd02 100644 --- a/game/game.tscn +++ b/game/entities/world/game.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=6 format=3 uid="uid://dl7m4rqyj8mck"] -[ext_resource type="Script" uid="uid://1wfu4iuddo25" path="res://game/game.gd" id="1_l1rk1"] -[ext_resource type="PackedScene" uid="uid://d34nh3lc1gpb" path="res://menu/ingame/pause_screen.tscn" id="2_h7iqs"] -[ext_resource type="PackedScene" uid="uid://duxm8n62j2qt6" path="res://menu/ingame/game_over_screen.tscn" id="4_4fuuu"] -[ext_resource type="PackedScene" uid="uid://bdcs2ff85qjs4" path="res://menu/ingame/victory_screen.tscn" id="4_dxrkv"] -[ext_resource type="PackedScene" uid="uid://ggf76ayl53bb" path="res://game/world/generators/world_generator.tscn" id="5_dxrkv"] +[ext_resource type="Script" uid="uid://1wfu4iuddo25" path="res://game/entities/world/game.gd" id="1_l1rk1"] +[ext_resource type="PackedScene" uid="uid://d34nh3lc1gpb" path="res://game/menu/ingame/pause_screen.tscn" id="2_h7iqs"] +[ext_resource type="PackedScene" uid="uid://duxm8n62j2qt6" path="res://game/menu/ingame/game_over_screen.tscn" id="4_4fuuu"] +[ext_resource type="PackedScene" uid="uid://bdcs2ff85qjs4" path="res://game/menu/ingame/victory_screen.tscn" id="4_dxrkv"] +[ext_resource type="PackedScene" uid="uid://ggf76ayl53bb" path="res://game/generators/world_generator.tscn" id="5_dxrkv"] [node name="Game" type="Node2D"] script = ExtResource("1_l1rk1") diff --git a/game/passage.gd b/game/entities/world/passage.gd similarity index 100% rename from game/passage.gd rename to game/entities/world/passage.gd diff --git a/game/passage.gd.uid b/game/entities/world/passage.gd.uid similarity index 100% rename from game/passage.gd.uid rename to game/entities/world/passage.gd.uid diff --git a/game/passage.tscn b/game/entities/world/passage.tscn similarity index 96% rename from game/passage.tscn rename to game/entities/world/passage.tscn index 93abef5..6a334e9 100644 --- a/game/passage.tscn +++ b/game/entities/world/passage.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=9 format=3 uid="uid://dgc0087kvarx6"] -[ext_resource type="Script" uid="uid://c6gpm3edyr4nu" path="res://game/passage.gd" id="1_ltkyg"] +[ext_resource type="Script" uid="uid://c6gpm3edyr4nu" path="res://game/entities/world/passage.gd" id="1_ltkyg"] [ext_resource type="PackedScene" uid="uid://cpn5x0ijgl7ei" path="res://game/controllers/enemy_swamp_controller.tscn" id="2_72vqi"] [ext_resource type="PackedScene" uid="uid://br074cqcnul3d" path="res://game/entities/ships/player/player_ship.tscn" id="3_r3x05"] -[ext_resource type="PackedScene" uid="uid://chdrjc7c6bdpb" path="res://game/background.tscn" id="4_cuj01"] +[ext_resource type="PackedScene" uid="uid://chdrjc7c6bdpb" path="res://game/entities/world/background.tscn" id="4_cuj01"] [ext_resource type="Texture2D" uid="uid://d1n7qejdcrpkf" path="res://images/passage_process.png" id="5_yetnv"] [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_ltkyg"] diff --git a/game/world/generators/area_generator.gd b/game/generators/area_generator.gd similarity index 100% rename from game/world/generators/area_generator.gd rename to game/generators/area_generator.gd diff --git a/game/world/generators/area_generator.gd.uid b/game/generators/area_generator.gd.uid similarity index 100% rename from game/world/generators/area_generator.gd.uid rename to game/generators/area_generator.gd.uid diff --git a/game/world/generators/area_generator.tscn b/game/generators/area_generator.tscn similarity index 71% rename from game/world/generators/area_generator.tscn rename to game/generators/area_generator.tscn index ed43870..754da43 100644 --- a/game/world/generators/area_generator.tscn +++ b/game/generators/area_generator.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=3 uid="uid://c4l1cv3o25lhv"] -[ext_resource type="Script" uid="uid://bcq74qwnbylg2" path="res://game/world/generators/area_generator.gd" id="1_hahgo"] -[ext_resource type="PackedScene" uid="uid://bn4r4f3str55v" path="res://game/world/generators/stage_generator.tscn" id="2_b1pkv"] -[ext_resource type="PackedScene" uid="uid://cfcpr07j58cvx" path="res://game/world/generators/passage_generator.tscn" id="3_q2vfj"] +[ext_resource type="Script" uid="uid://bcq74qwnbylg2" path="res://game/generators/area_generator.gd" id="1_hahgo"] +[ext_resource type="PackedScene" uid="uid://bn4r4f3str55v" path="res://game/generators/stage_generator.tscn" id="2_b1pkv"] +[ext_resource type="PackedScene" uid="uid://cfcpr07j58cvx" path="res://game/generators/passage_generator.tscn" id="3_q2vfj"] [node name="AreaGenerator" type="Node"] script = ExtResource("1_hahgo") diff --git a/game/world/generators/enemy_generator.gd b/game/generators/enemy_generator.gd similarity index 100% rename from game/world/generators/enemy_generator.gd rename to game/generators/enemy_generator.gd diff --git a/game/world/generators/enemy_generator.gd.uid b/game/generators/enemy_generator.gd.uid similarity index 100% rename from game/world/generators/enemy_generator.gd.uid rename to game/generators/enemy_generator.gd.uid diff --git a/game/world/generators/enemy_generator.tscn b/game/generators/enemy_generator.tscn similarity index 77% rename from game/world/generators/enemy_generator.tscn rename to game/generators/enemy_generator.tscn index e7586ea..e0637b7 100644 --- a/game/world/generators/enemy_generator.tscn +++ b/game/generators/enemy_generator.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://bqtiiog23c2ta"] -[ext_resource type="Script" uid="uid://r51oawb6oedw" path="res://game/world/generators/enemy_generator.gd" id="1_ehucw"] +[ext_resource type="Script" uid="uid://r51oawb6oedw" path="res://game/generators/enemy_generator.gd" id="1_ehucw"] [node name="EnemyGenerator" type="Node"] script = ExtResource("1_ehucw") diff --git a/game/world/generators/passage_generator.gd b/game/generators/passage_generator.gd similarity index 100% rename from game/world/generators/passage_generator.gd rename to game/generators/passage_generator.gd diff --git a/game/world/generators/passage_generator.gd.uid b/game/generators/passage_generator.gd.uid similarity index 100% rename from game/world/generators/passage_generator.gd.uid rename to game/generators/passage_generator.gd.uid diff --git a/game/world/generators/passage_generator.tscn b/game/generators/passage_generator.tscn similarity index 72% rename from game/world/generators/passage_generator.tscn rename to game/generators/passage_generator.tscn index ad28679..145e9bd 100644 --- a/game/world/generators/passage_generator.tscn +++ b/game/generators/passage_generator.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://cfcpr07j58cvx"] -[ext_resource type="Script" uid="uid://bi5vt3ikxya8d" path="res://game/world/generators/passage_generator.gd" id="1_3arab"] -[ext_resource type="PackedScene" uid="uid://bqtiiog23c2ta" path="res://game/world/generators/enemy_generator.tscn" id="2_u6kxl"] +[ext_resource type="Script" uid="uid://bi5vt3ikxya8d" path="res://game/generators/passage_generator.gd" id="1_3arab"] +[ext_resource type="PackedScene" uid="uid://bqtiiog23c2ta" path="res://game/generators/enemy_generator.tscn" id="2_u6kxl"] [node name="PassageGenerator" type="Node"] script = ExtResource("1_3arab") diff --git a/game/world/generators/sector_generator.gd b/game/generators/sector_generator.gd similarity index 100% rename from game/world/generators/sector_generator.gd rename to game/generators/sector_generator.gd diff --git a/game/world/generators/sector_generator.gd.uid b/game/generators/sector_generator.gd.uid similarity index 100% rename from game/world/generators/sector_generator.gd.uid rename to game/generators/sector_generator.gd.uid diff --git a/game/world/generators/sector_generator.tscn b/game/generators/sector_generator.tscn similarity index 77% rename from game/world/generators/sector_generator.tscn rename to game/generators/sector_generator.tscn index 6fc6306..cf023ca 100644 --- a/game/world/generators/sector_generator.tscn +++ b/game/generators/sector_generator.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://bh1v37wol5ktj"] -[ext_resource type="Script" uid="uid://de386hpwwum7o" path="res://game/world/generators/sector_generator.gd" id="1_trjpu"] +[ext_resource type="Script" uid="uid://de386hpwwum7o" path="res://game/generators/sector_generator.gd" id="1_trjpu"] [node name="SectorGenerator" type="Node"] script = ExtResource("1_trjpu") diff --git a/game/world/generators/stage_generator.gd b/game/generators/stage_generator.gd similarity index 100% rename from game/world/generators/stage_generator.gd rename to game/generators/stage_generator.gd diff --git a/game/world/generators/stage_generator.gd.uid b/game/generators/stage_generator.gd.uid similarity index 100% rename from game/world/generators/stage_generator.gd.uid rename to game/generators/stage_generator.gd.uid diff --git a/game/world/generators/stage_generator.tscn b/game/generators/stage_generator.tscn similarity index 73% rename from game/world/generators/stage_generator.tscn rename to game/generators/stage_generator.tscn index f795616..4b3bbe3 100644 --- a/game/world/generators/stage_generator.tscn +++ b/game/generators/stage_generator.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bn4r4f3str55v"] -[ext_resource type="Script" uid="uid://jn0w7kgstq1j" path="res://game/world/generators/stage_generator.gd" id="1_7pxno"] -[ext_resource type="PackedScene" uid="uid://bh1v37wol5ktj" path="res://game/world/generators/sector_generator.tscn" id="2_etmdi"] +[ext_resource type="Script" uid="uid://jn0w7kgstq1j" path="res://game/generators/stage_generator.gd" id="1_7pxno"] +[ext_resource type="PackedScene" uid="uid://bh1v37wol5ktj" path="res://game/generators/sector_generator.tscn" id="2_etmdi"] [node name="StageGenerator" type="Node"] script = ExtResource("1_7pxno") diff --git a/game/world/generators/world_generator.gd b/game/generators/world_generator.gd similarity index 100% rename from game/world/generators/world_generator.gd rename to game/generators/world_generator.gd diff --git a/game/world/generators/world_generator.gd.uid b/game/generators/world_generator.gd.uid similarity index 100% rename from game/world/generators/world_generator.gd.uid rename to game/generators/world_generator.gd.uid diff --git a/game/world/generators/world_generator.tscn b/game/generators/world_generator.tscn similarity index 73% rename from game/world/generators/world_generator.tscn rename to game/generators/world_generator.tscn index 0be9c0e..7513619 100644 --- a/game/world/generators/world_generator.tscn +++ b/game/generators/world_generator.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://ggf76ayl53bb"] -[ext_resource type="Script" uid="uid://b7e3xk14le68j" path="res://game/world/generators/world_generator.gd" id="1_c1jvo"] -[ext_resource type="PackedScene" uid="uid://c4l1cv3o25lhv" path="res://game/world/generators/area_generator.tscn" id="2_exe4n"] +[ext_resource type="Script" uid="uid://b7e3xk14le68j" path="res://game/generators/world_generator.gd" id="1_c1jvo"] +[ext_resource type="PackedScene" uid="uid://c4l1cv3o25lhv" path="res://game/generators/area_generator.tscn" id="2_exe4n"] [node name="WorldGenerator" type="Node"] script = ExtResource("1_c1jvo") diff --git a/managers/save_manager.gd b/game/managers/save_manager.gd similarity index 82% rename from managers/save_manager.gd rename to game/managers/save_manager.gd index 2327149..3bfb6d6 100644 --- a/managers/save_manager.gd +++ b/game/managers/save_manager.gd @@ -2,15 +2,15 @@ extends Node const WEAPONS : Array[WeaponData] = [ - preload("res://game/entities/weapons/cannon/cannon_data.tres"), - preload("res://game/entities/weapons/gatling/gatling_data.tres"), - preload("res://game/entities/weapons/laser/laser_data.tres"), - preload("res://game/entities/weapons/launcher/launcher_data.tres"), - preload("res://game/entities/weapons/minelayer/minelayer_data.tres"), - preload("res://game/entities/weapons/plasma/plasma_data.tres"), - preload("res://game/entities/weapons/railgun/railgun_data.tres"), - preload("res://game/entities/weapons/shrapnel/shrapnel_data.tres"), - preload("res://game/entities/weapons/tesla/tesla_data.tres"), + preload("res://game/data/weapons/cannon_data.tres"), + preload("res://game/data/weapons/gatling_data.tres"), + preload("res://game/data/weapons/laser_data.tres"), + preload("res://game/data/weapons/launcher_data.tres"), + preload("res://game/data/weapons/minelayer_data.tres"), + preload("res://game/data/weapons/plasma_data.tres"), + preload("res://game/data/weapons/railgun_data.tres"), + preload("res://game/data/weapons/shrapnel_data.tres"), + preload("res://game/data/weapons/tesla_data.tres"), ] const SAVE_FILE = "user://save.bin" diff --git a/managers/save_manager.gd.uid b/game/managers/save_manager.gd.uid similarity index 100% rename from managers/save_manager.gd.uid rename to game/managers/save_manager.gd.uid diff --git a/managers/settings_manager.gd b/game/managers/settings_manager.gd similarity index 100% rename from managers/settings_manager.gd rename to game/managers/settings_manager.gd diff --git a/managers/settings_manager.gd.uid b/game/managers/settings_manager.gd.uid similarity index 100% rename from managers/settings_manager.gd.uid rename to game/managers/settings_manager.gd.uid diff --git a/menu/common/credits.gd b/game/menu/common/credits.gd similarity index 100% rename from menu/common/credits.gd rename to game/menu/common/credits.gd diff --git a/menu/common/credits.gd.uid b/game/menu/common/credits.gd.uid similarity index 100% rename from menu/common/credits.gd.uid rename to game/menu/common/credits.gd.uid diff --git a/menu/common/credits.tscn b/game/menu/common/credits.tscn similarity index 96% rename from menu/common/credits.tscn rename to game/menu/common/credits.tscn index a0fda20..90410ca 100644 --- a/menu/common/credits.tscn +++ b/game/menu/common/credits.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=6 format=3 uid="uid://c3q3g2647qc27"] -[ext_resource type="Script" uid="uid://dclkpithyykju" path="res://menu/common/credits.gd" id="1_wp78b"] +[ext_resource type="Script" uid="uid://dclkpithyykju" path="res://game/menu/common/credits.gd" id="1_wp78b"] [ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_nidem"] [ext_resource type="Theme" uid="uid://cigren10ijb75" path="res://images/label.tres" id="3_x2hwc"] diff --git a/menu/common/options.gd b/game/menu/common/options.gd similarity index 100% rename from menu/common/options.gd rename to game/menu/common/options.gd diff --git a/menu/common/options.gd.uid b/game/menu/common/options.gd.uid similarity index 100% rename from menu/common/options.gd.uid rename to game/menu/common/options.gd.uid diff --git a/menu/common/options.tscn b/game/menu/common/options.tscn similarity index 98% rename from menu/common/options.tscn rename to game/menu/common/options.tscn index 52e660d..04bbed0 100644 --- a/menu/common/options.tscn +++ b/game/menu/common/options.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://btr60idiit4y7"] -[ext_resource type="Script" uid="uid://ceng1u112aqg0" path="res://menu/common/options.gd" id="1_61pji"] +[ext_resource type="Script" uid="uid://ceng1u112aqg0" path="res://game/menu/common/options.gd" id="1_61pji"] [ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_1tdpy"] [sub_resource type="InputEventAction" id="InputEventAction_61pji"] diff --git a/menu/ingame/game_over_screen.gd b/game/menu/ingame/game_over_screen.gd similarity index 100% rename from menu/ingame/game_over_screen.gd rename to game/menu/ingame/game_over_screen.gd diff --git a/menu/ingame/game_over_screen.gd.uid b/game/menu/ingame/game_over_screen.gd.uid similarity index 100% rename from menu/ingame/game_over_screen.gd.uid rename to game/menu/ingame/game_over_screen.gd.uid diff --git a/menu/ingame/game_over_screen.tscn b/game/menu/ingame/game_over_screen.tscn similarity index 96% rename from menu/ingame/game_over_screen.tscn rename to game/menu/ingame/game_over_screen.tscn index 477c8bb..b554288 100644 --- a/menu/ingame/game_over_screen.tscn +++ b/game/menu/ingame/game_over_screen.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://duxm8n62j2qt6"] -[ext_resource type="Script" uid="uid://bkj8s7588e1ho" path="res://menu/ingame/game_over_screen.gd" id="1_rkkr6"] +[ext_resource type="Script" uid="uid://bkj8s7588e1ho" path="res://game/menu/ingame/game_over_screen.gd" id="1_rkkr6"] [ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_uh3ar"] [node name="GameOverScreen" type="Control"] diff --git a/menu/ingame/pause_menu.gd b/game/menu/ingame/pause_menu.gd similarity index 100% rename from menu/ingame/pause_menu.gd rename to game/menu/ingame/pause_menu.gd diff --git a/menu/ingame/pause_menu.gd.uid b/game/menu/ingame/pause_menu.gd.uid similarity index 100% rename from menu/ingame/pause_menu.gd.uid rename to game/menu/ingame/pause_menu.gd.uid diff --git a/menu/ingame/pause_menu.tscn b/game/menu/ingame/pause_menu.tscn similarity index 97% rename from menu/ingame/pause_menu.tscn rename to game/menu/ingame/pause_menu.tscn index e94c5cd..fc5bd0e 100644 --- a/menu/ingame/pause_menu.tscn +++ b/game/menu/ingame/pause_menu.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://bclo2wl8ibrcg"] -[ext_resource type="Script" uid="uid://npqs2m5g5bd6" path="res://menu/ingame/pause_menu.gd" id="1_inj1j"] +[ext_resource type="Script" uid="uid://npqs2m5g5bd6" path="res://game/menu/ingame/pause_menu.gd" id="1_inj1j"] [ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_vy7sn"] [sub_resource type="Shortcut" id="Shortcut_lgp46"] diff --git a/menu/ingame/pause_screen.gd b/game/menu/ingame/pause_screen.gd similarity index 100% rename from menu/ingame/pause_screen.gd rename to game/menu/ingame/pause_screen.gd diff --git a/menu/ingame/pause_screen.gd.uid b/game/menu/ingame/pause_screen.gd.uid similarity index 100% rename from menu/ingame/pause_screen.gd.uid rename to game/menu/ingame/pause_screen.gd.uid diff --git a/menu/ingame/pause_screen.tscn b/game/menu/ingame/pause_screen.tscn similarity index 86% rename from menu/ingame/pause_screen.tscn rename to game/menu/ingame/pause_screen.tscn index d045ed2..ccb6c59 100644 --- a/menu/ingame/pause_screen.tscn +++ b/game/menu/ingame/pause_screen.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=3 uid="uid://d34nh3lc1gpb"] -[ext_resource type="Script" uid="uid://c5d2t2o53wkmt" path="res://menu/ingame/pause_screen.gd" id="1_fe1q8"] -[ext_resource type="PackedScene" uid="uid://bclo2wl8ibrcg" path="res://menu/ingame/pause_menu.tscn" id="2_4r6ly"] -[ext_resource type="PackedScene" uid="uid://btr60idiit4y7" path="res://menu/common/options.tscn" id="3_3gwb3"] -[ext_resource type="PackedScene" uid="uid://c3q3g2647qc27" path="res://menu/common/credits.tscn" id="4_jph5s"] +[ext_resource type="Script" uid="uid://c5d2t2o53wkmt" path="res://game/menu/ingame/pause_screen.gd" id="1_fe1q8"] +[ext_resource type="PackedScene" uid="uid://bclo2wl8ibrcg" path="res://game/menu/ingame/pause_menu.tscn" id="2_4r6ly"] +[ext_resource type="PackedScene" uid="uid://btr60idiit4y7" path="res://game/menu/common/options.tscn" id="3_3gwb3"] +[ext_resource type="PackedScene" uid="uid://c3q3g2647qc27" path="res://game/menu/common/credits.tscn" id="4_jph5s"] [node name="PauseScreen" type="Control"] layout_mode = 3 diff --git a/menu/ingame/victory_screen.gd b/game/menu/ingame/victory_screen.gd similarity index 100% rename from menu/ingame/victory_screen.gd rename to game/menu/ingame/victory_screen.gd diff --git a/menu/ingame/victory_screen.gd.uid b/game/menu/ingame/victory_screen.gd.uid similarity index 100% rename from menu/ingame/victory_screen.gd.uid rename to game/menu/ingame/victory_screen.gd.uid diff --git a/menu/ingame/victory_screen.tscn b/game/menu/ingame/victory_screen.tscn similarity index 96% rename from menu/ingame/victory_screen.tscn rename to game/menu/ingame/victory_screen.tscn index 5b2b7ba..4fa6043 100644 --- a/menu/ingame/victory_screen.tscn +++ b/game/menu/ingame/victory_screen.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://bdcs2ff85qjs4"] -[ext_resource type="Script" uid="uid://b0p1ewlw18ijg" path="res://menu/ingame/victory_screen.gd" id="1_asigk"] +[ext_resource type="Script" uid="uid://b0p1ewlw18ijg" path="res://game/menu/ingame/victory_screen.gd" id="1_asigk"] [ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_wb4d8"] [node name="VictoryScreen" type="Control"] diff --git a/menu/ingame/weapon_selection_screen.gd b/game/menu/ingame/weapon_selection_screen.gd similarity index 91% rename from menu/ingame/weapon_selection_screen.gd rename to game/menu/ingame/weapon_selection_screen.gd index 38f3f62..360bb82 100644 --- a/menu/ingame/weapon_selection_screen.gd +++ b/game/menu/ingame/weapon_selection_screen.gd @@ -5,7 +5,7 @@ extends Control signal weapon_selected(weapon_data: WeaponData) -const WEAPON_SELECTOR = preload("res://menu/ingame/weapon_selector.tscn") +const WEAPON_SELECTOR = preload("res://game/menu/ingame/weapon_selector.tscn") @export var world_data : WorldData: diff --git a/menu/ingame/weapon_selection_screen.gd.uid b/game/menu/ingame/weapon_selection_screen.gd.uid similarity index 100% rename from menu/ingame/weapon_selection_screen.gd.uid rename to game/menu/ingame/weapon_selection_screen.gd.uid diff --git a/menu/ingame/weapon_selection_screen.tscn b/game/menu/ingame/weapon_selection_screen.tscn similarity index 94% rename from menu/ingame/weapon_selection_screen.tscn rename to game/menu/ingame/weapon_selection_screen.tscn index 1f5bd71..0599ee4 100644 --- a/menu/ingame/weapon_selection_screen.tscn +++ b/game/menu/ingame/weapon_selection_screen.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://cv122gw47cnun"] -[ext_resource type="Script" uid="uid://6isk1tmc2ik1" path="res://menu/ingame/weapon_selection_screen.gd" id="1_hl2ql"] +[ext_resource type="Script" uid="uid://6isk1tmc2ik1" path="res://game/menu/ingame/weapon_selection_screen.gd" id="1_hl2ql"] [node name="WeaponSelectionScreen" type="Control"] layout_mode = 3 diff --git a/menu/ingame/weapon_selector.gd b/game/menu/ingame/weapon_selector.gd similarity index 100% rename from menu/ingame/weapon_selector.gd rename to game/menu/ingame/weapon_selector.gd diff --git a/menu/ingame/weapon_selector.gd.uid b/game/menu/ingame/weapon_selector.gd.uid similarity index 100% rename from menu/ingame/weapon_selector.gd.uid rename to game/menu/ingame/weapon_selector.gd.uid diff --git a/menu/ingame/weapon_selector.tscn b/game/menu/ingame/weapon_selector.tscn similarity index 96% rename from menu/ingame/weapon_selector.tscn rename to game/menu/ingame/weapon_selector.tscn index be2bffe..3726f43 100644 --- a/menu/ingame/weapon_selector.tscn +++ b/game/menu/ingame/weapon_selector.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://1o3idp54lil2"] -[ext_resource type="Script" uid="uid://beiydi6w6gqqc" path="res://menu/ingame/weapon_selector.gd" id="1_4acia"] +[ext_resource type="Script" uid="uid://beiydi6w6gqqc" path="res://game/menu/ingame/weapon_selector.gd" id="1_4acia"] [ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_g83h6"] [node name="WeaponSelector" type="MarginContainer"] diff --git a/menu/main/main_menu.gd b/game/menu/main/main_menu.gd similarity index 100% rename from menu/main/main_menu.gd rename to game/menu/main/main_menu.gd diff --git a/menu/main/main_menu.gd.uid b/game/menu/main/main_menu.gd.uid similarity index 100% rename from menu/main/main_menu.gd.uid rename to game/menu/main/main_menu.gd.uid diff --git a/menu/main/main_menu.tscn b/game/menu/main/main_menu.tscn similarity index 97% rename from menu/main/main_menu.tscn rename to game/menu/main/main_menu.tscn index 2eff162..12780a0 100644 --- a/menu/main/main_menu.tscn +++ b/game/menu/main/main_menu.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://bxlccevt52y70"] -[ext_resource type="Script" uid="uid://dixdfabe2vfsj" path="res://menu/main/main_menu.gd" id="1_chmv6"] +[ext_resource type="Script" uid="uid://dixdfabe2vfsj" path="res://game/menu/main/main_menu.gd" id="1_chmv6"] [ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_f5okj"] [node name="MainMenu" type="Control"] diff --git a/menu/main/seed_selection_menu.gd b/game/menu/main/seed_selection_menu.gd similarity index 96% rename from menu/main/seed_selection_menu.gd rename to game/menu/main/seed_selection_menu.gd index 18ff911..e869b42 100644 --- a/menu/main/seed_selection_menu.gd +++ b/game/menu/main/seed_selection_menu.gd @@ -49,7 +49,7 @@ func _get_random_seed() -> String: func _start_game(game_seed: String) -> void: SaveManager.new_game(game_seed) - get_tree().change_scene_to_file("res://game/game.tscn") + get_tree().change_scene_to_file("res://game/entities/world/game.tscn") func _on_seed_edit_text_changed(new_text: String) -> void: diff --git a/menu/main/seed_selection_menu.gd.uid b/game/menu/main/seed_selection_menu.gd.uid similarity index 100% rename from menu/main/seed_selection_menu.gd.uid rename to game/menu/main/seed_selection_menu.gd.uid diff --git a/menu/main/seed_selection_menu.tscn b/game/menu/main/seed_selection_menu.tscn similarity index 97% rename from menu/main/seed_selection_menu.tscn rename to game/menu/main/seed_selection_menu.tscn index cd7e2ee..1f99340 100644 --- a/menu/main/seed_selection_menu.tscn +++ b/game/menu/main/seed_selection_menu.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://c36n317rhv8k7"] -[ext_resource type="Script" uid="uid://dyynshvsgnepp" path="res://menu/main/seed_selection_menu.gd" id="1_g2smo"] +[ext_resource type="Script" uid="uid://dyynshvsgnepp" path="res://game/menu/main/seed_selection_menu.gd" id="1_g2smo"] [ext_resource type="Theme" uid="uid://dtnd3tqllufey" path="res://images/menu_button.tres" id="2_s4s14"] [sub_resource type="InputEventAction" id="InputEventAction_g2smo"] diff --git a/menu/main/title_screen.gd b/game/menu/main/title_screen.gd similarity index 93% rename from menu/main/title_screen.gd rename to game/menu/main/title_screen.gd index c535b5e..8680931 100644 --- a/menu/main/title_screen.gd +++ b/game/menu/main/title_screen.gd @@ -22,7 +22,7 @@ func _show_menu(menu: Control) -> void: func _on_main_menu_continue_game() -> void: - get_tree().change_scene_to_file("res://game/game.tscn") + get_tree().change_scene_to_file("res://game/entities/world/game.tscn") func _on_main_menu_new_game() -> void: diff --git a/menu/main/title_screen.gd.uid b/game/menu/main/title_screen.gd.uid similarity index 100% rename from menu/main/title_screen.gd.uid rename to game/menu/main/title_screen.gd.uid diff --git a/menu/main/title_screen.tscn b/game/menu/main/title_screen.tscn similarity index 85% rename from menu/main/title_screen.tscn rename to game/menu/main/title_screen.tscn index 7031db3..f6285b0 100644 --- a/menu/main/title_screen.tscn +++ b/game/menu/main/title_screen.tscn @@ -1,11 +1,11 @@ [gd_scene load_steps=7 format=3 uid="uid://2oavbr7oaihg"] -[ext_resource type="Script" uid="uid://bqnepsuk13qo8" path="res://menu/main/title_screen.gd" id="1_lxdol"] -[ext_resource type="PackedScene" uid="uid://bxlccevt52y70" path="res://menu/main/main_menu.tscn" id="2_o0rbc"] -[ext_resource type="PackedScene" uid="uid://btr60idiit4y7" path="res://menu/common/options.tscn" id="3_88gnj"] -[ext_resource type="PackedScene" uid="uid://c3q3g2647qc27" path="res://menu/common/credits.tscn" id="4_w1y3c"] -[ext_resource type="PackedScene" uid="uid://chdrjc7c6bdpb" path="res://game/background.tscn" id="5_88gnj"] -[ext_resource type="PackedScene" uid="uid://c36n317rhv8k7" path="res://menu/main/seed_selection_menu.tscn" id="5_w1y3c"] +[ext_resource type="Script" uid="uid://bqnepsuk13qo8" path="res://game/menu/main/title_screen.gd" id="1_lxdol"] +[ext_resource type="PackedScene" uid="uid://bxlccevt52y70" path="res://game/menu/main/main_menu.tscn" id="2_o0rbc"] +[ext_resource type="PackedScene" uid="uid://btr60idiit4y7" path="res://game/menu/common/options.tscn" id="3_88gnj"] +[ext_resource type="PackedScene" uid="uid://c3q3g2647qc27" path="res://game/menu/common/credits.tscn" id="4_w1y3c"] +[ext_resource type="PackedScene" uid="uid://chdrjc7c6bdpb" path="res://game/entities/world/background.tscn" id="5_88gnj"] +[ext_resource type="PackedScene" uid="uid://c36n317rhv8k7" path="res://game/menu/main/seed_selection_menu.tscn" id="5_w1y3c"] [node name="TitleScreen" type="Control"] layout_mode = 3 diff --git a/images/weapons.png b/images/weapons.png index d2133f4..667b859 100644 --- a/images/weapons.png +++ b/images/weapons.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:72b9ef6ef931aec5032540e93ba16d51ac9f3fa77c77dbe5d09e5611de96dd0f -size 4294 +oid sha256:9bc33facfd87557854565d6e677d938c1109fa135c19d5636eb2a3b8320ef19a +size 4331 diff --git a/menu/title_screen.tscn2367379461.tmp b/menu/title_screen.tscn2367379461.tmp deleted file mode 100644 index 79a0351..0000000 --- a/menu/title_screen.tscn2367379461.tmp +++ /dev/null @@ -1,28 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://2oavbr7oaihg"] - -[ext_resource type="Script" uid="uid://bqnepsuk13qo8" path="res://menu/title_screen.gd" id="1_lxdol"] -[ext_resource type="PackedScene" uid="uid://bxlccevt52y70" path="res://menu/main_menu.tscn" id="2_o0rbc"] -[ext_resource type="PackedScene" uid="uid://btr60idiit4y7" path="res://menu/options.tscn" id="3_88gnj"] -[ext_resource type="PackedScene" uid="uid://c3q3g2647qc27" path="res://menu/credits.tscn" id="4_w1y3c"] - -[node name="TitleScreen" type="Control"] -layout_mode = 3 -anchors_preset = 0 -script = ExtResource("1_lxdol") - -[node name="MainMenu" parent="." instance=ExtResource("2_o0rbc")] -layout_mode = 0 - -[node name="Options" parent="." instance=ExtResource("3_88gnj")] -layout_mode = 0 - -[node name="Credits" parent="." instance=ExtResource("4_w1y3c")] -layout_mode = 0 - -[connection signal="continue_game" from="MainMenu" to="." method="_on_main_menu_continue_game"] -[connection signal="new_game" from="MainMenu" to="." method="_on_main_menu_new_game"] -[connection signal="quit_game" from="MainMenu" to="." method="_on_main_menu_quit_game"] -[connection signal="show_options" from="MainMenu" to="." method="_on_main_menu_show_options"] -[connection signal="back" from="Options" to="." method="_on_options_back"] -[connection signal="show_credits" from="Options" to="." method="_on_options_show_credits"] -[connection signal="back" from="Credits" to="." method="_on_credits_back"] diff --git a/project.godot b/project.godot index 4d9214a..52b29e3 100644 --- a/project.godot +++ b/project.godot @@ -19,8 +19,8 @@ config/icon="res://icon.svg" [autoload] -SettingsManager="*res://managers/settings_manager.gd" -SaveManager="*res://managers/save_manager.gd" +SettingsManager="*res://game/managers/settings_manager.gd" +SaveManager="*res://game/managers/save_manager.gd" [debug] @@ -329,7 +329,6 @@ previous_reactor_scheme={ 2d_physics/layer_3="Enemy" 2d_physics/layer_4="PlayerProjectile" 2d_physics/layer_5="EnemyProjectile" -2d_physics/layer_6="ProjectileBorder" [rendering]