Reworked weapons and projectiles
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
class_name CannonProjectile
|
||||
extends BlastProjectile
|
||||
class_name AbstractCannonProjectile
|
||||
extends AbstractBlastProjectile
|
||||
|
||||
|
||||
@onready var sprite : Sprite2D = $Sprite2D
|
||||
+5
-5
@@ -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")
|
||||
+5
-6
@@ -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:
|
||||
+6
-114
@@ -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)
|
||||
Reference in New Issue
Block a user