Implemented state machine & added NPC ship template

This commit is contained in:
2ndbeam 2024-05-01 17:45:17 +03:00
commit bda9232e72
15 changed files with 284 additions and 22 deletions

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://crneq2enhxsw5"]
[gd_scene load_steps=5 format=3 uid="uid://crneq2enhxsw5"]
[ext_resource type="PackedScene" uid="uid://bsnrcw64qr2hr" path="res://scenes/Star Systems/star_system_template.tscn" id="1_2ai1l"]
[ext_resource type="PackedScene" uid="uid://dk3nvl8f0v24e" path="res://scenes/base_template.tscn" id="3_m5ica"]
[ext_resource type="PackedScene" uid="uid://pev6k21vqaem" path="res://scenes/Ships/NPC Ships/kamikaze_ship.tscn" id="4_i6rbg"]
[ext_resource type="PackedScene" uid="uid://dok3i8u5t1ka4" path="res://scenes/Ships/player_ship.tscn" id="7_jyplv"]
[node name="StarSystem" instance=ExtResource("1_2ai1l")]
@ -12,13 +13,16 @@ height = 16384
scroll_offset = Vector2(681.667, 317.783)
stars_amount = 4000
[node name="PlayerShip" parent="." index="3" instance=ExtResource("7_jyplv")]
[node name="Nebula" parent="Background" index="0" node_paths=PackedStringArray("tracked_node")]
tracked_node = NodePath("../../FactionPlayer/PlayerShip")
color_background = Color(0.276474, 0.0962249, 0.200656, 1)
[node name="PlayerShip" parent="FactionPlayer" index="0" instance=ExtResource("7_jyplv")]
process_mode = 0
position = Vector2(19, 10)
[node name="Base" parent="." index="4" instance=ExtResource("3_m5ica")]
[node name="Base" parent="FactionPeaceful" index="0" instance=ExtResource("3_m5ica")]
position = Vector2(7171, -28)
[node name="Nebula" parent="Background" index="0" node_paths=PackedStringArray("tracked_node")]
tracked_node = NodePath("../../PlayerShip")
color_background = Color(0.276474, 0.0962249, 0.200656, 1)
[node name="KamikazeShip" parent="FactionAggressive" index="0" instance=ExtResource("4_i6rbg")]
position = Vector2(687, -302)

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://bsnrcw64qr2hr"]
[gd_scene load_steps=9 format=3 uid="uid://bsnrcw64qr2hr"]
[ext_resource type="Script" path="res://scripts/star_system.gd" id="1_xx8w2"]
[ext_resource type="PackedScene" uid="uid://dpggye27ln436" path="res://scenes/Star Systems/Required Scenes/star_generator.tscn" id="2_iqrn0"]
@ -6,6 +6,7 @@
[ext_resource type="Material" uid="uid://bawhivm5cr2w" path="res://shaders/materials/nebula_shader.tres" id="4_o0ld7"]
[ext_resource type="Script" path="res://scripts/nebula.gd" id="5_la84n"]
[ext_resource type="PackedScene" uid="uid://c7is7y341f6wa" path="res://scenes/Star Systems/Required Scenes/pause_controller.tscn" id="6_61vq5"]
[ext_resource type="Script" path="res://scripts/faction.gd" id="7_wm3vi"]
[sub_resource type="GDScript" id="GDScript_4yoh5"]
resource_name = "version_label"
@ -57,3 +58,19 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("5_la84n")
color_background = Color(0.36, 0.18612, 0.1116, 1)
[node name="FactionPlayer" type="Node" parent="."]
script = ExtResource("7_wm3vi")
faction = 1
[node name="FactionPeaceful" type="Node" parent="."]
script = ExtResource("7_wm3vi")
faction = 2
[node name="FactionNeutral" type="Node" parent="."]
script = ExtResource("7_wm3vi")
faction = 3
[node name="FactionAggressive" type="Node" parent="."]
script = ExtResource("7_wm3vi")
faction = 4