From 77b03e4b73978ac5c0fe39354ec9da49d9c61530 Mon Sep 17 00:00:00 2001 From: Ruslan Ignatov Date: Wed, 19 Nov 2025 15:32:03 +0300 Subject: [PATCH] Added CannonWeapon textures --- .../ships/enemies/abstract_enemy_ship.gd | 2 +- .../ships/enemies/heavy/heavy_enemy_ship.tscn | 2 +- game/entities/ships/player/player_ship.gd | 2 +- game/entities/ships/player/player_ship.tscn | 2 - .../entities/weapons/abstract_projectile.tscn | 1 + game/entities/weapons/abstract_weapon.gd | 32 +-- game/entities/weapons/abstract_weapon.tscn | 9 +- game/entities/weapons/cannon/cannon_weapon.gd | 81 ++++++++ .../weapons/cannon/cannon_weapon.tscn | 191 +++++++++++++++++- .../weapons/gatling/gatling_weapon.tscn | 8 +- game/entities/weapons/laser/laser_weapon.tscn | 8 +- .../weapons/launcher/launcher_weapon.tscn | 8 +- .../weapons/minelayer/minelayer_weapon.tscn | 8 +- .../weapons/plasma/plasma_weapon.tscn | 8 +- .../weapons/railgun/railgun_weapon.tscn | 8 +- .../weapons/shrapnel/shrapnel_weapon.tscn | 8 +- .../weapons/tesla/tesla_projectile.gd | 1 - .../weapons/tesla/tesla_projectile.tscn | 1 + game/entities/weapons/tesla/tesla_weapon.tscn | 8 +- game/reloaders/abstract_reloader.gd | 4 + images/particles.png | 3 + images/particles.png.import | 40 ++++ images/weapons.png | 3 + images/weapons.png.import | 40 ++++ menu/pause_menu.tscn | 1 + 25 files changed, 443 insertions(+), 36 deletions(-) create mode 100644 images/particles.png create mode 100644 images/particles.png.import create mode 100644 images/weapons.png create mode 100644 images/weapons.png.import diff --git a/game/entities/ships/enemies/abstract_enemy_ship.gd b/game/entities/ships/enemies/abstract_enemy_ship.gd index 43f6551..366028c 100644 --- a/game/entities/ships/enemies/abstract_enemy_ship.gd +++ b/game/entities/ships/enemies/abstract_enemy_ship.gd @@ -5,4 +5,4 @@ extends AbstractShip func _ready() -> void: super._ready() for weapon in _weapons: - weapon.belonging = AbstractWeapon.Belonging.ENEMY + weapon.set_belonging(AbstractWeapon.Belonging.ENEMY) diff --git a/game/entities/ships/enemies/heavy/heavy_enemy_ship.tscn b/game/entities/ships/enemies/heavy/heavy_enemy_ship.tscn index d72c885..62d08d2 100644 --- a/game/entities/ships/enemies/heavy/heavy_enemy_ship.tscn +++ b/game/entities/ships/enemies/heavy/heavy_enemy_ship.tscn @@ -15,7 +15,7 @@ script = ExtResource("2_3umer") acceleration = 30 deceleration = 18 max_speed = 60 -weapon_positions = Array[Vector2]([Vector2(0, 12), Vector2(0, 0), Vector2(0, -12)]) +weapon_positions = Array[Vector2]([Vector2(0, 16), Vector2(0, 0), Vector2(0, -16)]) [node name="Sprite2D" parent="." index="0"] texture = SubResource("PlaceholderTexture2D_cuapu") diff --git a/game/entities/ships/player/player_ship.gd b/game/entities/ships/player/player_ship.gd index 08e03ac..93fc6a4 100644 --- a/game/entities/ships/player/player_ship.gd +++ b/game/entities/ships/player/player_ship.gd @@ -5,4 +5,4 @@ extends AbstractShip func _ready() -> void: super._ready() for weapon in _weapons: - weapon.belonging = AbstractWeapon.Belonging.PLAYER + weapon.set_belonging(AbstractWeapon.Belonging.PLAYER) diff --git a/game/entities/ships/player/player_ship.tscn b/game/entities/ships/player/player_ship.tscn index 08cb723..f299871 100644 --- a/game/entities/ships/player/player_ship.tscn +++ b/game/entities/ships/player/player_ship.tscn @@ -27,8 +27,6 @@ rotation = 1.5707964 shape = SubResource("CapsuleShape2D_dj8f1") [node name="Health" parent="." index="2"] -max_shield = 1000 -max_armor = 1000 max_hull = 1000 [node name="HeathBar" parent="." index="3"] diff --git a/game/entities/weapons/abstract_projectile.tscn b/game/entities/weapons/abstract_projectile.tscn index 6df6501..bde77fa 100644 --- a/game/entities/weapons/abstract_projectile.tscn +++ b/game/entities/weapons/abstract_projectile.tscn @@ -5,6 +5,7 @@ [sub_resource type="CircleShape2D" id="CircleShape2D_4b2nh"] [node name="AbstrastProjectile" type="Area2D"] +z_index = 1 script = ExtResource("1_4b2nh") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/game/entities/weapons/abstract_weapon.gd b/game/entities/weapons/abstract_weapon.gd index 738aed1..c2c43e5 100644 --- a/game/entities/weapons/abstract_weapon.gd +++ b/game/entities/weapons/abstract_weapon.gd @@ -12,31 +12,35 @@ enum Belonging { PLAYER, ENEMY } @export var reloaders : Array[AbstractReloader] -var belonging: Belonging +const PREFIXES := { + Belonging.PLAYER: "player_", + Belonging.ENEMY: "enemy_", +} -var _reloaders : Array[AbstractReloader] - - -func _ready() -> void: - for reloader in reloaders: - _reloaders.append(reloader.duplicate()) +var _belonging: Belonging func _physics_process(delta: float) -> void: - for reloader in _reloaders: + for reloader in reloaders: reloader.process(delta) -func shoot(ship_velocity: Vector2) -> void: - if not _can_shoot(): return +func set_belonging(belonging: Belonging) -> void: + _belonging = belonging + + +func shoot(ship_velocity: Vector2) -> bool: + if not _can_shoot(): return false for i in range(bullet_per_shot): var projectile := _create_projectile(ship_velocity) get_tree().current_scene.add_child(projectile) - for reloader in _reloaders: + for reloader in reloaders: reloader.shoot() + + return true func _create_projectile(ship_velocity: Vector2) -> Node: @@ -44,7 +48,7 @@ func _create_projectile(ship_velocity: Vector2) -> Node: projectile.global_position = global_position projectile.ship_velocity = ship_velocity - match belonging: + match _belonging: Belonging.PLAYER: projectile.direction = Vector2.RIGHT projectile.collide_enemies = true @@ -61,12 +65,12 @@ func _create_projectile(ship_velocity: Vector2) -> Node: func reload() -> void: - for reloader in _reloaders: + for reloader in reloaders: reloader.reload() func _can_shoot() -> bool: - for reloader in _reloaders: + for reloader in reloaders: if not reloader.can_shoot(): return false return true diff --git a/game/entities/weapons/abstract_weapon.tscn b/game/entities/weapons/abstract_weapon.tscn index b186ff9..94cb925 100644 --- a/game/entities/weapons/abstract_weapon.tscn +++ b/game/entities/weapons/abstract_weapon.tscn @@ -1,12 +1,7 @@ -[gd_scene load_steps=3 format=3 uid="uid://1o2ta17yc5bp"] +[gd_scene load_steps=2 format=3 uid="uid://1o2ta17yc5bp"] [ext_resource type="Script" uid="uid://dpqxs8hlql2o0" path="res://game/entities/weapons/abstract_weapon.gd" id="1_x30ps"] -[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"] -size = Vector2(10, 7) - [node name="AbstractWeapon" type="Node2D"] +z_index = 2 script = ExtResource("1_x30ps") - -[node name="Sprite2D" type="Sprite2D" parent="."] -texture = SubResource("PlaceholderTexture2D_dra6h") diff --git a/game/entities/weapons/cannon/cannon_weapon.gd b/game/entities/weapons/cannon/cannon_weapon.gd index b209331..4821d4e 100644 --- a/game/entities/weapons/cannon/cannon_weapon.gd +++ b/game/entities/weapons/cannon/cannon_weapon.gd @@ -1 +1,82 @@ extends AbstractWeapon + + + +const SHOT_POSTFIX = "shot" +const IDLE_POSTFIX = "idle" + + +@onready var sprite : AnimatedSprite2D = $AnimatedSprite2D +@onready var front_particles : GPUParticles2D = $ShotParticles/Front +@onready var left_particles : GPUParticles2D = $ShotParticles/Left +@onready var right_particles : GPUParticles2D = $ShotParticles/Right +@onready var shell_particles : GPUParticles2D = $ShellParticles + + +func set_belonging(belonging: Belonging) -> void: + super.set_belonging(belonging) + + _init_particles() + + sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) + + +func _init_particles() -> void: + const FRONT_OFFSET_X = 12 + const LEFT_OFFSET_X = 7 + const LEFT_OFFSET_Y = 5 + const SHELL_OFFSET_X = -10 + const SHELL_OFFSET_Y = 2 + + + match _belonging: + Belonging.PLAYER: + front_particles.process_material.emission_shape_offset.x = FRONT_OFFSET_X + front_particles.process_material.direction = Vector3.RIGHT + + left_particles.process_material.emission_shape_offset.x = LEFT_OFFSET_X + left_particles.process_material.emission_shape_offset.y = -LEFT_OFFSET_Y + left_particles.process_material.direction = Vector3.DOWN + Vector3.LEFT + + right_particles.process_material.emission_shape_offset.x = LEFT_OFFSET_X + right_particles.process_material.emission_shape_offset.y = LEFT_OFFSET_Y + right_particles.process_material.direction = Vector3.UP + Vector3.LEFT + + shell_particles.process_material.emission_shape_offset.x = SHELL_OFFSET_X + shell_particles.process_material.emission_shape_offset.y = SHELL_OFFSET_Y + shell_particles.process_material.direction = Vector3.UP + Belonging.ENEMY: + front_particles.process_material.emission_shape_offset.x = -FRONT_OFFSET_X + front_particles.process_material.direction = Vector3.LEFT + + left_particles.process_material.emission_shape_offset.x = -LEFT_OFFSET_X + left_particles.process_material.emission_shape_offset.y = -LEFT_OFFSET_Y + left_particles.process_material.direction = Vector3.DOWN + Vector3.RIGHT + + right_particles.process_material.emission_shape_offset.x = -LEFT_OFFSET_X + right_particles.process_material.emission_shape_offset.y = LEFT_OFFSET_Y + right_particles.process_material.direction = Vector3.UP + Vector3.RIGHT + + shell_particles.process_material.emission_shape_offset.x = -SHELL_OFFSET_X + shell_particles.process_material.emission_shape_offset.y = -SHELL_OFFSET_Y + shell_particles.process_material.direction = Vector3.DOWN + + +func shoot(ship_velocity: Vector2) -> bool: + var is_shot := super.shoot(ship_velocity) + if is_shot: + sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX) + _restart_particles() + + return is_shot + + +func _restart_particles() -> void: + front_particles.restart() + left_particles.restart() + right_particles.restart() + shell_particles.restart() + + +func _on_animated_sprite_2d_animation_finished() -> void: + sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX) diff --git a/game/entities/weapons/cannon/cannon_weapon.tscn b/game/entities/weapons/cannon/cannon_weapon.tscn index 76ca2a7..e57bee2 100644 --- a/game/entities/weapons/cannon/cannon_weapon.tscn +++ b/game/entities/weapons/cannon/cannon_weapon.tscn @@ -1,18 +1,207 @@ -[gd_scene load_steps=7 format=3 uid="uid://bccaoirwdkp7n"] +[gd_scene load_steps=27 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://ccpriilfr3kme" path="res://game/reloaders/abstract_reloader.gd" id="3_7e2aj"] [ext_resource type="Script" uid="uid://b255rb32vc6co" path="res://game/reloaders/firerate_reloader.gd" id="4_bv8g1"] +[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="6_jfd4t"] +[ext_resource type="Texture2D" uid="uid://3w0itm7k5fxq" path="res://images/particles.png" id="7_i0ica"] [sub_resource type="Resource" id="Resource_7e2aj"] script = ExtResource("4_bv8g1") firerate = 50 metadata/_custom_type_script = "uid://b255rb32vc6co" +[sub_resource type="Gradient" id="Gradient_jfd4t"] +colors = PackedColorArray(1, 0.8039216, 0.45882353, 1, 0.9372549, 0.49019608, 0.34117648, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_i0ica"] +gradient = SubResource("Gradient_jfd4t") +width = 2 + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_377p4"] +resource_local_to_scene = true +lifetime_randomness = 0.4 +particle_flag_disable_z = true +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_i0ica"] +resource_local_to_scene = true +lifetime_randomness = 0.1 +particle_flag_disable_z = true +inherit_velocity_ratio = 0.2 +spread = 5.0 +initial_velocity_min = 10.0 +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 +inherit_velocity_ratio = 0.2 +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("6_jfd4t") +region = Rect2(0, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_i0ica"] +atlas = ExtResource("6_jfd4t") +region = Rect2(32, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_377p4"] +atlas = ExtResource("6_jfd4t") +region = Rect2(64, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_nrbut"] +atlas = ExtResource("6_jfd4t") +region = Rect2(96, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_mk6k8"] +atlas = ExtResource("6_jfd4t") +region = Rect2(128, 160, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_fxfcx"] +atlas = ExtResource("6_jfd4t") +region = Rect2(0, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_dvc0n"] +atlas = ExtResource("6_jfd4t") +region = Rect2(32, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_caj01"] +atlas = ExtResource("6_jfd4t") +region = Rect2(64, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_e28g8"] +atlas = ExtResource("6_jfd4t") +region = Rect2(96, 144, 32, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f7kmj"] +atlas = ExtResource("6_jfd4t") +region = Rect2(128, 144, 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="AtlasTexture" id="AtlasTexture_h76ev"] +atlas = ExtResource("7_i0ica") +region = Rect2(0, 0, 16, 16) + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_nrbut"] +resource_local_to_scene = true +lifetime_randomness = 0.5 +particle_flag_disable_z = true +inherit_velocity_ratio = 1.0 +spread = 15.0 +initial_velocity_min = 5.0 +initial_velocity_max = 15.0 +gravity = Vector3(0, 0, 0) + [node name="CannonWeapon" instance=ExtResource("1_xnbws")] script = ExtResource("2_ew5um") sector_angle = 1 Projectile = ExtResource("2_2bjeu") reloaders = Array[ExtResource("3_7e2aj")]([SubResource("Resource_7e2aj")]) + +[node name="ShotParticles" type="Node2D" parent="." index="0"] + +[node name="Front" type="GPUParticles2D" parent="ShotParticles" index="0"] +emitting = false +amount = 32 +texture = SubResource("GradientTexture1D_i0ica") +lifetime = 0.5 +one_shot = true +preprocess = 0.1 +fixed_fps = 10 +process_material = SubResource("ParticleProcessMaterial_377p4") + +[node name="Left" type="GPUParticles2D" parent="ShotParticles" index="1"] +emitting = false +texture = SubResource("GradientTexture1D_i0ica") +lifetime = 0.2 +one_shot = true +fixed_fps = 10 +process_material = SubResource("ParticleProcessMaterial_i0ica") + +[node name="Right" type="GPUParticles2D" parent="ShotParticles" index="2"] +emitting = false +texture = SubResource("GradientTexture1D_i0ica") +lifetime = 0.2 +one_shot = true +fixed_fps = 10 +process_material = SubResource("ParticleProcessMaterial_jfd4t") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"] +sprite_frames = SubResource("SpriteFrames_kdf62") +animation = &"player_idle" + +[node name="ShellParticles" type="GPUParticles2D" parent="." index="2"] +emitting = false +amount = 1 +texture = SubResource("AtlasTexture_h76ev") +lifetime = 2.0 +one_shot = true +fixed_fps = 10 +process_material = SubResource("ParticleProcessMaterial_nrbut") + +[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"] diff --git a/game/entities/weapons/gatling/gatling_weapon.tscn b/game/entities/weapons/gatling/gatling_weapon.tscn index 32b7777..415e992 100644 --- a/game/entities/weapons/gatling/gatling_weapon.tscn +++ b/game/entities/weapons/gatling/gatling_weapon.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://c4mlppn5i55bp"] +[gd_scene load_steps=10 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"] @@ -19,8 +19,14 @@ magazine_size = 150 reload_time = 2 metadata/_custom_type_script = "uid://d2gfhnlbqxsoq" +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"] +size = Vector2(10, 7) + [node name="GatlingWeapon" instance=ExtResource("1_gblx7")] script = ExtResource("1_kg6du") sector_angle = 5 Projectile = ExtResource("2_ylc0n") reloaders = Array[ExtResource("3_uucc4")]([SubResource("Resource_kg6du"), SubResource("Resource_ylc0n")]) + +[node name="Sprite2D" type="Sprite2D" parent="." index="0"] +texture = SubResource("PlaceholderTexture2D_dra6h") diff --git a/game/entities/weapons/laser/laser_weapon.tscn b/game/entities/weapons/laser/laser_weapon.tscn index 351e775..d0c8da1 100644 --- a/game/entities/weapons/laser/laser_weapon.tscn +++ b/game/entities/weapons/laser/laser_weapon.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://def1alrel4ioo"] +[gd_scene load_steps=10 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"] @@ -19,8 +19,14 @@ heat_capacity = 1000 cooling_down_rate = 2500 metadata/_custom_type_script = "uid://dxk56xdihfw4m" +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"] +size = Vector2(10, 7) + [node name="LaserWeapon" instance=ExtResource("1_pki4x")] script = ExtResource("2_lbdvb") bullet_per_shot = 2 Projectile = ExtResource("2_fecho") reloaders = Array[ExtResource("3_c1wcw")]([SubResource("Resource_fecho"), SubResource("Resource_c1wcw")]) + +[node name="Sprite2D" type="Sprite2D" parent="." index="0"] +texture = SubResource("PlaceholderTexture2D_dra6h") diff --git a/game/entities/weapons/launcher/launcher_weapon.tscn b/game/entities/weapons/launcher/launcher_weapon.tscn index ae182fa..a1f4601 100644 --- a/game/entities/weapons/launcher/launcher_weapon.tscn +++ b/game/entities/weapons/launcher/launcher_weapon.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://c3l866fdqt7pf"] +[gd_scene load_steps=8 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"] @@ -11,8 +11,14 @@ script = ExtResource("4_fsoo2") firerate = 120 metadata/_custom_type_script = "uid://b255rb32vc6co" +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"] +size = Vector2(10, 7) + [node name="LauncherWeapon" instance=ExtResource("1_sk5u1")] script = ExtResource("2_mxjpe") sector_angle = 5 Projectile = ExtResource("3_fsoo2") reloaders = Array[ExtResource("3_1rkeb")]([SubResource("Resource_8arbu")]) + +[node name="Sprite2D" type="Sprite2D" parent="." index="0"] +texture = SubResource("PlaceholderTexture2D_dra6h") diff --git a/game/entities/weapons/minelayer/minelayer_weapon.tscn b/game/entities/weapons/minelayer/minelayer_weapon.tscn index 4df3d2a..82e4c11 100644 --- a/game/entities/weapons/minelayer/minelayer_weapon.tscn +++ b/game/entities/weapons/minelayer/minelayer_weapon.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://j3yht6q4ru4e"] +[gd_scene load_steps=8 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"] @@ -11,8 +11,14 @@ script = ExtResource("4_fbmxv") firerate = 40 metadata/_custom_type_script = "uid://b255rb32vc6co" +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"] +size = Vector2(10, 7) + [node name="MinelayerWeapon" instance=ExtResource("1_12l3k")] script = ExtResource("2_mmhtn") sector_angle = 10 Projectile = ExtResource("2_7y446") reloaders = Array[ExtResource("3_uotj8")]([SubResource("Resource_uotj8")]) + +[node name="Sprite2D" type="Sprite2D" parent="." index="0"] +texture = SubResource("PlaceholderTexture2D_dra6h") diff --git a/game/entities/weapons/plasma/plasma_weapon.tscn b/game/entities/weapons/plasma/plasma_weapon.tscn index 8695356..7b35ef8 100644 --- a/game/entities/weapons/plasma/plasma_weapon.tscn +++ b/game/entities/weapons/plasma/plasma_weapon.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://cj1jclfterepm"] +[gd_scene load_steps=10 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"] @@ -19,8 +19,14 @@ heat_capacity = 1000 cooling_down_rate = 1000 metadata/_custom_type_script = "uid://dxk56xdihfw4m" +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"] +size = Vector2(10, 7) + [node name="PlasmaWeapon" instance=ExtResource("1_pkk8e")] script = ExtResource("2_fnsb7") sector_angle = 2 Projectile = ExtResource("2_yluvp") reloaders = Array[ExtResource("3_fnsb7")]([SubResource("Resource_yluvp"), SubResource("Resource_fnsb7")]) + +[node name="Sprite2D" type="Sprite2D" parent="." index="0"] +texture = SubResource("PlaceholderTexture2D_dra6h") diff --git a/game/entities/weapons/railgun/railgun_weapon.tscn b/game/entities/weapons/railgun/railgun_weapon.tscn index f1ea07e..c1597f0 100644 --- a/game/entities/weapons/railgun/railgun_weapon.tscn +++ b/game/entities/weapons/railgun/railgun_weapon.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://do6h77gmnreho"] +[gd_scene load_steps=10 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"] @@ -18,7 +18,13 @@ magazine_size = 30 reload_time = 7 metadata/_custom_type_script = "uid://d2gfhnlbqxsoq" +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"] +size = Vector2(10, 7) + [node name="RailgunWeapon" instance=ExtResource("1_0nxvu")] script = ExtResource("1_5nhwg") Projectile = ExtResource("2_cbsia") reloaders = Array[ExtResource("3_qxka8")]([SubResource("Resource_5nhwg"), SubResource("Resource_cbsia")]) + +[node name="Sprite2D" type="Sprite2D" parent="." index="0"] +texture = SubResource("PlaceholderTexture2D_dra6h") diff --git a/game/entities/weapons/shrapnel/shrapnel_weapon.tscn b/game/entities/weapons/shrapnel/shrapnel_weapon.tscn index 86c9f9e..7f015b7 100644 --- a/game/entities/weapons/shrapnel/shrapnel_weapon.tscn +++ b/game/entities/weapons/shrapnel/shrapnel_weapon.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://r7wnk762jbfy"] +[gd_scene load_steps=10 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"] @@ -18,9 +18,15 @@ magazine_size = 35 reload_time = 5 metadata/_custom_type_script = "uid://d2gfhnlbqxsoq" +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"] +size = Vector2(10, 7) + [node name="ShrapnelWeapon" instance=ExtResource("1_xk300")] script = ExtResource("2_1bd18") bullet_per_shot = 20 sector_angle = 30 Projectile = ExtResource("2_xvd4y") reloaders = Array[ExtResource("3_tyrw7")]([SubResource("Resource_tyrw7"), SubResource("Resource_nfmol")]) + +[node name="Sprite2D" type="Sprite2D" parent="." index="0"] +texture = SubResource("PlaceholderTexture2D_dra6h") diff --git a/game/entities/weapons/tesla/tesla_projectile.gd b/game/entities/weapons/tesla/tesla_projectile.gd index 9fab2ea..904781b 100644 --- a/game/entities/weapons/tesla/tesla_projectile.gd +++ b/game/entities/weapons/tesla/tesla_projectile.gd @@ -15,7 +15,6 @@ var _collided_foes : Array[AbstractShip] = [] func _ready() -> void: - damage = damage.duplicate() super._ready() _start_jink_timer() diff --git a/game/entities/weapons/tesla/tesla_projectile.tscn b/game/entities/weapons/tesla/tesla_projectile.tscn index 8385fc8..5c78187 100644 --- a/game/entities/weapons/tesla/tesla_projectile.tscn +++ b/game/entities/weapons/tesla/tesla_projectile.tscn @@ -5,6 +5,7 @@ [ext_resource type="Script" uid="uid://c27v705giygv4" path="res://game/health_system/damage/energy_damage.gd" id="3_l65ib"] [sub_resource type="Resource" id="Resource_1121u"] +resource_local_to_scene = true script = ExtResource("3_l65ib") value = 45 metadata/_custom_type_script = "uid://c27v705giygv4" diff --git a/game/entities/weapons/tesla/tesla_weapon.tscn b/game/entities/weapons/tesla/tesla_weapon.tscn index 94a99f9..61a4ab4 100644 --- a/game/entities/weapons/tesla/tesla_weapon.tscn +++ b/game/entities/weapons/tesla/tesla_weapon.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://dyebeblayioji"] +[gd_scene load_steps=10 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"] @@ -19,8 +19,14 @@ heat_capacity = 1000 cooling_down_rate = 2500 metadata/_custom_type_script = "uid://dxk56xdihfw4m" +[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"] +size = Vector2(10, 7) + [node name="TeslaWeapon" instance=ExtResource("1_rpud7")] script = ExtResource("2_08si3") sector_angle = 10 Projectile = ExtResource("2_1rrdy") reloaders = Array[ExtResource("3_08si3")]([SubResource("Resource_1rrdy"), SubResource("Resource_08si3")]) + +[node name="Sprite2D" type="Sprite2D" parent="." index="0"] +texture = SubResource("PlaceholderTexture2D_dra6h") diff --git a/game/reloaders/abstract_reloader.gd b/game/reloaders/abstract_reloader.gd index 4194343..2e1f51c 100644 --- a/game/reloaders/abstract_reloader.gd +++ b/game/reloaders/abstract_reloader.gd @@ -3,6 +3,10 @@ extends Resource class_name AbstractReloader +func _init() -> void: + resource_local_to_scene = true + + @abstract func process(delta: float) -> void diff --git a/images/particles.png b/images/particles.png new file mode 100644 index 0000000..6dfeb3e --- /dev/null +++ b/images/particles.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a676096106e2714b353b2294ecb40afce5e46253b224d7740290e3423e95ae16 +size 181 diff --git a/images/particles.png.import b/images/particles.png.import new file mode 100644 index 0000000..2758a88 --- /dev/null +++ b/images/particles.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://3w0itm7k5fxq" +path="res://.godot/imported/particles.png-86cd4f67c316e2e36289f2646d498449.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/particles.png" +dest_files=["res://.godot/imported/particles.png-86cd4f67c316e2e36289f2646d498449.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/images/weapons.png b/images/weapons.png new file mode 100644 index 0000000..00689e1 --- /dev/null +++ b/images/weapons.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33442b5699c2bf67a026eb332740b6e9d35402608a3bade9e439b40a1fe7a053 +size 4073 diff --git a/images/weapons.png.import b/images/weapons.png.import new file mode 100644 index 0000000..7a18192 --- /dev/null +++ b/images/weapons.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://6hh66k8s4a1e" +path="res://.godot/imported/weapons.png-5e31f764c3152a25cc3ecb57f3bdccd0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/weapons.png" +dest_files=["res://.godot/imported/weapons.png-5e31f764c3152a25cc3ecb57f3bdccd0.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/menu/pause_menu.tscn b/menu/pause_menu.tscn index 25aacdb..e55940f 100644 --- a/menu/pause_menu.tscn +++ b/menu/pause_menu.tscn @@ -29,6 +29,7 @@ text = "CONTINUE" [node name="OptionsButton" type="Button" parent="VBoxContainer"] layout_mode = 2 +mouse_filter = 2 theme = ExtResource("2_vy7sn") text = "OPTIONS"