Reworked weapons and projectiles
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
[ext_resource type="Script" uid="uid://bk8qn34w5cqmj" path="res://game/area_map/area_map.gd" id="1_hkcry"]
|
[ext_resource type="Script" uid="uid://bk8qn34w5cqmj" path="res://game/area_map/area_map.gd" id="1_hkcry"]
|
||||||
[ext_resource type="PackedScene" uid="uid://b8qwok6v44la" path="res://game/area_map/indicators/current_sector_indicator.tscn" id="2_fx4fd"]
|
[ext_resource type="PackedScene" uid="uid://b8qwok6v44la" path="res://game/area_map/indicators/current_sector_indicator.tscn" id="2_fx4fd"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bwru7i7xetjth" path="res://game/area_map/indicators/selected_sector_indicator.tscn" id="3_oxnrh"]
|
[ext_resource type="PackedScene" uid="uid://bwru7i7xetjth" path="res://game/area_map/indicators/selected_sector_indicator.tscn" id="3_oxnrh"]
|
||||||
[ext_resource type="PackedScene" uid="uid://chdrjc7c6bdpb" path="res://game/background.tscn" id="4_fx4fd"]
|
[ext_resource type="PackedScene" uid="uid://chdrjc7c6bdpb" path="res://game/entities/world/background.tscn" id="4_fx4fd"]
|
||||||
|
|
||||||
[node name="AreaMap" type="Node2D"]
|
[node name="AreaMap" type="Node2D"]
|
||||||
script = ExtResource("1_hkcry")
|
script = ExtResource("1_hkcry")
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://dxap3sahurth4"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d3co2xx0th1d0" path="res://game/entities/weapons/cannon/enemy_cannon_weapon.tscn" id="1_2gkq7"]
|
||||||
|
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_c34y3"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://mpr5kl87nx3f" path="res://game/entities/weapons/cannon/player_cannon_weapon.tscn" id="2_qvf4o"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_c34y3")
|
||||||
|
id = "cannon"
|
||||||
|
name = "Cannon"
|
||||||
|
group = "explosion"
|
||||||
|
description = "High damage (explosion)
|
||||||
|
Low firerate
|
||||||
|
Moderate velocity
|
||||||
|
High explosion radius"
|
||||||
|
enemy_scene = ExtResource("1_2gkq7")
|
||||||
|
player_scene = ExtResource("2_qvf4o")
|
||||||
|
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://djelo5gu3ybuf"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_bt4k8"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://b0ajhllwm5qux" path="res://game/entities/weapons/gatling/enemy_gatling_weapon.tscn" id="1_punrp"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://ca2cjffcrfxkq" path="res://game/entities/weapons/gatling/player_gatling_weapon.tscn" id="2_84glq"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_bt4k8")
|
||||||
|
id = "gatling"
|
||||||
|
name = "Gatling"
|
||||||
|
group = "kinetic"
|
||||||
|
description = "Low damage (kinetic)
|
||||||
|
High firerate
|
||||||
|
Moderate velocity"
|
||||||
|
enemy_scene = ExtResource("1_punrp")
|
||||||
|
player_scene = ExtResource("2_84glq")
|
||||||
|
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://y7ccba1uqf2d"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_ipxhy"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://mjt8xj8k28vi" path="res://game/entities/weapons/laser/enemy_laser_weapon.tscn" id="1_mdqmb"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cargptjtnale2" path="res://game/entities/weapons/laser/player_laser_weapon.tscn" id="2_bmgx0"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_ipxhy")
|
||||||
|
id = "laser"
|
||||||
|
name = "Laser"
|
||||||
|
group = "energy"
|
||||||
|
description = "Low damage (energetic)
|
||||||
|
High firerate
|
||||||
|
Low velocity"
|
||||||
|
enemy_scene = ExtResource("1_mdqmb")
|
||||||
|
player_scene = ExtResource("2_bmgx0")
|
||||||
|
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://ddgggndifycge"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_tcis2"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://b757rcwc231o2" path="res://game/entities/weapons/launcher/enemy_launcher_weapon.tscn" id="1_vypk3"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bmn3cxk1ajydl" path="res://game/entities/weapons/launcher/player_launcher_weapon.tscn" id="2_sdkfu"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_tcis2")
|
||||||
|
id = "launcher"
|
||||||
|
name = "Launcher"
|
||||||
|
group = "explosion"
|
||||||
|
description = "Moderate damage (explosion)
|
||||||
|
Moderate firerate
|
||||||
|
Low velocity
|
||||||
|
Small explosion radius
|
||||||
|
Homing"
|
||||||
|
enemy_scene = ExtResource("1_vypk3")
|
||||||
|
player_scene = ExtResource("2_sdkfu")
|
||||||
|
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://40sshnf6g80k"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_152qt"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bjbfi6vvikk15" path="res://game/entities/weapons/minelayer/enemy_minelayer_weapon.tscn" id="1_bpafq"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dxh4m1upio4fx" path="res://game/entities/weapons/minelayer/player_minelayer_weapon.tscn" id="2_77jvm"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_152qt")
|
||||||
|
id = "minelayer"
|
||||||
|
name = "Minelayer"
|
||||||
|
group = "explosion"
|
||||||
|
description = "High damage (explosion)
|
||||||
|
Low firerate
|
||||||
|
Low velocity
|
||||||
|
Medium explosion radius
|
||||||
|
Short range"
|
||||||
|
enemy_scene = ExtResource("1_bpafq")
|
||||||
|
player_scene = ExtResource("2_77jvm")
|
||||||
|
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://dq0pjpg3slr8s"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_3fasx"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dtl3d7soletdn" path="res://game/entities/weapons/plasma/enemy_plasma_weapon.tscn" id="1_h185p"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dd8juohu1x2xo" path="res://game/entities/weapons/plasma/player_plasma_weapon.tscn" id="2_6cfmm"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_3fasx")
|
||||||
|
id = "plasma"
|
||||||
|
name = "Plasma"
|
||||||
|
group = "energy"
|
||||||
|
description = "Moderate damage (energetic)
|
||||||
|
Moderate firerate
|
||||||
|
Moderate velocity"
|
||||||
|
enemy_scene = ExtResource("1_h185p")
|
||||||
|
player_scene = ExtResource("2_6cfmm")
|
||||||
|
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://dtpk5apjti4vh"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_6lcn5"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://chgf0tdlikwlb" path="res://game/entities/weapons/railgun/enemy_railgun_weapon.tscn" id="1_srmn2"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://b745401et1bom" path="res://game/entities/weapons/railgun/player_railgun_weapon.tscn" id="2_hqpda"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_6lcn5")
|
||||||
|
id = "railgun"
|
||||||
|
name = "Railgun"
|
||||||
|
group = "kinetic"
|
||||||
|
description = "High damage (kinetic)
|
||||||
|
Low firerate
|
||||||
|
High velocity
|
||||||
|
Can pierce enemies"
|
||||||
|
enemy_scene = ExtResource("1_srmn2")
|
||||||
|
player_scene = ExtResource("2_hqpda")
|
||||||
|
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://d1kc2gvye2f28"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://df816hasxkglk" path="res://game/entities/weapons/shrapnel/enemy_shrapnel_weapon.tscn" id="1_260ps"]
|
||||||
|
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_xds2o"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cvtwks2ooetxp" path="res://game/entities/weapons/shrapnel/player_shrapnel_weapon.tscn" id="2_nj3we"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_xds2o")
|
||||||
|
id = "shrapnel"
|
||||||
|
name = "Shrapnel"
|
||||||
|
group = "kinetic"
|
||||||
|
description = "High damage (kinetic)
|
||||||
|
Moderate firerate
|
||||||
|
Moderate velocity
|
||||||
|
Short range
|
||||||
|
Multiple projectiles"
|
||||||
|
enemy_scene = ExtResource("1_260ps")
|
||||||
|
player_scene = ExtResource("2_nj3we")
|
||||||
|
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
[gd_resource type="Resource" script_class="WeaponData" load_steps=4 format=3 uid="uid://c7tim0uie3m35"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://870r1efinhqd" path="res://game/data/weapons/weapon_data.gd" id="1_a16gw"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dqgybquvuw0v6" path="res://game/entities/weapons/tesla/enemy_tesla_weapon.tscn" id="1_iwabo"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://u6hpohk5i3eu" path="res://game/entities/weapons/tesla/player_tesla_weapon.tscn" id="2_kqe35"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_a16gw")
|
||||||
|
id = "tesla"
|
||||||
|
name = "Tesla"
|
||||||
|
group = "energy"
|
||||||
|
description = "Moderate damage (energetic)
|
||||||
|
Low firerate
|
||||||
|
High velocity
|
||||||
|
Hits nearest target
|
||||||
|
Can pierce enemies"
|
||||||
|
enemy_scene = ExtResource("1_iwabo")
|
||||||
|
player_scene = ExtResource("2_kqe35")
|
||||||
|
metadata/_custom_type_script = "uid://870r1efinhqd"
|
||||||
@@ -8,4 +8,5 @@ extends Resource
|
|||||||
|
|
||||||
@export_multiline var description: String
|
@export_multiline var description: String
|
||||||
|
|
||||||
@export var scene: PackedScene
|
@export var enemy_scene: PackedScene
|
||||||
|
@export var player_scene: PackedScene
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://pfvs7wqrnn08"]
|
[gd_scene load_steps=2 format=3 uid="uid://pfvs7wqrnn08"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://clt20ebs6shkm" path="res://game/entities/other/blast.gd" id="1_2fpxy"]
|
[ext_resource type="Script" uid="uid://clt20ebs6shkm" path="res://game/entities/explosions/blast.gd" id="1_2fpxy"]
|
||||||
|
|
||||||
[node name="Blast" type="Area2D"]
|
[node name="Blast" type="Area2D"]
|
||||||
script = ExtResource("1_2fpxy")
|
script = ExtResource("1_2fpxy")
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=6 format=3 uid="uid://bhxib2ltpkcbf"]
|
[gd_scene load_steps=6 format=3 uid="uid://bhxib2ltpkcbf"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://gh7mwehpqfco" path="res://particle_textures/flame_medium.tres" id="1_6awlt"]
|
[ext_resource type="Texture2D" uid="uid://gh7mwehpqfco" path="res://particle_textures/flame_medium.tres" id="1_6awlt"]
|
||||||
[ext_resource type="Script" uid="uid://dhnjdam04g4tb" path="res://game/entities/other/explosion_particles.gd" id="1_w1d42"]
|
[ext_resource type="Script" uid="uid://dhnjdam04g4tb" path="res://game/entities/explosions/explosion_particles.gd" id="1_w1d42"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b13al44e8ofsx" path="res://particle_textures/flame_large.tres" id="2_w1d42"]
|
[ext_resource type="Texture2D" uid="uid://b13al44e8ofsx" path="res://particle_textures/flame_large.tres" id="2_w1d42"]
|
||||||
[ext_resource type="Texture2D" uid="uid://blp4o1c7y66wv" path="res://particle_textures/flame_huge.tres" id="3_lplfr"]
|
[ext_resource type="Texture2D" uid="uid://blp4o1c7y66wv" path="res://particle_textures/flame_huge.tres" id="3_lplfr"]
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://clkymhkv3cevm"]
|
[gd_scene load_steps=2 format=3 uid="uid://clkymhkv3cevm"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://d3g4xbq45qmpr" path="res://game/health_system/health.gd" id="1_gwdg4"]
|
[ext_resource type="Script" uid="uid://d3g4xbq45qmpr" path="res://game/entities/health_system/health.gd" id="1_gwdg4"]
|
||||||
|
|
||||||
[node name="Health" type="Node"]
|
[node name="Health" type="Node"]
|
||||||
script = ExtResource("1_gwdg4")
|
script = ExtResource("1_gwdg4")
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://xbfxsiumbgkp"]
|
[gd_scene load_steps=2 format=3 uid="uid://xbfxsiumbgkp"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://drwgq8fxaclvn" path="res://game/health_system/health_bar/health_bar_part.gd" id="1_nuv67"]
|
[ext_resource type="Script" uid="uid://drwgq8fxaclvn" path="res://game/entities/health_system/health_bar_part.gd" id="1_nuv67"]
|
||||||
|
|
||||||
[node name="HealthBarPart" type="Control"]
|
[node name="HealthBarPart" type="Control"]
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=7 format=3 uid="uid://d2snum2pxc2ui"]
|
[gd_scene load_steps=7 format=3 uid="uid://d2snum2pxc2ui"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://be7k64p2kel8b" path="res://game/health_system/health_bar/heath_bar.gd" id="1_bx561"]
|
[ext_resource type="Script" uid="uid://be7k64p2kel8b" path="res://game/entities/health_system/heath_bar.gd" id="1_bx561"]
|
||||||
[ext_resource type="PackedScene" uid="uid://xbfxsiumbgkp" path="res://game/health_system/health_bar/health_bar_part.tscn" id="2_wb6me"]
|
[ext_resource type="PackedScene" uid="uid://xbfxsiumbgkp" path="res://game/entities/health_system/health_bar_part.tscn" id="2_wb6me"]
|
||||||
[ext_resource type="Texture2D" uid="uid://do586oblhwuc5" path="res://images/health.png" id="3_fogsl"]
|
[ext_resource type="Texture2D" uid="uid://do586oblhwuc5" path="res://images/health.png" id="3_fogsl"]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sgr4k"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_sgr4k"]
|
||||||
@@ -101,7 +101,6 @@ func _on_health_depleted() -> void:
|
|||||||
|
|
||||||
func _add_weapon(weapon: AbstractWeapon, weapon_position: Vector2) -> void:
|
func _add_weapon(weapon: AbstractWeapon, weapon_position: Vector2) -> void:
|
||||||
weapon.position = weapon_position
|
weapon.position = weapon_position
|
||||||
weapon.rotation_degrees = weapon_rotation
|
|
||||||
add_child(weapon)
|
add_child(weapon)
|
||||||
_weapons.append(weapon)
|
_weapons.append(weapon)
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
[ext_resource type="Script" uid="uid://cesibaqtrgotl" path="res://game/entities/ships/abstract_ship.gd" id="1_6isjb"]
|
[ext_resource type="Script" uid="uid://cesibaqtrgotl" path="res://game/entities/ships/abstract_ship.gd" id="1_6isjb"]
|
||||||
[ext_resource type="Shader" uid="uid://dwh22f35u5qqi" path="res://game/entities/ships/shield.gdshader" id="2_dokxo"]
|
[ext_resource type="Shader" uid="uid://dwh22f35u5qqi" path="res://game/entities/ships/shield.gdshader" id="2_dokxo"]
|
||||||
[ext_resource type="PackedScene" uid="uid://clkymhkv3cevm" path="res://game/health_system/health.tscn" id="2_xxtvk"]
|
[ext_resource type="PackedScene" uid="uid://clkymhkv3cevm" path="res://game/entities/health_system/health.tscn" id="2_xxtvk"]
|
||||||
[ext_resource type="PackedScene" uid="uid://d2snum2pxc2ui" path="res://game/health_system/health_bar/heath_bar.tscn" id="3_l62e5"]
|
[ext_resource type="PackedScene" uid="uid://d2snum2pxc2ui" path="res://game/entities/health_system/heath_bar.tscn" id="3_l62e5"]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_dokxo"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_dokxo"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
|
|||||||
@@ -18,11 +18,6 @@ func _physics_process(delta: float) -> void:
|
|||||||
shoot()
|
shoot()
|
||||||
|
|
||||||
|
|
||||||
func _add_weapon(weapon: AbstractWeapon, weapon_position: Vector2) -> void:
|
|
||||||
super._add_weapon(weapon, weapon_position)
|
|
||||||
weapon.set_belonging(AbstractWeapon.Belonging.ENEMY)
|
|
||||||
|
|
||||||
|
|
||||||
func _on_visible_on_screen_notifier_2d_screen_entered() -> void:
|
func _on_visible_on_screen_notifier_2d_screen_entered() -> void:
|
||||||
is_on_screen = true
|
is_on_screen = true
|
||||||
|
|
||||||
@@ -42,12 +37,6 @@ func _set_enemy_data(data: EnemyData) -> void:
|
|||||||
positions.remove_at(0)
|
positions.remove_at(0)
|
||||||
|
|
||||||
for i in range(min(enemy_data.weapon_count, positions.size())):
|
for i in range(min(enemy_data.weapon_count, positions.size())):
|
||||||
var weapon : AbstractWeapon = enemy_data.weapon.scene.instantiate()
|
var weapon_scene := enemy_data.weapon.enemy_scene
|
||||||
_add_weapon(weapon, weapon_positions[i])
|
var weapon : AbstractWeapon = weapon_scene.instantiate()
|
||||||
|
_add_weapon(weapon, positions[i])
|
||||||
|
|
||||||
func _create_weapon(weapon_id : String) -> AbstractWeapon:
|
|
||||||
var weapon_scene : PackedScene = load(WEAPON_SCENES[weapon_id])
|
|
||||||
var weapon : AbstractWeapon = weapon_scene.instantiate()
|
|
||||||
weapon_type = weapon.type
|
|
||||||
return weapon
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=6 format=3 uid="uid://dwsn0lf1e3578"]
|
[gd_scene load_steps=7 format=3 uid="uid://dwsn0lf1e3578"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://jvyagshykmgb" path="res://game/entities/ships/abstract_ship.tscn" id="1_28j6l"]
|
[ext_resource type="PackedScene" uid="uid://jvyagshykmgb" path="res://game/entities/ships/abstract_ship.tscn" id="1_28j6l"]
|
||||||
[ext_resource type="Script" uid="uid://byicf1t0807pq" path="res://game/entities/ships/enemies/abstract_enemy_ship.gd" id="2_fwvrd"]
|
[ext_resource type="Script" uid="uid://byicf1t0807pq" path="res://game/entities/ships/enemies/abstract_enemy_ship.gd" id="2_fwvrd"]
|
||||||
@@ -12,15 +12,24 @@ shader_parameter/speed = 0.0
|
|||||||
shader_parameter/scale = 20.0
|
shader_parameter/scale = 20.0
|
||||||
shader_parameter/intensity = 1.0
|
shader_parameter/intensity = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_l8c0n"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
shader = ExtResource("3_6nnf4")
|
||||||
|
shader_parameter/speed = 5.0
|
||||||
|
shader_parameter/scale = 20.0
|
||||||
|
shader_parameter/intensity = 1.0
|
||||||
|
|
||||||
[node name="AbstractEnemyShip" groups=["enemies"] instance=ExtResource("1_28j6l")]
|
[node name="AbstractEnemyShip" groups=["enemies"] instance=ExtResource("1_28j6l")]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
collision_mask = 6
|
collision_mask = 6
|
||||||
script = ExtResource("2_fwvrd")
|
script = ExtResource("2_fwvrd")
|
||||||
weapon_rotation = 180
|
|
||||||
|
|
||||||
[node name="ArmorSprite" parent="." index="1"]
|
[node name="ArmorSprite" parent="." index="1"]
|
||||||
material = SubResource("ShaderMaterial_dlmr1")
|
material = SubResource("ShaderMaterial_dlmr1")
|
||||||
|
|
||||||
|
[node name="ShieldSprite" parent="." index="2"]
|
||||||
|
material = SubResource("ShaderMaterial_l8c0n")
|
||||||
|
|
||||||
[node name="EnemyController" parent="." index="4" node_paths=PackedStringArray("ship") instance=ExtResource("3_l8c0n")]
|
[node name="EnemyController" parent="." index="4" node_paths=PackedStringArray("ship") instance=ExtResource("3_l8c0n")]
|
||||||
ship = NodePath("..")
|
ship = NodePath("..")
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,32 @@
|
|||||||
[gd_scene load_steps=7 format=3 uid="uid://d3epy8w15qmjm"]
|
[gd_scene load_steps=10 format=3 uid="uid://d3epy8w15qmjm"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dwsn0lf1e3578" path="res://game/entities/ships/enemies/abstract_enemy_ship.tscn" id="1_wvvpj"]
|
[ext_resource type="PackedScene" uid="uid://dwsn0lf1e3578" path="res://game/entities/ships/enemies/abstract_enemy_ship.tscn" id="1_wvvpj"]
|
||||||
[ext_resource type="Script" uid="uid://cxomr1oojcrcl" path="res://game/entities/ships/enemies/heavy/heavy_enemy_ship.gd" id="2_3umer"]
|
[ext_resource type="Script" uid="uid://cxomr1oojcrcl" path="res://game/entities/ships/enemies/heavy/heavy_enemy_ship.gd" id="2_3umer"]
|
||||||
[ext_resource type="Texture2D" uid="uid://5cgq8o5oqunq" path="res://images/ships/enemies/heavy.png" id="3_xqe8d"]
|
[ext_resource type="Texture2D" uid="uid://5cgq8o5oqunq" path="res://images/ships/enemies/heavy.png" id="3_xqe8d"]
|
||||||
|
[ext_resource type="Shader" uid="uid://dwh22f35u5qqi" path="res://game/entities/ships/shield.gdshader" id="4_qawoi"]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xqe8d"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_xqe8d"]
|
||||||
atlas = ExtResource("3_xqe8d")
|
atlas = ExtResource("3_xqe8d")
|
||||||
region = Rect2(0, 0, 64, 48)
|
region = Rect2(0, 0, 64, 48)
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_c4do6"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
shader = ExtResource("4_qawoi")
|
||||||
|
shader_parameter/speed = 0.0
|
||||||
|
shader_parameter/scale = 20.0
|
||||||
|
shader_parameter/intensity = 1.0
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qawoi"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_qawoi"]
|
||||||
atlas = ExtResource("3_xqe8d")
|
atlas = ExtResource("3_xqe8d")
|
||||||
region = Rect2(0, 48, 64, 48)
|
region = Rect2(0, 48, 64, 48)
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_6d574"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
shader = ExtResource("4_qawoi")
|
||||||
|
shader_parameter/speed = 5.0
|
||||||
|
shader_parameter/scale = 20.0
|
||||||
|
shader_parameter/intensity = 1.0
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c4do6"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_c4do6"]
|
||||||
atlas = ExtResource("3_xqe8d")
|
atlas = ExtResource("3_xqe8d")
|
||||||
region = Rect2(0, 96, 64, 48)
|
region = Rect2(0, 96, 64, 48)
|
||||||
@@ -27,9 +42,11 @@ mass = 600
|
|||||||
texture = SubResource("AtlasTexture_xqe8d")
|
texture = SubResource("AtlasTexture_xqe8d")
|
||||||
|
|
||||||
[node name="ArmorSprite" parent="." index="1"]
|
[node name="ArmorSprite" parent="." index="1"]
|
||||||
|
material = SubResource("ShaderMaterial_c4do6")
|
||||||
texture = SubResource("AtlasTexture_qawoi")
|
texture = SubResource("AtlasTexture_qawoi")
|
||||||
|
|
||||||
[node name="ShieldSprite" parent="." index="2"]
|
[node name="ShieldSprite" parent="." index="2"]
|
||||||
|
material = SubResource("ShaderMaterial_6d574")
|
||||||
texture = SubResource("AtlasTexture_c4do6")
|
texture = SubResource("AtlasTexture_c4do6")
|
||||||
|
|
||||||
[node name="CollisionPolygon2D" parent="." index="3"]
|
[node name="CollisionPolygon2D" parent="." index="3"]
|
||||||
|
|||||||
@@ -40,11 +40,6 @@ func _physics_process(delta: float) -> void:
|
|||||||
blink_charge_indicator.value = blink_charge
|
blink_charge_indicator.value = blink_charge
|
||||||
|
|
||||||
|
|
||||||
func _add_weapon(weapon: AbstractWeapon, weapon_position: Vector2) -> void:
|
|
||||||
super._add_weapon(weapon, weapon_position)
|
|
||||||
weapon.set_belonging(AbstractWeapon.Belonging.PLAYER)
|
|
||||||
|
|
||||||
|
|
||||||
func _blink(direction: Vector2) -> void:
|
func _blink(direction: Vector2) -> void:
|
||||||
if blink_charge < BLINK_CHARGE_MAXIMUM: return
|
if blink_charge < BLINK_CHARGE_MAXIMUM: return
|
||||||
|
|
||||||
@@ -70,7 +65,7 @@ func _set_player_data(new_data: PlayerData) -> void:
|
|||||||
player_data = new_data
|
player_data = new_data
|
||||||
_weapons.clear()
|
_weapons.clear()
|
||||||
for i in range(min(player_data.weapons.size(), weapon_positions.size())):
|
for i in range(min(player_data.weapons.size(), weapon_positions.size())):
|
||||||
var weapon_scene := player_data.weapons[i].scene
|
var weapon_scene := player_data.weapons[i].player_scene
|
||||||
var weapon : AbstractWeapon = weapon_scene.instantiate()
|
var weapon : AbstractWeapon = weapon_scene.instantiate()
|
||||||
_add_weapon(weapon, weapon_positions[i])
|
_add_weapon(weapon, weapon_positions[i])
|
||||||
|
|
||||||
|
|||||||
+1
-9
@@ -1,4 +1,4 @@
|
|||||||
class_name BlastProjectile
|
class_name AbstractBlastProjectile
|
||||||
extends AbstractProjectile
|
extends AbstractProjectile
|
||||||
|
|
||||||
|
|
||||||
@@ -19,11 +19,3 @@ func _try_to_damage_by_blast() -> bool:
|
|||||||
if _try_to_damage(overlapping_body, damage):
|
if _try_to_damage(overlapping_body, damage):
|
||||||
damaged = true
|
damaged = true
|
||||||
return damaged
|
return damaged
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _apply_collision_mask() -> void:
|
|
||||||
super._apply_collision_mask()
|
|
||||||
|
|
||||||
if blast:
|
|
||||||
_apply_collision_mask_to_area(blast)
|
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
[gd_scene load_steps=4 format=3 uid="uid://betr5ry5tc75e"]
|
[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="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="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/other/blast.tscn" id="3_r3k86"]
|
[ext_resource type="PackedScene" uid="uid://pfvs7wqrnn08" path="res://game/entities/explosions/blast.tscn" id="3_r3k86"]
|
||||||
|
|
||||||
[node name="BlastProjectile" instance=ExtResource("1_pd7f6")]
|
[node name="BlastProjectile" instance=ExtResource("1_pd7f6")]
|
||||||
script = ExtResource("2_5vx6r")
|
script = ExtResource("2_5vx6r")
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
class_name DirectHitProjectile
|
class_name AbstractDirectHitProjectile
|
||||||
extends AbstractProjectile
|
extends AbstractProjectile
|
||||||
|
|
||||||
|
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://cdv5n4t47hr8i"]
|
[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="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")]
|
[node name="DirectHitProjectile" instance=ExtResource("1_klynw")]
|
||||||
script = ExtResource("2_0vgnq")
|
script = ExtResource("2_0vgnq")
|
||||||
@@ -9,22 +9,11 @@ const ENEMY_PROJECTILE_LAYER = 16
|
|||||||
|
|
||||||
|
|
||||||
@export_range(0, 1000) var speed : int = 0
|
@export_range(0, 1000) var speed : int = 0
|
||||||
|
@export var direction : Vector2
|
||||||
|
|
||||||
|
|
||||||
var direction : Vector2
|
|
||||||
var ship_velocity: 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
|
var _velocity: Vector2
|
||||||
|
|
||||||
|
|
||||||
@@ -35,34 +24,12 @@ var _velocity: Vector2
|
|||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
_velocity = direction.normalized() * speed + ship_velocity
|
_velocity = direction.normalized() * speed + ship_velocity
|
||||||
_update_collision_rotation(_velocity)
|
_update_collision_rotation(_velocity)
|
||||||
|
|
||||||
_apply_collision_mask()
|
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
position += _velocity * delta
|
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:
|
func _update_collision_rotation(velocity: Vector2) -> void:
|
||||||
collision.rotation = velocity.angle() - 0.5 * PI
|
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]:
|
func _get_foes(filter: Array[AbstractShip] = []) -> Array[AbstractShip]:
|
||||||
var foes : Array[AbstractShip] = []
|
var foes : Array[AbstractShip] = []
|
||||||
|
|
||||||
var flags_by_group : Dictionary[String, bool] = {
|
var groups : Array[String] = [ "enemies", "players" ]
|
||||||
"enemies": collide_enemies,
|
|
||||||
"players": collide_players,
|
|
||||||
}
|
|
||||||
|
|
||||||
for group in flags_by_group:
|
for group in groups:
|
||||||
if not flags_by_group[group]: continue
|
|
||||||
var nodes := get_tree().get_nodes_in_group(group)
|
var nodes := get_tree().get_nodes_in_group(group)
|
||||||
for node in nodes:
|
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)
|
foes.append(node)
|
||||||
|
|
||||||
return foes
|
return foes
|
||||||
|
|||||||
@@ -2,38 +2,27 @@ class_name AbstractWeapon
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
|
|
||||||
enum Belonging { PLAYER, ENEMY }
|
|
||||||
enum Type { NONE, SHORT_RANGE, MEDIUM_RANGE, LONG_RANGE, HOMING, MINES }
|
enum Type { NONE, SHORT_RANGE, MEDIUM_RANGE, LONG_RANGE, HOMING, MINES }
|
||||||
|
|
||||||
|
|
||||||
const PREFIXES := {
|
const IDLE_ANIMATION = "idle"
|
||||||
Belonging.PLAYER: "player",
|
const SHOT_ANIMATION = "shot"
|
||||||
Belonging.ENEMY: "enemy",
|
const RELOAD_ANIMATION = "reloading"
|
||||||
}
|
|
||||||
|
|
||||||
const SHOT_POSTFIX = "_shot"
|
|
||||||
const IDLE_POSTFIX = "_idle"
|
|
||||||
const RELOAD_POSTFIX = "_reloading"
|
|
||||||
|
|
||||||
|
|
||||||
@export_range(1, 100) var bullet_per_shot : int = 1
|
@export_range(1, 100) var bullet_per_shot : int = 1
|
||||||
@export_range(0, 360) var sector_angle : int = 0
|
@export_range(0, 360) var sector_angle : int = 0
|
||||||
|
|
||||||
@export var Projectile : PackedScene
|
@export var projectile_scene : PackedScene
|
||||||
@export var type := Type.NONE
|
@export var type := Type.NONE
|
||||||
|
|
||||||
|
|
||||||
var _belonging: Belonging
|
|
||||||
var _can_shoot := true
|
var _can_shoot := true
|
||||||
|
|
||||||
|
|
||||||
@onready var muzzle : Node2D = $Muzzle
|
@onready var muzzle : Node2D = $Muzzle
|
||||||
|
|
||||||
|
|
||||||
func set_belonging(belonging: Belonging) -> void:
|
|
||||||
_belonging = belonging
|
|
||||||
|
|
||||||
|
|
||||||
func shoot(ship_velocity: Vector2) -> bool:
|
func shoot(ship_velocity: Vector2) -> bool:
|
||||||
if not _can_shoot: return false
|
if not _can_shoot: return false
|
||||||
|
|
||||||
@@ -52,18 +41,10 @@ func _get_projectile_position() -> Vector2:
|
|||||||
|
|
||||||
|
|
||||||
func _create_projectile(ship_velocity: Vector2) -> AbstractProjectile:
|
func _create_projectile(ship_velocity: Vector2) -> AbstractProjectile:
|
||||||
var projectile : AbstractProjectile = Projectile.instantiate()
|
var projectile : AbstractProjectile = projectile_scene.instantiate()
|
||||||
projectile.global_position = global_position
|
projectile.global_position = global_position
|
||||||
projectile.ship_velocity = ship_velocity
|
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:
|
if sector_angle > 0:
|
||||||
var sector_rad := deg_to_rad(sector_angle)
|
var sector_rad := deg_to_rad(sector_angle)
|
||||||
var random_angle := randfn(0.0, sector_rad / 6.0)
|
var random_angle := randfn(0.0, sector_rad / 6.0)
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
class_name CannonProjectile
|
class_name AbstractCannonProjectile
|
||||||
extends BlastProjectile
|
extends AbstractBlastProjectile
|
||||||
|
|
||||||
|
|
||||||
@onready var sprite : Sprite2D = $Sprite2D
|
@onready var sprite : Sprite2D = $Sprite2D
|
||||||
+5
-5
@@ -1,10 +1,10 @@
|
|||||||
[gd_scene load_steps=11 format=3 uid="uid://cgi7wd84kjnyw"]
|
[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="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/cannon_projectile.gd" id="2_x3axw"]
|
[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/health_system/damage/explosion_damage.gd" id="3_lb11p"]
|
[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="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"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ugryq"]
|
||||||
atlas = ExtResource("4_bb01p")
|
atlas = ExtResource("4_bb01p")
|
||||||
@@ -33,7 +33,7 @@ gravity = Vector3(0, 0, 0)
|
|||||||
turbulence_enabled = true
|
turbulence_enabled = true
|
||||||
turbulence_noise_speed = Vector3(0.1, 0.1, 0.1)
|
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_layer = 0
|
||||||
collision_mask = 0
|
collision_mask = 0
|
||||||
script = ExtResource("2_x3axw")
|
script = ExtResource("2_x3axw")
|
||||||
+5
-6
@@ -1,3 +1,4 @@
|
|||||||
|
class_name AbstractCannonWeapon
|
||||||
extends AbstractWeapon
|
extends AbstractWeapon
|
||||||
|
|
||||||
|
|
||||||
@@ -9,16 +10,14 @@ extends AbstractWeapon
|
|||||||
@onready var cooldown_timer : Timer = $CooldownTimer
|
@onready var cooldown_timer : Timer = $CooldownTimer
|
||||||
|
|
||||||
|
|
||||||
func set_belonging(belonging: Belonging) -> void:
|
func _ready() -> void:
|
||||||
super.set_belonging(belonging)
|
sprite.play(IDLE_ANIMATION)
|
||||||
|
|
||||||
sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX)
|
|
||||||
|
|
||||||
|
|
||||||
func shoot(ship_velocity: Vector2) -> bool:
|
func shoot(ship_velocity: Vector2) -> bool:
|
||||||
var is_shot := super.shoot(ship_velocity)
|
var is_shot := super.shoot(ship_velocity)
|
||||||
if is_shot:
|
if is_shot:
|
||||||
sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX)
|
sprite.play(SHOT_ANIMATION)
|
||||||
_can_shoot = false
|
_can_shoot = false
|
||||||
cooldown_timer.start()
|
cooldown_timer.start()
|
||||||
front_particles.restart()
|
front_particles.restart()
|
||||||
@@ -30,7 +29,7 @@ func shoot(ship_velocity: Vector2) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
func _on_animated_sprite_2d_animation_finished() -> void:
|
func _on_animated_sprite_2d_animation_finished() -> void:
|
||||||
sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX)
|
sprite.play(IDLE_ANIMATION)
|
||||||
|
|
||||||
|
|
||||||
func _on_cooldown_timer_timeout() -> void:
|
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://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/abstract_cannon_weapon.gd" id="2_ew5um"]
|
||||||
[ext_resource type="Script" uid="uid://db24dm76b1am7" path="res://game/entities/weapons/cannon/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://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://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://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"]
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_377p4"]
|
||||||
resource_local_to_scene = true
|
|
||||||
lifetime_randomness = 0.4
|
lifetime_randomness = 0.4
|
||||||
particle_flag_disable_z = true
|
particle_flag_disable_z = true
|
||||||
angle_min = -179.99998
|
angle_min = -179.99998
|
||||||
@@ -21,7 +18,6 @@ initial_velocity_max = 20.0
|
|||||||
gravity = Vector3(0, 0, 0)
|
gravity = Vector3(0, 0, 0)
|
||||||
|
|
||||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_i0ica"]
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_i0ica"]
|
||||||
resource_local_to_scene = true
|
|
||||||
lifetime_randomness = 0.1
|
lifetime_randomness = 0.1
|
||||||
particle_flag_disable_z = true
|
particle_flag_disable_z = true
|
||||||
emission_shape = 1
|
emission_shape = 1
|
||||||
@@ -36,7 +32,6 @@ initial_velocity_max = 20.0
|
|||||||
gravity = Vector3(0, 0, 0)
|
gravity = Vector3(0, 0, 0)
|
||||||
|
|
||||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_jfd4t"]
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_jfd4t"]
|
||||||
resource_local_to_scene = true
|
|
||||||
lifetime_randomness = 0.1
|
lifetime_randomness = 0.1
|
||||||
particle_flag_disable_z = true
|
particle_flag_disable_z = true
|
||||||
emission_shape = 1
|
emission_shape = 1
|
||||||
@@ -50,119 +45,25 @@ initial_velocity_min = 10.0
|
|||||||
initial_velocity_max = 20.0
|
initial_velocity_max = 20.0
|
||||||
gravity = Vector3(0, 0, 0)
|
gravity = Vector3(0, 0, 0)
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jfd4t"]
|
[sub_resource type="SpriteFrames" id="SpriteFrames_veer3"]
|
||||||
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="ParticleProcessMaterial" id="ParticleProcessMaterial_nrbut"]
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_nrbut"]
|
||||||
resource_local_to_scene = true
|
|
||||||
particle_flag_disable_z = true
|
particle_flag_disable_z = true
|
||||||
inherit_velocity_ratio = 0.5
|
inherit_velocity_ratio = 0.5
|
||||||
direction = Vector3(0, 1, 0)
|
direction = Vector3(0, 1, 0)
|
||||||
spread = 15.0
|
spread = 5.0
|
||||||
initial_velocity_min = 5.0
|
initial_velocity_min = 5.0
|
||||||
initial_velocity_max = 15.0
|
initial_velocity_max = 15.0
|
||||||
gravity = Vector3(0, 0, 0)
|
gravity = Vector3(0, 0, 0)
|
||||||
|
|
||||||
[node name="CannonWeapon" instance=ExtResource("1_xnbws")]
|
[node name="AbstractCannonWeapon" instance=ExtResource("1_xnbws")]
|
||||||
script = ExtResource("2_ew5um")
|
script = ExtResource("2_ew5um")
|
||||||
sector_angle = 1
|
sector_angle = 1
|
||||||
Projectile = ExtResource("2_2bjeu")
|
|
||||||
type = 3
|
type = 3
|
||||||
|
|
||||||
[node name="ShotParticles" type="Node2D" parent="." index="0"]
|
[node name="ShotParticles" type="Node2D" parent="." index="0"]
|
||||||
|
|
||||||
[node name="Front" type="GPUParticles2D" parent="ShotParticles" index="0"]
|
[node name="Front" type="GPUParticles2D" parent="ShotParticles" index="0"]
|
||||||
position = Vector2(22, 0)
|
|
||||||
emitting = false
|
emitting = false
|
||||||
amount = 32
|
amount = 32
|
||||||
texture = ExtResource("4_i0ica")
|
texture = ExtResource("4_i0ica")
|
||||||
@@ -173,7 +74,6 @@ fixed_fps = 10
|
|||||||
process_material = SubResource("ParticleProcessMaterial_377p4")
|
process_material = SubResource("ParticleProcessMaterial_377p4")
|
||||||
|
|
||||||
[node name="Left" type="GPUParticles2D" parent="ShotParticles" index="1"]
|
[node name="Left" type="GPUParticles2D" parent="ShotParticles" index="1"]
|
||||||
position = Vector2(17, -4)
|
|
||||||
emitting = false
|
emitting = false
|
||||||
texture = ExtResource("5_377p4")
|
texture = ExtResource("5_377p4")
|
||||||
lifetime = 0.4
|
lifetime = 0.4
|
||||||
@@ -182,7 +82,6 @@ fixed_fps = 10
|
|||||||
process_material = SubResource("ParticleProcessMaterial_i0ica")
|
process_material = SubResource("ParticleProcessMaterial_i0ica")
|
||||||
|
|
||||||
[node name="Right" type="GPUParticles2D" parent="ShotParticles" index="2"]
|
[node name="Right" type="GPUParticles2D" parent="ShotParticles" index="2"]
|
||||||
position = Vector2(17, 4)
|
|
||||||
emitting = false
|
emitting = false
|
||||||
texture = ExtResource("5_377p4")
|
texture = ExtResource("5_377p4")
|
||||||
lifetime = 0.4
|
lifetime = 0.4
|
||||||
@@ -191,18 +90,14 @@ fixed_fps = 10
|
|||||||
process_material = SubResource("ParticleProcessMaterial_jfd4t")
|
process_material = SubResource("ParticleProcessMaterial_jfd4t")
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="1"]
|
||||||
position = Vector2(9, 0)
|
sprite_frames = SubResource("SpriteFrames_veer3")
|
||||||
sprite_frames = SubResource("SpriteFrames_kdf62")
|
|
||||||
animation = &"player_idle"
|
|
||||||
|
|
||||||
[node name="ShellParticles" type="GPUParticles2D" parent="." index="2"]
|
[node name="ShellParticles" type="GPUParticles2D" parent="." index="2"]
|
||||||
z_index = 1
|
z_index = 1
|
||||||
position = Vector2(-1, 1)
|
|
||||||
emitting = false
|
emitting = false
|
||||||
amount = 5
|
amount = 5
|
||||||
texture = ExtResource("6_i0ica")
|
texture = ExtResource("6_i0ica")
|
||||||
lifetime = 3.0
|
lifetime = 3.0
|
||||||
one_shot = true
|
|
||||||
fixed_fps = 10
|
fixed_fps = 10
|
||||||
process_material = SubResource("ParticleProcessMaterial_nrbut")
|
process_material = SubResource("ParticleProcessMaterial_nrbut")
|
||||||
|
|
||||||
@@ -210,8 +105,5 @@ process_material = SubResource("ParticleProcessMaterial_nrbut")
|
|||||||
wait_time = 1.2
|
wait_time = 1.2
|
||||||
one_shot = true
|
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="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_2d_animation_finished"]
|
||||||
[connection signal="timeout" from="CooldownTimer" to="." method="_on_cooldown_timer_timeout"]
|
[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
|
||||||
+4
-5
@@ -1,8 +1,8 @@
|
|||||||
[gd_scene load_steps=8 format=3 uid="uid://yfvluap3uy1r"]
|
[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="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/gatling_projectile.gd" id="2_hbgoq"]
|
[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/health_system/damage/kinetic_damage.gd" id="3_2tbeq"]
|
[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"]
|
[ext_resource type="Texture2D" uid="uid://oj86smpsipw4" path="res://images/projectiles.png" id="4_ndegg"]
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_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"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_2tbeq"]
|
||||||
radius = 1.0
|
radius = 1.0
|
||||||
|
|
||||||
[node name="GatlingProjectile" instance=ExtResource("1_3tgt7")]
|
[node name="AbstractGatlingProjectile" instance=ExtResource("1_3tgt7")]
|
||||||
collision_layer = 0
|
collision_layer = 0
|
||||||
collision_mask = 0
|
collision_mask = 0
|
||||||
script = ExtResource("2_hbgoq")
|
script = ExtResource("2_hbgoq")
|
||||||
damage = SubResource("Resource_ndegg")
|
damage = SubResource("Resource_ndegg")
|
||||||
speed = 600
|
speed = 600
|
||||||
piercing = 1
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="." index="0"]
|
[node name="Sprite2D" type="Sprite2D" parent="." index="0"]
|
||||||
texture = SubResource("AtlasTexture_11x32")
|
texture = SubResource("AtlasTexture_11x32")
|
||||||
+5
-5
@@ -1,3 +1,4 @@
|
|||||||
|
class_name AbstractGatlingWeapon
|
||||||
extends AbstractWeapon
|
extends AbstractWeapon
|
||||||
|
|
||||||
|
|
||||||
@@ -6,17 +7,15 @@ extends AbstractWeapon
|
|||||||
@onready var shell_particles : GPUParticles2D = $ShellParticles
|
@onready var shell_particles : GPUParticles2D = $ShellParticles
|
||||||
|
|
||||||
|
|
||||||
func set_belonging(belonging: Belonging) -> void:
|
func _ready() -> void:
|
||||||
super.set_belonging(belonging)
|
sprite.play(IDLE_ANIMATION)
|
||||||
|
|
||||||
sprite.play(PREFIXES[_belonging] + IDLE_POSTFIX)
|
|
||||||
|
|
||||||
|
|
||||||
func shoot(ship_velocity: Vector2) -> bool:
|
func shoot(ship_velocity: Vector2) -> bool:
|
||||||
var is_shot := super.shoot(ship_velocity)
|
var is_shot := super.shoot(ship_velocity)
|
||||||
if is_shot:
|
if is_shot:
|
||||||
_can_shoot = false
|
_can_shoot = false
|
||||||
sprite.play(PREFIXES[_belonging] + SHOT_POSTFIX)
|
sprite.play(SHOT_ANIMATION)
|
||||||
shot_particles.restart()
|
shot_particles.restart()
|
||||||
shell_particles.emit_particle(Transform2D(), Vector2(), Color(), Color(), 0)
|
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:
|
func _on_animated_sprite_2d_animation_finished() -> void:
|
||||||
_can_shoot = true
|
_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
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user