Reworked weapons and projectiles

This commit is contained in:
2025-12-20 18:35:27 +03:00
parent 2ecc53416a
commit 8227e8bcf3
312 changed files with 2466 additions and 1376 deletions
@@ -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)
@@ -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")
@@ -1,4 +1,4 @@
class_name DirectHitProjectile
class_name AbstractDirectHitProjectile
extends AbstractProjectile
@@ -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")
+6 -41
View File
@@ -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
+5 -24
View File
@@ -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)
@@ -1,5 +1,5 @@
class_name CannonProjectile
extends BlastProjectile
class_name AbstractCannonProjectile
extends AbstractBlastProjectile
@onready var sprite : Sprite2D = $Sprite2D
@@ -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")
@@ -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:
@@ -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"]
@@ -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"
@@ -0,0 +1,2 @@
class_name EnemyCannonProjectile
extends AbstractCannonProjectile
@@ -0,0 +1 @@
uid://crm02yyh6rcu6
@@ -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
@@ -0,0 +1,2 @@
class_name EnemyCannonWeapon
extends AbstractCannonWeapon
@@ -0,0 +1 @@
uid://ctyvmasefboee
@@ -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)
@@ -0,0 +1,2 @@
class_name PlayerCannonProjectile
extends AbstractCannonProjectile
@@ -0,0 +1 @@
uid://82w6uhu0q7su
@@ -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
@@ -0,0 +1,2 @@
class_name PlayerCannonWeapon
extends AbstractCannonWeapon
@@ -0,0 +1 @@
uid://bvnecmmrk5e47
@@ -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)
@@ -0,0 +1,2 @@
class_name AbstractGatlingProjectile
extends AbstractDirectHitProjectile
@@ -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")
@@ -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)
@@ -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"]
@@ -0,0 +1,2 @@
class_name EnemyGatlingProjectile
extends AbstractGatlingProjectile
@@ -0,0 +1 @@
uid://b63edlkleako8
@@ -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)
@@ -0,0 +1,2 @@
class_name EnemyGatlingWeapon
extends AbstractGatlingWeapon
@@ -0,0 +1 @@
uid://bj6mviyrgggty
@@ -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)
@@ -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"
@@ -1,2 +0,0 @@
class_name GatlingProjectile
extends DirectHitProjectile
@@ -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"]
@@ -0,0 +1,2 @@
class_name PlayerGatlingProjectile
extends AbstractGatlingProjectile
@@ -0,0 +1 @@
uid://b8nunmccyxmkr
@@ -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)
@@ -0,0 +1,2 @@
class_name PlayerGatlingWeapon
extends AbstractGatlingWeapon
@@ -0,0 +1 @@
uid://622qtvleceha
@@ -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)
@@ -1,5 +1,5 @@
class_name LaserProjectile
extends DirectHitProjectile
class_name AbstractLaserProjectile
extends AbstractDirectHitProjectile
@onready var particles : GPUParticles2D = $GPUParticles2D
@@ -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")
@@ -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:
@@ -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"]
@@ -0,0 +1,2 @@
class_name EnemyLaserProjectile
extends AbstractLaserProjectile
@@ -0,0 +1 @@
uid://1tw0n0y7c3n4
@@ -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")
@@ -0,0 +1,2 @@
class_name EnemyLaserWeapon
extends AbstractLaserWeapon
@@ -0,0 +1 @@
uid://bckua73myf5v7
@@ -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)
@@ -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"
@@ -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"]
@@ -0,0 +1,2 @@
class_name PlayerLaserProjectile
extends AbstractLaserProjectile
@@ -0,0 +1 @@
uid://v7pcdd8yxdse
@@ -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")
@@ -0,0 +1,2 @@
class_name PlayerLaserWeapon
extends AbstractLaserWeapon
@@ -0,0 +1 @@
uid://824ta0lbinkb
@@ -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)
@@ -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
@@ -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"]
@@ -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:
@@ -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"]
@@ -0,0 +1,2 @@
class_name EnemyLauncherProjectile
extends AbstractLauncherProjectile
@@ -0,0 +1 @@
uid://bgl2wo0bdgh5j
@@ -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
@@ -0,0 +1,2 @@
class_name EnemyLauncherWeapon
extends AbstractLauncherWeapon
@@ -0,0 +1 @@
uid://3b4ft0vrkvn1
@@ -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")
@@ -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"
@@ -0,0 +1,2 @@
class_name PlayerLauncherProjectile
extends AbstractLauncherProjectile
@@ -0,0 +1 @@
uid://jxx2b1mcovtx
@@ -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
@@ -0,0 +1,2 @@
class_name PlayerLauncherWeapon
extends AbstractLauncherWeapon
@@ -0,0 +1 @@
uid://c3asrkguw01q2
@@ -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")
@@ -1,5 +1,5 @@
class_name MinelayerProjectile
extends BlastProjectile
class_name AbstractMinelayerProjectile
extends AbstractBlastProjectile
enum SpriteState {
@@ -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")
@@ -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
@@ -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"]
@@ -0,0 +1,2 @@
class_name EnemyMinelayerProjectile
extends AbstractMinelayerProjectile
@@ -0,0 +1 @@
uid://fyoiuye4fvk3
@@ -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
@@ -0,0 +1,2 @@
class_name EnemyMinelayerWeapon
extends AbstractMinelayerWeapon
@@ -0,0 +1 @@
uid://dmnqjbog6df2x
@@ -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"
@@ -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"

Some files were not shown because too many files have changed in this diff Show More