Reworked weapons and projectiles
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
class_name LaserProjectile
|
||||
extends DirectHitProjectile
|
||||
class_name AbstractLaserProjectile
|
||||
extends AbstractDirectHitProjectile
|
||||
|
||||
|
||||
@onready var particles : GPUParticles2D = $GPUParticles2D
|
||||
+10
-8
@@ -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")
|
||||
+3
-4
@@ -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)
|
||||
Reference in New Issue
Block a user