Added railgun textures
This commit is contained in:
@@ -1,15 +1,31 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://bab3bopsw74cb"]
|
||||
[gd_scene load_steps=11 format=3 uid="uid://bab3bopsw74cb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://n3h1e3pj02g0" path="res://game/entities/weapons/railgun/railgun_projectile.gd" id="1_hycpq"]
|
||||
[ext_resource type="PackedScene" uid="uid://cdv5n4t47hr8i" path="res://game/entities/weapons/direct_hit__projectile.tscn" id="1_rfd1j"]
|
||||
[ext_resource type="Script" uid="uid://bhqvk5cnjg5mv" path="res://game/health_system/damage/kinetic_damage.gd" id="3_wbdf3"]
|
||||
[ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="4_u82jm"]
|
||||
[ext_resource type="Texture2D" uid="uid://dedca1d30igae" path="res://particle_textures/energy.tres" id="5_whmfh"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_u82jm"]
|
||||
script = ExtResource("3_wbdf3")
|
||||
value = 45
|
||||
metadata/_custom_type_script = "uid://bhqvk5cnjg5mv"
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_yedu2"]
|
||||
lifetime_randomness = 0.5
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 2.0
|
||||
angle_min = -179.99998
|
||||
angle_max = 180.00002
|
||||
inherit_velocity_ratio = 0.2
|
||||
spread = 180.0
|
||||
initial_velocity_max = 50.0
|
||||
gravity = Vector3(0, 0, 0)
|
||||
turbulence_enabled = true
|
||||
turbulence_noise_strength = 2.0
|
||||
turbulence_noise_speed_random = 1.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_u82jm"]
|
||||
atlas = ExtResource("4_u82jm")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
@@ -30,11 +46,17 @@ piercing = 1
|
||||
damage = SubResource("Resource_u82jm")
|
||||
speed = 900
|
||||
|
||||
[node name="Sprite2D_Left" type="Sprite2D" parent="." index="0"]
|
||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="." index="0"]
|
||||
amount = 32
|
||||
texture = ExtResource("5_whmfh")
|
||||
lifetime = 0.4
|
||||
process_material = SubResource("ParticleProcessMaterial_yedu2")
|
||||
|
||||
[node name="Sprite2D_Left" type="Sprite2D" parent="." index="1"]
|
||||
texture = SubResource("AtlasTexture_u82jm")
|
||||
|
||||
[node name="Sprite2D_Right" type="Sprite2D" parent="." index="1"]
|
||||
[node name="Sprite2D_Right" type="Sprite2D" parent="." index="2"]
|
||||
texture = SubResource("AtlasTexture_whmfh")
|
||||
|
||||
[node name="CollisionShape2D" parent="." index="2"]
|
||||
[node name="CollisionShape2D" parent="." index="3"]
|
||||
shape = SubResource("CapsuleShape2D_u82jm")
|
||||
|
||||
@@ -1 +1,31 @@
|
||||
extends AbstractWeapon
|
||||
|
||||
|
||||
@onready var sprite : AnimatedSprite2D = $AnimatedSprite2D
|
||||
|
||||
|
||||
func set_belonging(belonging: Belonging) -> void:
|
||||
super.set_belonging(belonging)
|
||||
|
||||
sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX)
|
||||
|
||||
|
||||
func shoot(ship_velocity: Vector2) -> bool:
|
||||
var is_shot := super.shoot(ship_velocity)
|
||||
if is_shot:
|
||||
sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX)
|
||||
print(1, sprite.animation)
|
||||
_can_shoot = false
|
||||
|
||||
return is_shot
|
||||
|
||||
|
||||
func _on_animated_sprite_2d_animation_finished() -> void:
|
||||
if sprite.animation.ends_with(SHOT_POSTFIX):
|
||||
sprite.play(PREFIXES[_belonging] + RELOAD_POSTFIX)
|
||||
print(PREFIXES[_belonging] + RELOAD_POSTFIX)
|
||||
print(2, sprite.animation)
|
||||
else:
|
||||
sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX)
|
||||
print(3, sprite.animation)
|
||||
_can_shoot = true
|
||||
|
||||
@@ -1,23 +1,168 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://do6h77gmnreho"]
|
||||
[gd_scene load_steps=23 format=3 uid="uid://do6h77gmnreho"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://1o2ta17yc5bp" path="res://game/entities/weapons/abstract_weapon.tscn" id="1_0nxvu"]
|
||||
[ext_resource type="Script" uid="uid://drnofu4ium56e" path="res://game/entities/weapons/railgun/railgun_weapon.gd" id="1_5nhwg"]
|
||||
[ext_resource type="PackedScene" uid="uid://bab3bopsw74cb" path="res://game/entities/weapons/railgun/railgun_projectile.tscn" id="2_cbsia"]
|
||||
[ext_resource type="Script" uid="uid://ccpriilfr3kme" path="res://game/reloaders/abstract_reloader.gd" id="3_qxka8"]
|
||||
[ext_resource type="Script" uid="uid://b255rb32vc6co" path="res://game/reloaders/firerate_reloader.gd" id="4_igknv"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_5nhwg"]
|
||||
script = ExtResource("4_igknv")
|
||||
firerate = 60
|
||||
metadata/_custom_type_script = "uid://b255rb32vc6co"
|
||||
[ext_resource type="Texture2D" uid="uid://6hh66k8s4a1e" path="res://images/weapons.png" id="4_qxcog"]
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dra6h"]
|
||||
size = Vector2(10, 7)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qxcog"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(0, 112, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6uyey"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(96, 112, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_knads"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(128, 112, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jxlhs"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(160, 112, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_o0am2"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(192, 112, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gxvdx"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(224, 112, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_caa1b"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(32, 112, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dshqd"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(64, 112, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_12cl3"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(0, 96, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q6uk7"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(96, 96, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ggjt2"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(128, 96, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jra8e"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(160, 96, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hqd47"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(192, 96, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hu0my"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(224, 96, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kjbu2"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(32, 96, 32, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2g4rr"]
|
||||
atlas = ExtResource("4_qxcog")
|
||||
region = Rect2(64, 96, 32, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_caa1b"]
|
||||
resource_local_to_scene = true
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qxcog")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"enemy_idle",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 6.0,
|
||||
"texture": SubResource("AtlasTexture_6uyey")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_knads")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jxlhs")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_o0am2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gxvdx")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"enemy_reloading",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_caa1b")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dshqd")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"enemy_shot",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_12cl3")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"player_idle",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 6.0,
|
||||
"texture": SubResource("AtlasTexture_q6uk7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ggjt2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jra8e")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hqd47")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hu0my")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"player_reloading",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kjbu2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_2g4rr")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"player_shot",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[node name="RailgunWeapon" instance=ExtResource("1_0nxvu")]
|
||||
script = ExtResource("1_5nhwg")
|
||||
Projectile = ExtResource("2_cbsia")
|
||||
reloaders = Array[ExtResource("3_qxka8")]([SubResource("Resource_5nhwg")])
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="." index="0"]
|
||||
texture = SubResource("PlaceholderTexture2D_dra6h")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"]
|
||||
sprite_frames = SubResource("SpriteFrames_caa1b")
|
||||
animation = &"enemy_reloading"
|
||||
|
||||
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"]
|
||||
|
||||
Reference in New Issue
Block a user