changement du scene manager, amélioration du cockpit et autres

* refonte du scene manager
* refonte du audio manager
* premier rework des plantes
* nettoyage des dossiers/fichiers
* renommage de planète en region
* fix des run
This commit is contained in:
2026-01-23 18:06:27 +01:00
parent 62b34473b6
commit 83d462f2f4
247 changed files with 2964 additions and 3159 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bbf7yy5rbgyju"
path.s3tc="res://.godot/imported/cockpit_sticker_1.png-af9ab6421f133456466632a45bc924d2.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://stages/cockpit/assets/textures/stickers/cockpit_sticker_1.png"
dest_files=["res://.godot/imported/cockpit_sticker_1.png-af9ab6421f133456466632a45bc924d2.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -2,20 +2,21 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://d2p7h0aga85tn"
path="res://.godot/imported/truck_interior.png-ff9bd2d0107d83f7c4209d959ee69f15.ctex"
uid="uid://63drr6hunnr"
path.s3tc="res://.godot/imported/cockpit_sticker_2.png-d807c76b150ee8eb26f7b5038e21a383.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://stages/terrain/truck/assets/sprite/truck_interior.png"
dest_files=["res://.godot/imported/truck_interior.png-ff9bd2d0107d83f7c4209d959ee69f15.ctex"]
source_file="res://stages/cockpit/assets/textures/stickers/cockpit_sticker_2.png"
dest_files=["res://.godot/imported/cockpit_sticker_2.png-d807c76b150ee8eb26f7b5038e21a383.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@@ -37,4 +38,4 @@ process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b3iqtjjj5xyw0"
path.s3tc="res://.godot/imported/cockpit_sticker_3.png-18043bf04a8085e1def5c583bc308daa.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://stages/cockpit/assets/textures/stickers/cockpit_sticker_3.png"
dest_files=["res://.godot/imported/cockpit_sticker_3.png-18043bf04a8085e1def5c583bc308daa.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bfqig5y56fwfs"
path.s3tc="res://.godot/imported/cockpit_sticker_4.png-4e4fb39a62d1c769ec6529b2ef9759e0.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://stages/cockpit/assets/textures/stickers/cockpit_sticker_4.png"
dest_files=["res://.godot/imported/cockpit_sticker_4.png-4e4fb39a62d1c769ec6529b2ef9759e0.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,41 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cq0xvydfqk0x4"
path.s3tc="res://.godot/imported/cockpit_sticker_5.png-56e6eb784061ef418c815c147c87ca74.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://stages/cockpit/assets/textures/stickers/cockpit_sticker_5.png"
dest_files=["res://.godot/imported/cockpit_sticker_5.png-56e6eb784061ef418c815c147c87ca74.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@@ -1,14 +1,23 @@
[gd_scene load_steps=28 format=3 uid="uid://fhnrl3dregsm"]
[gd_scene load_steps=47 format=3 uid="uid://fhnrl3dregsm"]
[ext_resource type="Script" uid="uid://b4tpigoloyxu0" path="res://stages/cockpit/scripts/cockpit.gd" id="1_koamw"]
[ext_resource type="Shader" uid="uid://bv2rghn44mrrf" path="res://stages/title_screen/resources/shaders/stars.gdshader" id="1_sk3hm"]
[ext_resource type="PackedScene" uid="uid://xsllr3c4yde1" path="res://stages/cockpit/assets/3d/cockpit.blend" id="2_3b5pk"]
[ext_resource type="Texture2D" uid="uid://63drr6hunnr" path="res://stages/cockpit/assets/textures/stickers/cockpit_sticker_2.png" id="2_x3r0l"]
[ext_resource type="Texture2D" uid="uid://l2xplg72hs6j" path="res://common/icons/map-pin.svg" id="3_3b5pk"]
[ext_resource type="Texture2D" uid="uid://bbf7yy5rbgyju" path="res://stages/cockpit/assets/textures/stickers/cockpit_sticker_1.png" id="3_5t1te"]
[ext_resource type="Texture2D" uid="uid://b3iqtjjj5xyw0" path="res://stages/cockpit/assets/textures/stickers/cockpit_sticker_3.png" id="3_i3c17"]
[ext_resource type="PackedScene" uid="uid://cm5b7w7j6527f" path="res://stages/title_screen/planet_3d.tscn" id="3_oq6nq"]
[ext_resource type="Texture2D" uid="uid://dks6cugwif2em" path="res://common/icons/phone.svg" id="4_bse8l"]
[ext_resource type="Texture2D" uid="uid://cq0xvydfqk0x4" path="res://stages/cockpit/assets/textures/stickers/cockpit_sticker_5.png" id="4_omtjc"]
[ext_resource type="Texture2D" uid="uid://dex283rx00fjb" path="res://common/icons/logout.svg" id="5_oq6nq"]
[ext_resource type="Script" uid="uid://bj4d1x8n8ina" path="res://stages/cockpit/scripts/cockpit_action.gd" id="6_22o3l"]
[ext_resource type="Script" uid="uid://jsxatpqfid88" path="res://stages/cockpit/scripts/cockpit_camera.gd" id="8_koamw"]
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="9_i3c17"]
[ext_resource type="Theme" uid="uid://5au2k3vf2po3" path="res://gui/ressources/menu.tres" id="10_i3c17"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="10_j2e5k"]
[ext_resource type="Texture2D" uid="uid://ba8vh5h3r6pr2" path="res://common/icons/focus.svg" id="11_6o275"]
[ext_resource type="PackedScene" uid="uid://clicjf8ts51h8" path="res://gui/game/inventory_gui/inventory_gui.tscn" id="11_eodxe"]
[ext_resource type="PackedScene" uid="uid://da7a74dg30q1l" path="res://stages/cockpit/player_3d/player_3D.tscn" id="13_a2cx2"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_7a1qq"]
shader = ExtResource("1_sk3hm")
@@ -49,51 +58,55 @@ fog_sky_affect = 0.0
adjustment_enabled = true
adjustment_saturation = 1.3
[sub_resource type="FastNoiseLite" id="FastNoiseLite_22o3l"]
seed = -1177198901
frequency = 1.0
[sub_resource type="PlaneMesh" id="PlaneMesh_omtjc"]
size = Vector2(0.2, 0.2)
[sub_resource type="Animation" id="Animation_koamw"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_i3c17"]
transparency = 1
albedo_texture = ExtResource("2_x3r0l")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_x34yc"]
transparency = 1
albedo_texture = ExtResource("3_i3c17")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_omtjc"]
transparency = 1
albedo_texture = ExtResource("3_5t1te")
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_b2myc"]
transparency = 1
albedo_texture = ExtResource("4_omtjc")
[sub_resource type="ViewportTexture" id="ViewportTexture_x34yc"]
viewport_path = NodePath("Screens/MissionStatusScreen/SubViewport")
[sub_resource type="ViewportTexture" id="ViewportTexture_omtjc"]
viewport_path = NodePath("Screens/MissionInfoScreen/SubViewport")
[sub_resource type="StyleBoxLine" id="StyleBoxLine_i3c17"]
color = Color(1, 1, 1, 1)
grow_begin = -20.0
grow_end = -20.0
thickness = 2
[sub_resource type="SphereShape3D" id="SphereShape3D_3b5pk"]
radius = 0.7953847
[sub_resource type="Animation" id="Animation_a2cx2"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../Planet3d:rotation:z")
tracks/0/path = NodePath("Sprite3D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_22o3l"]
resource_name = "turn"
length = 50.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("../Planet3d:rotation:z")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 50),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, -6.283]
"values": [Vector3(1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_biiuk"]
_data = {
&"RESET": SubResource("Animation_koamw"),
&"turn": SubResource("Animation_22o3l")
}
[sub_resource type="SphereShape3D" id="SphereShape3D_3b5pk"]
radius = 0.5618684
[sub_resource type="Animation" id="Animation_eodxe"]
resource_name = "hover"
length = 0.6
@@ -111,28 +124,30 @@ tracks/0/keys = {
"values": [Vector3(1, 1, 1), Vector3(1.4, 1.4, 1.4), Vector3(1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_a2cx2"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite3D:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(1, 1, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_6o275"]
_data = {
&"RESET": SubResource("Animation_a2cx2"),
&"hover": SubResource("Animation_eodxe")
}
[sub_resource type="SphereShape3D" id="SphereShape3D_oq6nq"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_eodxe"]
radius = 0.50097656
height = 1.5996094
[sub_resource type="Animation" id="Animation_j2e5k"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite3D2:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0.9, 0.9, 0.9)]
}
[sub_resource type="Animation" id="Animation_biiuk"]
resource_name = "hover"
@@ -141,53 +156,14 @@ loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite3D:scale")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.3, 0.6),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(0.4, 0.4, 0.4), Vector3(0.6, 0.6, 0.6), Vector3(0.4, 0.4, 0.4)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprite3D2:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.3, 0.6),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(0.4, 0.4, 0.4), Vector3(0.6, 0.6, 0.6), Vector3(0.4, 0.4, 0.4)]
}
[sub_resource type="Animation" id="Animation_j2e5k"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite3D:scale")
tracks/0/path = NodePath("Sprite3D2:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"times": PackedFloat32Array(0, 0.3, 0.6),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector3(0.4, 0.4, 0.4)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Sprite3D2:scale")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(0.4, 0.4, 0.4)]
"values": [Vector3(0.9, 0.9, 0.9), Vector3(1.2, 1.2, 1.2), Vector3(0.9, 0.9, 0.9)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_eodxe"]
@@ -196,64 +172,357 @@ _data = {
&"hover": SubResource("Animation_biiuk")
}
[sub_resource type="Animation" id="Animation_oq6nq"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_i3c17"]
seed = 1456598324
frequency = 1.0
[sub_resource type="Animation" id="Animation_koamw"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Camera3D:position:x")
tracks/0/path = NodePath("Planet3d:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0.35664433]
"update": 0,
"values": [Vector3(0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_22o3l"]
resource_name = "turn"
length = 50.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Planet3d:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 50),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 0, 0), Vector3(0, 0, -6.2831855)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_biiuk"]
_data = {
&"RESET": SubResource("Animation_koamw"),
&"turn": SubResource("Animation_22o3l")
}
[sub_resource type="Animation" id="Animation_gspic"]
resource_name = "Failed"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Screens/MissionStatusScreen/SubViewport/MissionStatusScreenBackground:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0.9849854, 0.19995773, 0.28067547, 0.74509805)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Camera3D:position:y")
tracks/1/path = NodePath("Screens/MissionInfoScreen/SubViewport/MissionInfoScreenBackground:color")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0.9843137, 0.2, 0.28235295, 0.74509805)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionSuceededLabel:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0.0]
"values": [false]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionFailedLabel:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("OmniLight3D:light_color")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0.97731525, 0.2915524, 0.2839255, 1)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionInProgressLabel:visible")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.033333335),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_bse8l"]
resource_name = "arrive"
[sub_resource type="Animation" id="Animation_ad5tn"]
resource_name = "InProgress"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Camera3D:position:x")
tracks/0/interp = 2
tracks/0/path = NodePath("Screens/MissionStatusScreen/SubViewport/MissionStatusScreenBackground:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [1.5, 0.4649279]
"values": [Color(0.9019608, 0.36078432, 0, 0.74509805)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Camera3D:position:y")
tracks/1/interp = 2
tracks/1/path = NodePath("Screens/MissionInfoScreen/SubViewport/MissionInfoScreenBackground:color")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.23333333, 0.5, 0.73333335, 1),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0, -0.1, 0.0, -0.1, 0.0]
"values": [Color(0.9, 0.36, 0, 0.74509805)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionSuceededLabel:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionFailedLabel:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("OmniLight3D:light_color")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 0.7176471, 0.011764706, 1)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionInProgressLabel:visible")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_4qr0g"]
[sub_resource type="Animation" id="Animation_i3c17"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Screens/MissionStatusScreen/SubViewport/MissionStatusScreenBackground:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0.9019608, 0.36078432, 0, 0.74509805)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Screens/MissionInfoScreen/SubViewport/MissionInfoScreenBackground:color")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0.9, 0.36, 0, 0.74509805)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionSuceededLabel:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionFailedLabel:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("OmniLight3D:light_color")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 0.7176471, 0.011764706, 1)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionInProgressLabel:visible")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_x34yc"]
resource_name = "Succeeded"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Screens/MissionStatusScreen/SubViewport/MissionStatusScreenBackground:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0.37824857, 0.63324684, 0.22696605, 0.74509805)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Screens/MissionInfoScreen/SubViewport/MissionInfoScreenBackground:color")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0.3764706, 0.6313726, 0.22745098, 0.74509805)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionSuceededLabel:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionFailedLabel:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("OmniLight3D:light_color")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0.5093917, 0.8912099, 0.21535316, 1)]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("Screens/MissionStatusScreen/SubViewport/MarginContainer/MissionInProgressLabel:visible")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_gspic"]
_data = {
&"RESET": SubResource("Animation_oq6nq"),
&"arrive": SubResource("Animation_bse8l")
&"Failed": SubResource("Animation_gspic"),
&"InProgress": SubResource("Animation_ad5tn"),
&"RESET": SubResource("Animation_i3c17"),
&"Succeeded": SubResource("Animation_x34yc")
}
[node name="Cockpit" type="Node3D"]
@@ -262,21 +531,182 @@ script = ExtResource("1_koamw")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_ers7b")
[node name="Stickers" type="Node3D" parent="."]
[node name="Sprite3D2" type="MeshInstance3D" parent="Stickers"]
transform = Transform3D(-1, -8.560637e-08, -1.7728233e-08, 0, 0.20278734, -0.9792228, 8.742278e-08, -0.9792228, -0.20278734, 2.1191812, 0.086021006, 1.3936621)
mesh = SubResource("PlaneMesh_omtjc")
surface_material_override/0 = SubResource("StandardMaterial3D_i3c17")
[node name="Sprite3D4" type="MeshInstance3D" parent="Stickers"]
transform = Transform3D(-1, 8.742278e-08, -3.821371e-15, 0, -4.371139e-08, -1, -8.742278e-08, -1, 4.371139e-08, 4.7137933, 0.1327298, 0.21573234)
mesh = SubResource("PlaneMesh_omtjc")
surface_material_override/0 = SubResource("StandardMaterial3D_x34yc")
[node name="Sprite3D5" type="MeshInstance3D" parent="Stickers"]
transform = Transform3D(-1, 8.742278e-08, -3.821371e-15, 0, -4.371139e-08, -1, -8.742278e-08, -1, 4.371139e-08, 4.512491, 0.377854, 0.21573234)
mesh = SubResource("PlaneMesh_omtjc")
surface_material_override/0 = SubResource("StandardMaterial3D_omtjc")
[node name="Sprite3D3" type="MeshInstance3D" parent="Stickers"]
transform = Transform3D(-1, -8.560637e-08, -1.7728233e-08, 0, 0.20278734, -0.9792228, 8.742278e-08, -0.9792228, -0.20278734, 1.8158855, 0.27269027, 1.4397132)
mesh = SubResource("PlaneMesh_omtjc")
surface_material_override/0 = SubResource("StandardMaterial3D_b2myc")
[node name="Cockpit" parent="." instance=ExtResource("2_3b5pk")]
[node name="Planet3d" parent="." instance=ExtResource("3_oq6nq")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -33.448, -83.679, 0)
radius = 80.0
details = 112
noise = SubResource("FastNoiseLite_22o3l")
height = 11.26
[node name="Screens" type="Node3D" parent="."]
[node name="AnimationPlayer" type="AnimationPlayer" parent="Planet3d"]
root_node = NodePath("../../ArriveAnimationPlayer")
libraries = {
&"": SubResource("AnimationLibrary_biiuk")
}
autoplay = "turn"
[node name="MissionStatusScreen" type="Sprite3D" parent="Screens"]
transform = Transform3D(-0.09661018, 0, 0.9953223, 0, 1, 0, -0.9953223, 0, -0.09661018, -0.9638628, 0.22434545, 0.9572436)
pixel_size = 0.003
texture = SubResource("ViewportTexture_x34yc")
[node name="SubViewport" type="SubViewport" parent="Screens/MissionStatusScreen"]
transparent_bg = true
size = Vector2i(300, 200)
[node name="MissionStatusScreenBackground" type="ColorRect" parent="Screens/MissionStatusScreen/SubViewport"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.9019608, 0.36078432, 0, 0.74509805)
[node name="MarginContainer" type="MarginContainer" parent="Screens/MissionStatusScreen/SubViewport"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="MissionInProgressLabel" type="Label" parent="Screens/MissionStatusScreen/SubViewport/MarginContainer"]
layout_mode = 2
size_flags_vertical = 1
text = "MISSION_IN_PROGRESS"
label_settings = ExtResource("9_i3c17")
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 2
[node name="MissionSuceededLabel" type="Label" parent="Screens/MissionStatusScreen/SubViewport/MarginContainer"]
visible = false
layout_mode = 2
size_flags_vertical = 1
text = "MISSION_SUCCEEDED"
label_settings = ExtResource("9_i3c17")
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 2
[node name="MissionFailedLabel" type="Label" parent="Screens/MissionStatusScreen/SubViewport/MarginContainer"]
visible = false
layout_mode = 2
size_flags_vertical = 1
text = "MISSION_FAILED"
label_settings = ExtResource("9_i3c17")
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 2
[node name="MissionInfoScreen" type="Sprite3D" parent="Screens"]
transform = Transform3D(0.06808507, 0, 0.99767953, 0, 1, 0, -0.99767953, 0, 0.06808507, -0.94923043, 0.32125425, -0.8842205)
pixel_size = 0.003
texture = SubResource("ViewportTexture_omtjc")
[node name="SubViewport" type="SubViewport" parent="Screens/MissionInfoScreen"]
transparent_bg = true
size = Vector2i(200, 260)
[node name="MissionInfoScreenBackground" type="ColorRect" parent="Screens/MissionInfoScreen/SubViewport"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.9, 0.36, 0, 0.74509805)
[node name="MarginContainer" type="MarginContainer" parent="Screens/MissionInfoScreen/SubViewport"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("10_j2e5k")
[node name="VBoxContainer" type="VBoxContainer" parent="Screens/MissionInfoScreen/SubViewport/MarginContainer"]
layout_mode = 2
theme = ExtResource("10_j2e5k")
[node name="RegionNameInfo" type="Label" parent="Screens/MissionInfoScreen/SubViewport/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "Blabloup"
label_settings = ExtResource("9_i3c17")
horizontal_alignment = 1
autowrap_mode = 2
[node name="HSeparator" type="HSeparator" parent="Screens/MissionInfoScreen/SubViewport/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 4
theme_override_styles/separator = SubResource("StyleBoxLine_i3c17")
[node name="DayNumberInfo" type="RichTextLabel" parent="Screens/MissionInfoScreen/SubViewport/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("10_i3c17")
theme_override_font_sizes/normal_font_size = 25
theme_override_font_sizes/bold_font_size = 25
theme_override_font_sizes/bold_italics_font_size = 25
theme_override_font_sizes/italics_font_size = 25
theme_override_font_sizes/mono_font_size = 25
bbcode_enabled = true
text = "Day [b]10[/b]"
fit_content = true
autowrap_mode = 2
horizontal_alignment = 1
[node name="PlantNumberInfo" type="RichTextLabel" parent="Screens/MissionInfoScreen/SubViewport/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("10_i3c17")
theme_override_font_sizes/normal_font_size = 25
theme_override_font_sizes/bold_font_size = 25
theme_override_font_sizes/bold_italics_font_size = 25
theme_override_font_sizes/italics_font_size = 25
theme_override_font_sizes/mono_font_size = 25
bbcode_enabled = true
text = "5 plants"
fit_content = true
autowrap_mode = 2
horizontal_alignment = 1
[node name="PlantPointInfo" type="RichTextLabel" parent="Screens/MissionInfoScreen/SubViewport/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("10_i3c17")
theme_override_font_sizes/normal_font_size = 25
theme_override_font_sizes/bold_font_size = 25
theme_override_font_sizes/bold_italics_font_size = 25
theme_override_font_sizes/italics_font_size = 25
theme_override_font_sizes/mono_font_size = 25
bbcode_enabled = true
text = "15 Garden Points"
fit_content = true
autowrap_mode = 2
horizontal_alignment = 1
[node name="OmniLight3D" type="OmniLight3D" parent="."]
transform = Transform3D(0.88172376, -0.12210212, 0.45569107, -0.47176614, -0.22820693, 0.8516797, -4.3180254e-08, -0.9659258, -0.2588191, 2.9457722, 1.2488832, -0.00129807)
light_color = Color(1, 0.7176471, 0.011764706, 1)
light_energy = 0.05
shadow_enabled = true
omni_attenuation = 0.048
[node name="Player3D" parent="." node_paths=PackedStringArray("pointer_texture_rect") instance=ExtResource("13_a2cx2")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 2.390058, -0.2572075, -0.05658534)
pointer_texture_rect = NodePath("../CanvasLayer/Pointer")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.88172376, -0.122102074, 0.45569107, -0.47176614, -0.22820692, 0.8516797, 0, -0.9659259, -0.25881907, 0.03206873, 3.2286942, -1.7533616)
@@ -287,16 +717,17 @@ directional_shadow_mode = 1
directional_shadow_split_1 = 0.039
[node name="MapAction" type="Area3D" parent="." node_paths=PackedStringArray("animation_player")]
unique_name_in_owner = true
transform = Transform3D(-4.371139e-08, -0.9816273, 0.19080897, 0, 0.19080897, 0.9816273, -1, 4.290829e-08, -8.340525e-09, -0.652, -0.162, 0)
script = ExtResource("6_22o3l")
animation_player = NodePath("AnimationPlayer")
[node name="Sprite3D" type="Sprite3D" parent="MapAction"]
transform = Transform3D(1, 0, 0, 0, 1, 3.5787761e-16, 0, -3.5787761e-16, 1, 0, 0, 0)
transform = Transform3D(1, 0, 0, 0, 1, 3.578776e-16, 0, -3.578776e-16, 1, 6.3611534e-09, 0.14808768, -0.0008355081)
texture = ExtResource("3_3b5pk")
[node name="CollisionShape3D" type="CollisionShape3D" parent="MapAction"]
transform = Transform3D(1, 2.1316282e-14, -5.3290705e-15, 0, 1, -3.5787743e-16, 0, -3.5787748e-16, 1, 4.1635495e-10, -0.011038661, -0.10670784)
transform = Transform3D(1, 2.4868996e-14, -6.217249e-15, 0, 1, -3.578774e-16, 0, -3.5787743e-16, 1, 6.077224e-09, 0.1160875, -0.13141868)
shape = SubResource("SphereShape3D_3b5pk")
[node name="AnimationPlayer" type="AnimationPlayer" parent="MapAction"]
@@ -313,44 +744,75 @@ texture = ExtResource("4_bse8l")
[node name="ExitAction" type="Area3D" parent="." node_paths=PackedStringArray("animation_player")]
unique_name_in_owner = true
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0.35664433, 0, 0)
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 1.9359307, -0.14775532, 1.3062965)
script = ExtResource("6_22o3l")
animation_player = NodePath("AnimationPlayer")
[node name="Sprite3D" type="Sprite3D" parent="ExitAction"]
transform = Transform3D(0.3899745, 0, -0.08899378, 0, 0.4, 0, 0.08899378, 0, 0.3899745, 1.22, -0.572, -1.003)
texture = ExtResource("5_oq6nq")
[node name="Sprite3D2" type="Sprite3D" parent="ExitAction"]
transform = Transform3D(0.38990447, 0, 0.089300044, 0, 0.4, 0, -0.089300044, 0, 0.38990447, -1.22, -0.572, -1.003)
transform = Transform3D(-3.934025e-08, 0, -0.9, 0, 0.9, 0, 0.9, 0, -3.934025e-08, 0, -0.09688908, 0)
flip_h = true
texture = ExtResource("5_oq6nq")
[node name="CollisionShape3D" type="CollisionShape3D" parent="ExitAction"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.1033944, -0.664206, -0.880886)
shape = SubResource("SphereShape3D_oq6nq")
[node name="CollisionShape3D2" type="CollisionShape3D" parent="ExitAction"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.103, -0.664, -0.881)
shape = SubResource("SphereShape3D_oq6nq")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.25628877, 0, -5.9604645e-07)
shape = SubResource("CapsuleShape3D_eodxe")
[node name="AnimationPlayer" type="AnimationPlayer" parent="ExitAction"]
libraries = {
&"": SubResource("AnimationLibrary_eodxe")
}
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0.35664433, 0, 0)
fov = 92.8
near = 0.003
script = ExtResource("8_koamw")
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="ArriveAnimationPlayer" type="AnimationPlayer" parent="."]
[node name="MarginContainer" type="MarginContainer" parent="CanvasLayer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("10_j2e5k")
[node name="Inventory" parent="CanvasLayer/MarginContainer" instance=ExtResource("11_eodxe")]
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 8
[node name="Pointer" type="TextureRect" parent="CanvasLayer"]
custom_minimum_size = Vector2(30, 30)
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -2.5
offset_top = -2.5
offset_right = 2.5
offset_bottom = 2.5
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
texture = ExtResource("11_6o275")
expand_mode = 1
[node name="Planet3d" parent="." instance=ExtResource("3_oq6nq")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -33.448, -83.679, 0)
radius = 80.0
details = 112
noise = SubResource("FastNoiseLite_i3c17")
height = 11.26
[node name="AnimationPlayer" type="AnimationPlayer" parent="Planet3d"]
root_node = NodePath("../..")
libraries = {
&"": SubResource("AnimationLibrary_biiuk")
}
[node name="StateAnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_4qr0g")
&"": SubResource("AnimationLibrary_gspic")
}
autoplay = "arrive"
[connection signal="clicked" from="MapAction" to="." method="_on_map_action_clicked"]
[connection signal="clicked" from="ExitAction" to="." method="_on_exit_action_clicked"]

View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=3 format=3 uid="uid://da7a74dg30q1l"]
[ext_resource type="Script" uid="uid://3rrym6yv7xyp" path="res://stages/cockpit/player_3d/scripts/player_3d.gd" id="1_pvvbh"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_eodxe"]
radius = 0.46868896
height = 1.7342377
[node name="Player3D" type="CharacterBody3D"]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0, 0)
script = ExtResource("1_pvvbh")
[node name="Camera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.19785136, 0)
near = 0.003
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.253273, 0)
shape = SubResource("CapsuleShape3D_eodxe")

View File

@@ -0,0 +1,71 @@
extends CharacterBody3D
const POINTER_TEXTURE = preload("res://common/icons/focus.svg")
const POINTER_ACTION_TEXTURE = preload("res://common/icons/hand-stop.svg")
@export var pointer_texture_rect : TextureRect
const SPEED = 2.0
const MOUSE_SENSIVITY = 0.002
const RAY_LENGTH = 10.
var cockpit_action_hovered : CockpitAction = null
var query_mouse := false
func _input(event):
if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
rotate_y(-event.relative.x * MOUSE_SENSIVITY)
%Camera3D.rotate_x(-event.relative.y * MOUSE_SENSIVITY)
%Camera3D.rotation.x = clampf($Camera3D.rotation.x, -deg_to_rad(70), deg_to_rad(70))
query_mouse = true
if event.is_action_pressed("action") and cockpit_action_hovered and cockpit_action_hovered:
cockpit_action_hovered.click()
func _physics_process(delta):
if query_mouse:
update_mouse_hovered_cockpit_actions()
if pointer_texture_rect :
pointer_texture_rect.texture = (
POINTER_ACTION_TEXTURE if cockpit_action_hovered != null
else POINTER_TEXTURE
)
query_mouse = false
# Add the gravity.
if not is_on_floor():
velocity += get_gravity() * delta
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var input_dir = Input.get_vector("move_left", "move_right", "move_up", "move_down")
var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
velocity.x = direction.x * SPEED
velocity.z = direction.z * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
velocity.z = move_toward(velocity.z, 0, SPEED)
move_and_slide()
func update_mouse_hovered_cockpit_actions() -> void:
var space_state = get_world_3d().direct_space_state
var middle_screen = get_viewport().get_visible_rect().size / 2
var from = %Camera3D.project_ray_origin(middle_screen)
var to = from + %Camera3D.project_ray_normal(middle_screen) * RAY_LENGTH
var query = PhysicsRayQueryParameters3D.create(from, to)
query.collide_with_areas = true
var result = space_state.intersect_ray(query)
if result and result.collider and result.collider is CockpitAction and result.collider.pickable:
if cockpit_action_hovered and cockpit_action_hovered != result.collider:
cockpit_action_hovered._on_mouse_exited()
cockpit_action_hovered = result.collider
cockpit_action_hovered._on_mouse_entered()
else :
if cockpit_action_hovered:
cockpit_action_hovered._on_mouse_exited()
cockpit_action_hovered = null

View File

@@ -0,0 +1 @@
uid://3rrym6yv7xyp

View File

@@ -3,3 +3,4 @@
[resource]
transparency = 1
blend_mode = 1
metallic_specular = 0.0

View File

@@ -1,3 +1,4 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://pwv7126nlcn2"]
[resource]
metallic_specular = 0.0

View File

@@ -4,4 +4,4 @@
albedo_color = Color(1, 0.7176471, 0.011764706, 1)
emission_enabled = true
emission = Color(1, 0.7176471, 0.011764706, 1)
emission_energy_multiplier = 0.8
emission_energy_multiplier = 0.5

View File

@@ -2,15 +2,35 @@ extends Node3D
class_name Cockpit
func _ready():
if not GameInfo.game_data.get_current_planet_data():
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
var region_data := GameInfo.game_data.current_region_data
if not GameInfo.game_data.current_region_data:
%ExitAction.hide()
%ExitAction.pickable = false
if region_data:
var state := region_data.get_state()
match state:
RegionData.State.IN_PROGRESS:
%StateAnimationPlayer.play("InProgress")
%MapAction.hide()
%MapAction.pickable = false
RegionData.State.FAILED:
%StateAnimationPlayer.play("Failed")
RegionData.State.SUCCEEDED:
%StateAnimationPlayer.play("Succeeded")
update_screen_info(region_data)
func _on_map_action_clicked():
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
SceneManager.change_scene("REGION_SELECTION")
func _on_exit_action_clicked():
if GameInfo.game_data.get_current_planet_data():
%ArriveAnimationPlayer.play_backwards("arrive")
await %ArriveAnimationPlayer.animation_finished
SceneManager.change_scene(SceneManager.PLANET_SCENE)
if GameInfo.game_data.current_region_data:
SceneManager.change_scene("REGION")
func update_screen_info(region_data : RegionData):
%RegionNameInfo.text = region_data.region_name
%DayNumberInfo.text = tr("DAY_%d") % region_data.day
%PlantNumberInfo.text = tr("%d_PLANTS") % len(region_data.score_by_plant)
%PlantPointInfo.text = tr("SCORE_%d") % region_data.get_score()

View File

@@ -1,6 +1,8 @@
extends Area3D
class_name CockpitAction
var pickable = true
signal clicked
@export var animation_player : AnimationPlayer

View File

@@ -1,39 +0,0 @@
extends Camera3D
const RAY_LENGTH = 1000.
var cockpit_action_hovered : CockpitAction = null
var _mouse_event : InputEventMouse
var _query_mouse := false
func _unhandled_input(event):
if event is InputEventMouse:
_mouse_event = event
_query_mouse = true
if event.is_action_pressed("action") and cockpit_action_hovered and cockpit_action_hovered:
cockpit_action_hovered.click()
func _physics_process(_delta):
if _query_mouse:
update_mouse_hovered_cockpit_actions()
_query_mouse = false
func update_mouse_hovered_cockpit_actions() -> void:
var space_state = get_world_3d().direct_space_state
var from = project_ray_origin(_mouse_event.position)
var to = from + project_ray_normal(_mouse_event.position) * RAY_LENGTH
var query = PhysicsRayQueryParameters3D.create(from, to)
query.collide_with_areas = true
var result = space_state.intersect_ray(query)
if result.is_empty():
if cockpit_action_hovered:
cockpit_action_hovered._on_mouse_exited()
cockpit_action_hovered = null
elif result.collider is CockpitAction:
if cockpit_action_hovered and cockpit_action_hovered != result.collider:
cockpit_action_hovered._on_mouse_exited()
cockpit_action_hovered = result.collider
cockpit_action_hovered._on_mouse_entered()

View File

@@ -1 +0,0 @@
uid://jsxatpqfid88

View File

@@ -1,7 +1,31 @@
[gd_scene load_steps=2 format=3 uid="uid://d0n52psuns1vl"]
[gd_scene load_steps=3 format=3 uid="uid://d0n52psuns1vl"]
[ext_resource type="Script" uid="uid://ddf3fktoer2ng" path="res://stages/intro/scripts/intro.gd" id="1_2nxbv"]
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_851lr"]
[node name="Intro" type="Node"]
script = ExtResource("1_2nxbv")
game_scene_path = "uid://d28cp7a21kwou"
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = 100
[node name="MarginContainer" type="MarginContainer" parent="CanvasLayer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme = ExtResource("2_851lr")
[node name="PassDialogButton" type="Button" parent="CanvasLayer/MarginContainer"]
unique_name_in_owner = true
modulate = Color(1, 1, 1, 0.23529412)
layout_mode = 2
size_flags_horizontal = 8
size_flags_vertical = 8
theme = ExtResource("2_851lr")
theme_override_font_sizes/font_size = 20
text = "PASS_THE_DIALOG"
flat = true

View File

@@ -4,33 +4,35 @@ class_name Intro
var steps : Array[IntroStep]
@export_file var game_scene_path : String
var pass_asked := false
var tutorial_started := false
func _ready():
%PassDialogButton.button_down.connect(_on_pass_dialog_button_pressed)
Dialogic.start('demeter_intro')
await Dialogic.timeline_ended
Dialogic.timeline_ended.connect(start_tutorial)
await LoadingScreen.show_loading_screen()
func start_tutorial():
if not tutorial_started:
tutorial_started = true
Dialogic.end_timeline()
GameInfo.game_data.start_region(
RegionParameter.new(
10,
3,
"Tutorial",
true,
)
)
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
SceneManager.change_scene("REGION")
# for c in get_children():
# if c is IntroStep:
# steps.append(c)
# c.hide()
# for i in range(len(steps)):
# steps[i].step_over.connect(
# func():
# change_step(i+1)
# )
# change_step(0)
# func change_step(nb):
# if nb >= len(steps):
# get_tree().change_scene_to_file(game_scene_path)
# for i in range(len(steps)):
# if i == nb:
# steps[i].show()
# else :
# steps[i].hide()
func _on_pass_dialog_button_pressed():
if not pass_asked:
pass_asked = true
%PassDialogButton.text = tr('ARE_YOU_SURE')
else:
start_tutorial()

View File

@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://j8cd0qbk4bma" path="res://stages/region_selection/region_point/scripts/region_point.gd" id="1_65ijn"]
[ext_resource type="Script" uid="uid://b4eimt3v08jhc" path="res://common/game_data/scripts/run/run_point.gd" id="2_34ylp"]
[ext_resource type="Script" uid="uid://ddk7j5b8p51dk" path="res://stages/terrain/planet/scripts/planet_parameter.gd" id="3_dm7jk"]
[ext_resource type="Script" uid="uid://ddk7j5b8p51dk" path="res://stages/terrain/region/scripts/region_parameter.gd" id="3_dm7jk"]
[ext_resource type="Texture2D" uid="uid://dqsx56wc73wry" path="res://common/icons/map-pin-check.svg" id="4_ndccb"]
[sub_resource type="Resource" id="Resource_ndccb"]

View File

@@ -15,15 +15,24 @@ var selected_run_point : RunPoint
@export_tool_button("Update Region Points", "Callable") var update_action = update_region_points
@onready var run_data : RunData = GameInfo.game_data.current_run
var run_data : RunData
@onready var planet_radius = %Planet3d.radius + %Planet3d.height
func _ready():
var region_data = GameInfo.game_data.current_region_data
if (
not GameInfo.game_data.current_run
or (region_data and region_data.get_state() == RegionData.State.FAILED)
or GameInfo.game_data.current_run.get_state() == RunData.State.FINISHED
):
GameInfo.game_data.start_run()
run_data = GameInfo.game_data.current_run
%TravelValidation.hide()
update_region_points()
%Planet3d.generate_noise(GameInfo.game_data.current_run.run_seed)
if not GameInfo.game_data.get_current_planet_data():
if not GameInfo.game_data.current_region_data:
%ReturnButton.hide()
func _process(delta):
@@ -98,17 +107,17 @@ func update_region_points():
func _on_camera_3d_region_point_clicked(rp : RunPoint):
selected_run_point = rp
%TravelValidationLabel.text = tr("TRAVEL_TO_REGION_%s") % rp.region_name
%TravelValidationLabel.text = tr("TRAVEL_TO_REGION_%s") % rp.region_parameter.name
%TravelValidation.show()
func _on_travel_validation_go_button_button_down():
if selected_run_point:
GameInfo.game_data.current_run.choose_next_run_point(selected_run_point)
SceneManager.change_scene(SceneManager.PLANET_SCENE)
SceneManager.change_scene("REGION")
func _on_travel_validation_no_now_button_button_down():
%TravelValidation.hide()
func _on_return_button_button_down():
if GameInfo.game_data.get_current_planet_data():
SceneManager.change_scene(SceneManager.COCKPIT_SCENE)
if GameInfo.game_data.current_region_data:
SceneManager.change_scene("COCKPIT")

View File

@@ -1,44 +0,0 @@
[gd_scene load_steps=9 format=3 uid="uid://tsi5j1uxppa4"]
[ext_resource type="Script" uid="uid://d1mp5sguc0b6u" path="res://stages/terrain/planet/scripts/planet.gd" id="1_y7d8a"]
[ext_resource type="PackedScene" uid="uid://dt6mptqg80dew" path="res://gui/game/tutorial/tutorial.tscn" id="2_0wx6t"]
[ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="2_02xai"]
[ext_resource type="PackedScene" uid="uid://yk78ubpu5ghq" path="res://gui/game/pass_day/pass_day.tscn" id="3_0wx6t"]
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="3_6qoee"]
[ext_resource type="PackedScene" uid="uid://bgvbgeq46wee2" path="res://entities/player/player.tscn" id="4_hyapw"]
[ext_resource type="PackedScene" uid="uid://cg1visg52i21a" path="res://entities/interactables/truck/ladder/truck_ladder.tscn" id="5_yjoqs"]
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/truck/recharge/truck_recharge.tscn" id="6_0wx6t"]
[node name="Planet" type="Node2D" node_paths=PackedStringArray("entity_container")]
script = ExtResource("1_y7d8a")
entity_container = NodePath("Entities")
[node name="PlanetGui" type="CanvasLayer" parent="."]
layer = 2
[node name="Tutorial" parent="PlanetGui" node_paths=PackedStringArray("player", "planet") instance=ExtResource("2_0wx6t")]
player = NodePath("../../Entities/Player")
planet = NodePath("../..")
[node name="PassDay" parent="PlanetGui" instance=ExtResource("3_0wx6t")]
unique_name_in_owner = true
[node name="GameGui" parent="." instance=ExtResource("2_02xai")]
[node name="Entities" type="Node2D" parent="."]
y_sort_enabled = true
[node name="Player" parent="Entities" instance=ExtResource("4_hyapw")]
[node name="TruckLadder" parent="Entities" instance=ExtResource("5_yjoqs")]
position = Vector2(71, -149)
[node name="TruckRecharge" parent="Entities" instance=ExtResource("6_0wx6t")]
position = Vector2(-85, -165)
[node name="Camera" parent="." node_paths=PackedStringArray("following") instance=ExtResource("3_6qoee")]
position = Vector2(573, 324)
following = NodePath("../Entities/Player")
[connection signal="pass_day_ended" from="." to="GameGui" method="_on_planet_pass_day_ended"]
[connection signal="pass_day_started" from="." to="GameGui" method="_on_planet_pass_day_started"]

View File

@@ -1,60 +0,0 @@
extends Node2D
class_name Garden
var plants : Array[Plant]
var planet_data : PlanetData
func _init(_planet_data : PlanetData, _initial_plants : Array[Plant] = []):
planet_data = _planet_data
plants = _initial_plants
# update_garden_score()
func _ready():
for p in plants:
p.harvested.connect(_on_plant_harvested)
p.state_changed.connect(_on_plant_state_changed)
func get_score():
var score = 0
planet_data.score_by_plant.resize(len(plants))
for i in range(len(plants)):
var plant_score = plants[i].calculate_plant_score()
score += plant_score
var old_score = 0 if planet_data.score_by_plant[i] == null else planet_data.score_by_plant[i]
if old_score < plant_score:
planet_data.plant_has_gained_score(plants[i], plant_score - old_score)
planet_data.score_by_plant[i] = plant_score
return score
func plant(
type : PlantType,
plant_mutations : Array[PlantMutation] = []
) -> Plant:
var new_plant = Plant.new(
type,
plant_mutations
)
plants.append(new_plant)
planet_data.score_by_plant.append(0)
new_plant.harvested.connect(_on_plant_harvested)
new_plant.state_changed.connect(_on_plant_state_changed)
get_tree().create_timer(0.05).timeout.connect(update_garden_score)
return new_plant
func _on_plant_state_changed(_p: Plant):
update_garden_score()
func _on_plant_harvested(p: Plant):
remove_plant(p)
func remove_plant(p: Plant):
var id = plants.find(p)
if id >= 0:
plants.remove_at(id)
planet_data.score_by_plant.remove_at(id)
get_tree().create_timer(0.05).timeout.connect(update_garden_score)
func update_garden_score():
planet_data.garden_score = get_score()

View File

@@ -1 +0,0 @@
uid://dpgtjhjgfqquj

View File

@@ -1,62 +0,0 @@
extends Resource
class_name PlanetData
signal plant_gaining_score(p : Plant, amount : int)
signal updated(planet_data : PlanetData)
const DEFAULT_START_CHARGE := 10
const DEFAULT_OBJECTIVE := 10
@export var planet_seed : int
@export var garden_score : int = 0 :
set(v):
garden_score = v
updated.emit(self)
@export var day : int = 1
@export var entities_saved_data : Array[EntityData] = []
@export var score_by_plant : Array[int] = []
@export var generated_chunk_entities : Array[Vector2i]
@export var tutorial_step : int = 0
@export var chunks_data : Dictionary[String, ChunkData]
@export var charges : int
@export var objective : int
func _init(
parameter : PlanetParameter = PlanetParameter.new()
):
charges = parameter.charges
objective = parameter.objective
planet_seed = parameter.planet_seed
#region ------------------ Chunks ------------------
func get_coord_id(coord):
return "%d:%d" % [coord.x, coord.y]
func has_chunk_data(coord : Vector2i) -> bool:
return chunks_data.has(get_coord_id(coord))
func add_chunk_data(coord : Vector2i, data : ChunkData):
chunks_data[get_coord_id(coord)] = data
func get_chunk_data(coord : Vector2i) -> ChunkData:
return chunks_data[get_coord_id(coord)]
func get_or_create_chunk_data(coord : Vector2i) -> ChunkData:
if has_chunk_data(coord):
return get_chunk_data(coord)
else:
var new_chunk_data = ChunkData.new(coord)
add_chunk_data(coord, new_chunk_data)
return new_chunk_data
#endregion
#region ------------------ Score ------------------
func plant_has_gained_score(plant : Plant, amount : int):
plant_gaining_score.emit(plant, amount)
#endregion

View File

@@ -1,14 +0,0 @@
extends Resource
class_name PlanetParameter
@export var charges : int
@export var objective : int
@export var planet_seed : int
func _init(
_charges : int = 10,
_objective : int = 10
):
charges = _charges
objective = _objective
planet_seed = randi()

View File

@@ -3,12 +3,12 @@
importer="wav"
type="AudioStreamWAV"
uid="uid://cjspglv6gidd7"
path="res://.godot/imported/alert.wav-d5e63ab6c4571ed5f0d9340b9c046178.sample"
path="res://.godot/imported/alert.wav-d6f6d417dbab2ed86fb9c828e1764c61.sample"
[deps]
source_file="res://stages/terrain/planet/assets/sounds/alert.wav"
dest_files=["res://.godot/imported/alert.wav-d5e63ab6c4571ed5f0d9340b9c046178.sample"]
source_file="res://stages/terrain/region/assets/sounds/alert.wav"
dest_files=["res://.godot/imported/alert.wav-d6f6d417dbab2ed86fb9c828e1764c61.sample"]
[params]

View File

@@ -3,12 +3,12 @@
importer="wav"
type="AudioStreamWAV"
uid="uid://c30s61i0j7l88"
path="res://.godot/imported/quota_announcement.wav-e296196858a1e87a106693abaaa5f6af.sample"
path="res://.godot/imported/quota_announcement.wav-b06177dc8ee27bb609c7b0a8b9812aa9.sample"
[deps]
source_file="res://stages/terrain/planet/assets/sounds/quota_announcement.wav"
dest_files=["res://.godot/imported/quota_announcement.wav-e296196858a1e87a106693abaaa5f6af.sample"]
source_file="res://stages/terrain/region/assets/sounds/quota_announcement.wav"
dest_files=["res://.godot/imported/quota_announcement.wav-b06177dc8ee27bb609c7b0a8b9812aa9.sample"]
[params]

View File

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cd62k5urdpw3i"
path="res://.godot/imported/blue_rect.png-d2bf0f89bd9a318145a3150338e6ed14.ctex"
path="res://.godot/imported/blue_rect.png-6eb6bcb621810ab61b6d3aead70129b2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/blue_rect.png"
dest_files=["res://.godot/imported/blue_rect.png-d2bf0f89bd9a318145a3150338e6ed14.ctex"]
source_file="res://stages/terrain/region/assets/textures/blue_rect.png"
dest_files=["res://.godot/imported/blue_rect.png-6eb6bcb621810ab61b6d3aead70129b2.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bnrjnvceprxfn"
path="res://.godot/imported/garden_background_texture.png-15af9185e7f2afb324adf3e5bc16d734.ctex"
path="res://.godot/imported/garden_background_texture.png-002bbb09c02ebe4313ea8a293c00ef9e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/garden_background_texture.png"
dest_files=["res://.godot/imported/garden_background_texture.png-15af9185e7f2afb324adf3e5bc16d734.ctex"]
source_file="res://stages/terrain/region/assets/textures/garden_background_texture.png"
dest_files=["res://.godot/imported/garden_background_texture.png-002bbb09c02ebe4313ea8a293c00ef9e.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bseoyd8mqjo7y"
path="res://.godot/imported/garden_decontamined_background_texture.png-059bd195ae2e24916e642e6f3275cffd.ctex"
path="res://.godot/imported/garden_decontamined_background_texture.png-d2e9b3111739dbe0f3e878510238390a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/garden_decontamined_background_texture.png"
dest_files=["res://.godot/imported/garden_decontamined_background_texture.png-059bd195ae2e24916e642e6f3275cffd.ctex"]
source_file="res://stages/terrain/region/assets/textures/garden_decontamined_background_texture.png"
dest_files=["res://.godot/imported/garden_decontamined_background_texture.png-d2e9b3111739dbe0f3e878510238390a.ctex"]
[params]

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ex35g5nvtsy0"
path="res://.godot/imported/garden_decontamined_background_texture_old.png-df017d633ed63644def49f2ef3a9d5b3.ctex"
path="res://.godot/imported/garden_decontamined_background_texture_old.png-951b3e125e8b7083a60c2b7435bce68a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/garden_decontamined_background_texture_old.png"
dest_files=["res://.godot/imported/garden_decontamined_background_texture_old.png-df017d633ed63644def49f2ef3a9d5b3.ctex"]
source_file="res://stages/terrain/region/assets/textures/garden_decontamined_background_texture_old.png"
dest_files=["res://.godot/imported/garden_decontamined_background_texture_old.png-951b3e125e8b7083a60c2b7435bce68a.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bvangyp301tsp"
path="res://.godot/imported/green_rect.png-2cde15567ae810adb5864776d70ef438.ctex"
path="res://.godot/imported/green_rect.png-5f705079cd8c03d8ad17266e7ce975db.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/green_rect.png"
dest_files=["res://.godot/imported/green_rect.png-2cde15567ae810adb5864776d70ef438.ctex"]
source_file="res://stages/terrain/region/assets/textures/green_rect.png"
dest_files=["res://.godot/imported/green_rect.png-5f705079cd8c03d8ad17266e7ce975db.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://yl4dg6gerykb"
path="res://.godot/imported/green_tiles.png-24cb2e8d3d77d0f127478dc375fc7791.ctex"
path="res://.godot/imported/green_tiles.png-8b5f7bc46b5efa30092dac78c9cc56fc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/green_tiles.png"
dest_files=["res://.godot/imported/green_tiles.png-24cb2e8d3d77d0f127478dc375fc7791.ctex"]
source_file="res://stages/terrain/region/assets/textures/green_tiles.png"
dest_files=["res://.godot/imported/green_tiles.png-8b5f7bc46b5efa30092dac78c9cc56fc.ctex"]
[params]

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://o43d0p2ojbbh"
path="res://.godot/imported/moss_contamination_atlas_red.png-285da16354bb22d2c5b8102e267e7ff9.ctex"
path="res://.godot/imported/moss_contamination_atlas_red.png-70e6e889f4d027e7e5a753054fb81f78.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/moss_biome/moss_contamination_atlas_red.png"
dest_files=["res://.godot/imported/moss_contamination_atlas_red.png-285da16354bb22d2c5b8102e267e7ff9.ctex"]
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_contamination_atlas_red.png"
dest_files=["res://.godot/imported/moss_contamination_atlas_red.png-70e6e889f4d027e7e5a753054fb81f78.ctex"]
[params]

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dr72xhc07i56e"
path="res://.godot/imported/moss_contamination_atlas_texture.png-315849d799f890ff8a71f9ec9fcd4776.ctex"
path="res://.godot/imported/moss_contamination_atlas_texture.png-80aa9a19eb65e2c40b783557f4f8a743.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/moss_biome/moss_contamination_atlas_texture.png"
dest_files=["res://.godot/imported/moss_contamination_atlas_texture.png-315849d799f890ff8a71f9ec9fcd4776.ctex"]
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_contamination_atlas_texture.png"
dest_files=["res://.godot/imported/moss_contamination_atlas_texture.png-80aa9a19eb65e2c40b783557f4f8a743.ctex"]
[params]

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cquonnydto387"
path="res://.godot/imported/moss_contamination_atlas_texture_2.png-273150e06680f719d234dbf50850407d.ctex"
path="res://.godot/imported/moss_contamination_atlas_texture_2.png-d3b17c123dfe73058f82ef745ed7ae76.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/moss_biome/moss_contamination_atlas_texture_2.png"
dest_files=["res://.godot/imported/moss_contamination_atlas_texture_2.png-273150e06680f719d234dbf50850407d.ctex"]
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_contamination_atlas_texture_2.png"
dest_files=["res://.godot/imported/moss_contamination_atlas_texture_2.png-d3b17c123dfe73058f82ef745ed7ae76.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://c07hqxv7mybw7"
path="res://.godot/imported/moss_element_1.png-a6f9a32694a449c52289ffe35904adcc.ctex"
path="res://.godot/imported/moss_element_1.png-5689c80beabd4d37765ecc4aa128cd18.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/moss_biome/moss_element_1.png"
dest_files=["res://.godot/imported/moss_element_1.png-a6f9a32694a449c52289ffe35904adcc.ctex"]
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_element_1.png"
dest_files=["res://.godot/imported/moss_element_1.png-5689c80beabd4d37765ecc4aa128cd18.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://x68ggxb8jbid"
path="res://.godot/imported/moss_element_2.png-5cbf59b34a70d33c02f41b72eab35dd5.ctex"
path="res://.godot/imported/moss_element_2.png-0612506a49d7e87c3d31a8a0d4bbe052.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/moss_biome/moss_element_2.png"
dest_files=["res://.godot/imported/moss_element_2.png-5cbf59b34a70d33c02f41b72eab35dd5.ctex"]
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_element_2.png"
dest_files=["res://.godot/imported/moss_element_2.png-0612506a49d7e87c3d31a8a0d4bbe052.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cb1k4g8fcsuke"
path="res://.godot/imported/moss_element_3.png-c6f84b36571c3be4bea3a4fbc54917b2.ctex"
path="res://.godot/imported/moss_element_3.png-590cfa4dea5af9388a3be231b1eb9e69.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/moss_biome/moss_element_3.png"
dest_files=["res://.godot/imported/moss_element_3.png-c6f84b36571c3be4bea3a4fbc54917b2.ctex"]
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_element_3.png"
dest_files=["res://.godot/imported/moss_element_3.png-590cfa4dea5af9388a3be231b1eb9e69.ctex"]
[params]

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dsa7wbwjiebnw"
path="res://.godot/imported/moss_ground_texture.png-c04fbb538eff33b5a200a959b09aefb5.ctex"
path="res://.godot/imported/moss_ground_texture.png-db5ac5662696a68d00ce73febb556cc3.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/moss_biome/moss_ground_texture.png"
dest_files=["res://.godot/imported/moss_ground_texture.png-c04fbb538eff33b5a200a959b09aefb5.ctex"]
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_ground_texture.png"
dest_files=["res://.godot/imported/moss_ground_texture.png-db5ac5662696a68d00ce73febb556cc3.ctex"]
[params]

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ch4rydip0nlt6"
path="res://.godot/imported/moss_rock_atlas_texture.png-9e39fbed50de2857d6c90ff91f86917a.ctex"
path="res://.godot/imported/moss_rock_atlas_texture.png-42db73700a39c396acd665f1acf7a968.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/moss_biome/moss_rock_atlas_texture.png"
dest_files=["res://.godot/imported/moss_rock_atlas_texture.png-9e39fbed50de2857d6c90ff91f86917a.ctex"]
source_file="res://stages/terrain/region/assets/textures/moss_biome/moss_rock_atlas_texture.png"
dest_files=["res://.godot/imported/moss_rock_atlas_texture.png-42db73700a39c396acd665f1acf7a968.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bi08trir23od2"
path="res://.godot/imported/red_rect.png-2c97ffc5003cb92590914f11ff4ed41d.ctex"
path="res://.godot/imported/red_rect.png-37a9e533ba7e4668f9eb8a241791dccb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/red_rect.png"
dest_files=["res://.godot/imported/red_rect.png-2c97ffc5003cb92590914f11ff4ed41d.ctex"]
source_file="res://stages/terrain/region/assets/textures/red_rect.png"
dest_files=["res://.godot/imported/red_rect.png-37a9e533ba7e4668f9eb8a241791dccb.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ddecvei4l62gn"
path="res://.godot/imported/red_tiles.png-0bb5056d42a3159163beb701fb8aa247.ctex"
path="res://.godot/imported/red_tiles.png-a93183162dddbf2e40094e4a73dd9c29.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/red_tiles.png"
dest_files=["res://.godot/imported/red_tiles.png-0bb5056d42a3159163beb701fb8aa247.ctex"]
source_file="res://stages/terrain/region/assets/textures/red_tiles.png"
dest_files=["res://.godot/imported/red_tiles.png-a93183162dddbf2e40094e4a73dd9c29.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 190 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://beqx4rmgthkql"
path="res://.godot/imported/rock_background_texture.png-7bbae13b0384e1483bd66633981b566b.ctex"
path="res://.godot/imported/rock_background_texture.png-79a8569ff49f7d85f8b64d55ac1ce62d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/rock_background_texture.png"
dest_files=["res://.godot/imported/rock_background_texture.png-7bbae13b0384e1483bd66633981b566b.ctex"]
source_file="res://stages/terrain/region/assets/textures/rock_background_texture.png"
dest_files=["res://.godot/imported/rock_background_texture.png-79a8569ff49f7d85f8b64d55ac1ce62d.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 315 KiB

After

Width:  |  Height:  |  Size: 315 KiB

View File

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 204 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://02nuoqleo4yu"
path="res://.godot/imported/rock_cristal_texture.png-33ee9694873f9aa2e8604c502b12dee5.ctex"
path="res://.godot/imported/rock_cristal_texture.png-c34612644dbfa24e49296bfe43df46c6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/rock_cristal_texture.png"
dest_files=["res://.godot/imported/rock_cristal_texture.png-33ee9694873f9aa2e8604c502b12dee5.ctex"]
source_file="res://stages/terrain/region/assets/textures/rock_cristal_texture.png"
dest_files=["res://.godot/imported/rock_cristal_texture.png-c34612644dbfa24e49296bfe43df46c6.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bmdb63witojeg"
path="res://.godot/imported/round_red_tiles.png-7f838ac911f20be784ac93821bd5d5ba.ctex"
path="res://.godot/imported/round_red_tiles.png-c254569faa1f0323275dcc266f2b4c86.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://stages/terrain/planet/assets/textures/round_red_tiles.png"
dest_files=["res://.godot/imported/round_red_tiles.png-7f838ac911f20be784ac93821bd5d5ba.ctex"]
source_file="res://stages/terrain/region/assets/textures/round_red_tiles.png"
dest_files=["res://.godot/imported/round_red_tiles.png-c254569faa1f0323275dcc266f2b4c86.ctex"]
[params]

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://bnwq0xl7ak661"]
[ext_resource type="Script" uid="uid://d1mp5sguc0b6u" path="res://stages/terrain/planet/scripts/planet.gd" id="1_ne67o"]
[ext_resource type="Script" uid="uid://d1mp5sguc0b6u" path="res://stages/terrain/region/scripts/region.gd" id="1_ne67o"]
[node name="Planet" type="Node2D"]
script = ExtResource("1_ne67o")

View File

@@ -0,0 +1,43 @@
[gd_scene load_steps=9 format=3 uid="uid://tsi5j1uxppa4"]
[ext_resource type="Script" uid="uid://d1mp5sguc0b6u" path="res://stages/terrain/region/scripts/region.gd" id="1_441sk"]
[ext_resource type="PackedScene" uid="uid://dt6mptqg80dew" path="res://gui/game/tutorial/tutorial.tscn" id="2_2f6js"]
[ext_resource type="PackedScene" uid="uid://yk78ubpu5ghq" path="res://gui/game/pass_day/pass_day.tscn" id="3_ktnx3"]
[ext_resource type="PackedScene" uid="uid://12nak7amd1uq" path="res://gui/game/game_gui.tscn" id="4_qdnee"]
[ext_resource type="PackedScene" uid="uid://bgvbgeq46wee2" path="res://entities/player/player.tscn" id="5_ovqi1"]
[ext_resource type="PackedScene" uid="uid://cg1visg52i21a" path="res://entities/interactables/ladder/ladder.tscn" id="6_2w03p"]
[ext_resource type="PackedScene" uid="uid://d324mlmgls4fs" path="res://entities/interactables/truck/recharge/truck_recharge.tscn" id="7_6d8m3"]
[ext_resource type="PackedScene" uid="uid://dj7gp3crtg2yt" path="res://entities/camera/camera.tscn" id="8_fwgig"]
[node name="Region" type="Node2D" node_paths=PackedStringArray("entity_container")]
script = ExtResource("1_441sk")
first_loot_number = null
loot_item_number = null
entity_container = NodePath("Entities")
[node name="RegionGui" type="CanvasLayer" parent="."]
layer = 2
[node name="Tutorial" parent="RegionGui" node_paths=PackedStringArray("player", "region") instance=ExtResource("2_2f6js")]
player = NodePath("../../Entities/Player")
region = NodePath("../..")
[node name="PassDay" parent="RegionGui" instance=ExtResource("3_ktnx3")]
unique_name_in_owner = true
[node name="GameGui" parent="." instance=ExtResource("4_qdnee")]
[node name="Entities" type="Node2D" parent="."]
y_sort_enabled = true
[node name="TruckLadder" parent="Entities" instance=ExtResource("6_2w03p")]
position = Vector2(51, -112)
[node name="Player" parent="Entities" instance=ExtResource("5_ovqi1")]
z_index = 1
[node name="TruckRecharge" parent="Entities" instance=ExtResource("7_6d8m3")]
position = Vector2(-50, -124)
[node name="Camera" parent="." node_paths=PackedStringArray("following") instance=ExtResource("8_fwgig")]
following = NodePath("../Entities/Player")

View File

@@ -1,7 +1,7 @@
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://b3vnia5tb6pil"]
[ext_resource type="Shader" uid="uid://q5isn3rwrir8" path="res://common/vfx/materials/shaders/texture_color_filter.gdshader" id="1_4m73r"]
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/planet/assets/textures/garden_background_texture.png" id="2_4m73r"]
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/region/assets/textures/garden_background_texture.png" id="2_4m73r"]
[resource]
shader = ExtResource("1_4m73r")

View File

@@ -1,7 +1,7 @@
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://85ap1buim1ha"]
[ext_resource type="Shader" uid="uid://q5isn3rwrir8" path="res://common/vfx/materials/shaders/texture_color_filter.gdshader" id="1_v8wor"]
[ext_resource type="Texture2D" uid="uid://bseoyd8mqjo7y" path="res://stages/terrain/planet/assets/textures/garden_decontamined_background_texture.png" id="2_v8wor"]
[ext_resource type="Texture2D" uid="uid://bseoyd8mqjo7y" path="res://stages/terrain/region/assets/textures/garden_decontamined_background_texture.png" id="2_v8wor"]
[resource]
shader = ExtResource("1_v8wor")

View File

@@ -1,8 +1,8 @@
[gd_resource type="ShaderMaterial" load_steps=6 format=3 uid="uid://bq3dmwkej5gmx"]
[ext_resource type="Shader" uid="uid://bglep64ppn74p" path="res://common/vfx/materials/shaders/textures_data_filter.gdshader" id="1_kujx0"]
[ext_resource type="Texture2D" uid="uid://beqx4rmgthkql" path="res://stages/terrain/planet/assets/textures/rock_background_texture.png" id="2_6cs2h"]
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/planet/assets/textures/garden_background_texture.png" id="2_ydx6d"]
[ext_resource type="Texture2D" uid="uid://beqx4rmgthkql" path="res://stages/terrain/region/assets/textures/rock_background_texture.png" id="2_6cs2h"]
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/region/assets/textures/garden_background_texture.png" id="2_ydx6d"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_kujx0"]
noise_type = 0

View File

@@ -1,8 +1,8 @@
[gd_resource type="ShaderMaterial" load_steps=6 format=3 uid="uid://ljvaj1vab53a"]
[ext_resource type="Shader" uid="uid://bglep64ppn74p" path="res://common/vfx/materials/shaders/textures_data_filter.gdshader" id="1_ye8oh"]
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/planet/assets/textures/garden_background_texture.png" id="2_6hswu"]
[ext_resource type="Texture2D" uid="uid://c3t26nlbnkxg7" path="res://stages/terrain/planet/assets/textures/garden_decontamined_background_texture_old.png" id="2_r7pv0"]
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/region/assets/textures/garden_background_texture.png" id="2_6hswu"]
[ext_resource type="Texture2D" uid="uid://ex35g5nvtsy0" path="res://stages/terrain/region/assets/textures/garden_decontamined_background_texture_old.png" id="2_r7pv0"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_6hswu"]
frequency = 0.0109

View File

@@ -1,7 +1,7 @@
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://dpxu8yeee4qi1"]
[ext_resource type="Shader" uid="uid://q5isn3rwrir8" path="res://common/vfx/materials/shaders/texture_color_filter.gdshader" id="1_k4e5t"]
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/planet/assets/textures/garden_background_texture.png" id="2_k4e5t"]
[ext_resource type="Texture2D" uid="uid://bnrjnvceprxfn" path="res://stages/terrain/region/assets/textures/garden_background_texture.png" id="2_k4e5t"]
[resource]
shader = ExtResource("1_k4e5t")

View File

@@ -1,8 +1,8 @@
[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://d365ovfmi3d0s"]
[ext_resource type="Shader" uid="uid://q5isn3rwrir8" path="res://common/vfx/materials/shaders/texture_color_filter.gdshader" id="1_xr5ia"]
[ext_resource type="Texture2D" uid="uid://beqx4rmgthkql" path="res://stages/terrain/planet/assets/textures/rock_background_texture.png" id="2_ieaec"]
[ext_resource type="Texture2D" uid="uid://02nuoqleo4yu" path="res://stages/terrain/planet/assets/textures/rock_cristal_texture.png" id="2_sc014"]
[ext_resource type="Texture2D" uid="uid://beqx4rmgthkql" path="res://stages/terrain/region/assets/textures/rock_background_texture.png" id="2_ieaec"]
[ext_resource type="Texture2D" uid="uid://02nuoqleo4yu" path="res://stages/terrain/region/assets/textures/rock_cristal_texture.png" id="2_sc014"]
[resource]
shader = ExtResource("1_xr5ia")

View File

@@ -1,9 +1,9 @@
[gd_resource type="TileSet" load_steps=9 format=3 uid="uid://bqo32vh5etspf"]
[ext_resource type="Texture2D" uid="uid://ch4rydip0nlt6" path="res://stages/terrain/planet/assets/textures/moss_biome/moss_rock_atlas_texture.png" id="1_spfgy"]
[ext_resource type="Texture2D" uid="uid://dr72xhc07i56e" path="res://stages/terrain/planet/assets/textures/moss_biome/moss_contamination_atlas_texture.png" id="1_uqnql"]
[ext_resource type="Texture2D" uid="uid://yl4dg6gerykb" path="res://stages/terrain/planet/assets/textures/green_tiles.png" id="2_04qcq"]
[ext_resource type="Texture2D" uid="uid://bi08trir23od2" path="res://stages/terrain/planet/assets/textures/red_rect.png" id="4_spfgy"]
[ext_resource type="Texture2D" uid="uid://ch4rydip0nlt6" path="res://stages/terrain/region/assets/textures/moss_biome/moss_rock_atlas_texture.png" id="1_spfgy"]
[ext_resource type="Texture2D" uid="uid://dr72xhc07i56e" path="res://stages/terrain/region/assets/textures/moss_biome/moss_contamination_atlas_texture.png" id="1_uqnql"]
[ext_resource type="Texture2D" uid="uid://yl4dg6gerykb" path="res://stages/terrain/region/assets/textures/green_tiles.png" id="2_04qcq"]
[ext_resource type="Texture2D" uid="uid://bi08trir23od2" path="res://stages/terrain/region/assets/textures/red_rect.png" id="4_spfgy"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_4i8c6"]
resource_name = "Rock"

View File

@@ -4,8 +4,8 @@ class_name Chunk
signal generated
var planet : Planet
var planet_seed : int
var region : Region
var region_seed : int
var wall_threshold = 0.3
var decontamination_threshold = 0.
var cristal_threshold = 0.08
@@ -27,24 +27,24 @@ const ROCK_NOISE_FREQUENCY := 0.01
const DECONTAMINATION_NOISE_FREQUENCY := 0.01
@export_tool_button("Update", "Callable") var update_action = func():
planet_seed = randi()
region_seed = randi()
generate()
var data : ChunkData
func _init(
_data : ChunkData,
_planet : Planet = null,
_planet : Region = null,
):
planet = _planet
if planet:
planet_seed = planet.data.planet_seed
region = _planet
if region:
region_seed = region.data.region_seed
data = _data
func generate():
rock_noise_image = generate_noise(planet_seed + 1, ROCK_NOISE_FREQUENCY)
decontamination_noise_image = generate_noise(planet_seed + 2, DECONTAMINATION_NOISE_FREQUENCY)
global_position = data.chunk_coord * (Planet.CHUNK_TILE_SIZE * Planet.TILE_SIZE)
rock_noise_image = generate_noise(region_seed + 1, ROCK_NOISE_FREQUENCY)
decontamination_noise_image = generate_noise(region_seed + 2, DECONTAMINATION_NOISE_FREQUENCY)
global_position = data.chunk_coord * (Region.CHUNK_TILE_SIZE * Region.TILE_SIZE)
generate_rocks()
generate_ground()
generate_decontamination()
@@ -55,17 +55,17 @@ func finish_one_generation(generation_name : String):
is_generated = true
func unload():
for x in range(Planet.CHUNK_TILE_SIZE):
for y in range(Planet.CHUNK_TILE_SIZE):
var global_coord = Vector2i(x, y) + Planet.CHUNK_TILE_SIZE * data.chunk_coord
planet.rock_layer.erase_cell(global_coord)
planet.ground_layer.erase_cell(global_coord)
planet.decontamination_layer.erase_cell(global_coord)
for x in range(Region.CHUNK_TILE_SIZE):
for y in range(Region.CHUNK_TILE_SIZE):
var global_coord = Vector2i(x, y) + Region.CHUNK_TILE_SIZE * data.chunk_coord
region.rock_layer.erase_cell(global_coord)
region.ground_layer.erase_cell(global_coord)
region.decontamination_layer.erase_cell(global_coord)
# Debug
# func _draw():
# draw_rect(
# Rect2(Vector2.ZERO, Vector2.ONE * Planet.CHUNK_TILE_SIZE * Planet.TILE_SIZE),
# Rect2(Vector2.ZERO, Vector2.ONE * Region.CHUNK_TILE_SIZE * Region.TILE_SIZE),
# Color.WHITE,
# false,
# 3
@@ -78,7 +78,7 @@ func unload():
# y
# )
# draw_rect(
# Rect2(Vector2i(x,y) * Planet.CHUNK_SIZE / NOISE_IMAGE_SIZE, Vector2i.ONE * Planet.CHUNK_SIZE / NOISE_IMAGE_SIZE),
# Rect2(Vector2i(x,y) * Region.CHUNK_SIZE / NOISE_IMAGE_SIZE, Vector2i.ONE * Region.CHUNK_SIZE / NOISE_IMAGE_SIZE),
# Color.WHITE * ((noise_value+1)/2),
# true,
# )
@@ -104,25 +104,25 @@ func generate_noise(
func get_tile_value_from_noise(tile_position : Vector2i, noise : Noise) -> float:
var val = noise.get_noise_2d(
floori(float(tile_position.x * NOISE_IMAGE_SIZE) / Planet.CHUNK_TILE_SIZE),
floori(float(tile_position.y * NOISE_IMAGE_SIZE) / Planet.CHUNK_TILE_SIZE)
floori(float(tile_position.x * NOISE_IMAGE_SIZE) / Region.CHUNK_TILE_SIZE),
floori(float(tile_position.y * NOISE_IMAGE_SIZE) / Region.CHUNK_TILE_SIZE)
)
return (val + 1)/2
func generate_rocks():
var cristals : Array[Vector2i] = []
var rocks : Array[Vector2i] = []
for x in range(Planet.CHUNK_TILE_SIZE):
for y in range(Planet.CHUNK_TILE_SIZE):
for x in range(Region.CHUNK_TILE_SIZE):
for y in range(Region.CHUNK_TILE_SIZE):
var tile_type := get_generated_rock_type(Vector2i(x, y))
var global_coord = Vector2i(x, y) + Planet.CHUNK_TILE_SIZE * data.chunk_coord
var global_coord = Vector2i(x, y) + Region.CHUNK_TILE_SIZE * data.chunk_coord
if tile_type == RockLayer.TileType.CRISTAL:
cristals.append(global_coord)
elif tile_type == RockLayer.TileType.ROCK:
rocks.append(global_coord)
planet.rock_layer.place_rocks(cristals, RockLayer.TileType.CRISTAL, func(): finish_one_generation("rock"))
planet.rock_layer.place_rocks(rocks, RockLayer.TileType.ROCK, func(): finish_one_generation("cristal"))
region.rock_layer.place_rocks(cristals, RockLayer.TileType.CRISTAL, func(): finish_one_generation("rock"))
region.rock_layer.place_rocks(rocks, RockLayer.TileType.ROCK, func(): finish_one_generation("cristal"))
func get_generated_rock_type(coord : Vector2i) -> RockLayer.TileType:
var tile_value : float = get_tile_value_from_noise(coord, rock_noise_image)
@@ -137,16 +137,16 @@ func get_generated_rock_type(coord : Vector2i) -> RockLayer.TileType:
func generate_ground():
var coords : Array[Vector2i] = []
for x in range(Planet.CHUNK_TILE_SIZE):
for y in range(Planet.CHUNK_TILE_SIZE):
coords.append(Vector2i(x,y) + Planet.CHUNK_TILE_SIZE * data.chunk_coord)
for x in range(Region.CHUNK_TILE_SIZE):
for y in range(Region.CHUNK_TILE_SIZE):
coords.append(Vector2i(x,y) + Region.CHUNK_TILE_SIZE * data.chunk_coord)
planet.ground_layer.place_ground(coords, func(): finish_one_generation("ground"))
region.ground_layer.place_ground(coords, func(): finish_one_generation("ground"))
func generate_decontamination():
var decontamination_tiles : Array[Vector2i] = []
for x in range(Planet.CHUNK_TILE_SIZE):
for y in range(Planet.CHUNK_TILE_SIZE):
for x in range(Region.CHUNK_TILE_SIZE):
for y in range(Region.CHUNK_TILE_SIZE):
var coord = Vector2i(x,y)
var tile_value : float = get_tile_value_from_noise(coord, decontamination_noise_image)
var saved_diff := data.get_decontamination_tile_diff(coord)
@@ -154,9 +154,9 @@ func generate_decontamination():
(saved_diff == ChunkData.TileDiff.PRESENT or tile_value < decontamination_threshold)
and saved_diff != ChunkData.TileDiff.ABSENT
):
decontamination_tiles.append(Vector2i(x,y) + Planet.CHUNK_TILE_SIZE * data.chunk_coord)
decontamination_tiles.append(Vector2i(x,y) + Region.CHUNK_TILE_SIZE * data.chunk_coord)
planet.decontamination_layer.place_decontaminations(
region.decontamination_layer.place_decontaminations(
decontamination_tiles,
false,
func():

View File

@@ -1,13 +1,11 @@
extends Terrain
class_name Planet
signal pass_day_started(planet : Planet)
signal pass_day_proceeded(planet : Planet)
signal pass_day_ended(planet : Planet)
class_name Region
const MIN_PASS_DAY_ANIMATION_TIME : float = PassDay.TIME_MARGIN * 2
const TILE_SET : TileSet = preload("res://stages/terrain/planet/resources/moss_biome.tres")
const TUTORIAL_SCENE : PackedScene = preload("res://gui/game/tutorial/tutorial.tscn")
const TILE_SET : TileSet = preload("res://stages/terrain/region/resources/moss_biome.tres")
const TILE_SCALE = 1
const TILE_SIZE : int = roundi(TILE_SET.tile_size.x * TILE_SCALE)
const START_ROCK_HOLE_RADIUS = 5
@@ -23,21 +21,22 @@ const CHUNK_UNLOAD_DISTANCE : int = 2
var is_generated : bool : get = check_is_generated
var generated_value : float : get = get_generated_value
var data : PlanetData
var data : RegionData
var in_passing_day_animation = false
var contamination_texture : ImageTexture
var rock_layer : RockLayer
var ground_layer : GroundLayer
var decontamination_layer : DecontaminationLayer
var garden : Garden = null
var tile_set = Planet.TILE_SET
var tile_set = Region.TILE_SET
var generated_chunks : Dictionary[String,Chunk] = {}
var generation_semaphore: Semaphore
func _init():
data = GameInfo.game_data.current_planet_data
data = GameInfo.game_data.current_region_data
func _ready():
generation_semaphore = Semaphore.new()
@@ -46,18 +45,12 @@ func _ready():
entity_container.position = TILE_SIZE * CHUNK_TILE_SIZE * Vector2.ONE / 2
load_entities(data.entities_saved_data)
var plants : Array[Plant] = []
for e in entity_container.get_children():
if e is Plant:
plants.append(e)
garden = Garden.new(data, plants)
add_child(garden)
data.add_plant_data(e.data)
generate_first_entities()
AudioManager.enter_planet()
ground_layer = GroundLayer.new(self)
add_child(ground_layer)
rock_layer = RockLayer.new(self)
@@ -74,21 +67,6 @@ func _process(_d):
generate_near_chunks(player)
remove_far_chunks(player)
# queue_redraw()
# func _draw():
# var factor = 20
# for x in range(terrain_size.x / factor):
# for y in range(terrain_size.y / factor):
# var point = Vector2(x, y) * factor
# draw_circle(
# point,
# factor/10,
# Color.BLUE if garden.is_there_contamination(point) else Color.RED,
# true
# )
#region ------------------ Generation ------------------
func generate_first_entities():
@@ -182,37 +160,37 @@ func save():
#region ------------------ Usage ------------------
func plant(
type : PlantType,
plant_position : Vector2,
plant_mutations : Array[PlantMutation] = []
plant_seed : Seed,
plant_position : Vector2i
) -> bool:
var new_plant = garden.plant(type, plant_mutations)
var new_plant_data = PlantData.generate_from_seed(plant_seed, plant_position)
data.add_plant_data(new_plant_data)
var new_plant = Plant.new(new_plant_data)
add_entity(new_plant, plant_position)
return true
func pass_day():
data.start_pass_day()
%PassDay.pass_day_animation()
for e : Node2D in entity_container.get_children():
if e.has_method("_start_pass_day"):
e._start_pass_day()
pass_day_started.emit(self)
if not %PassDay.is_animation_appeared:
await %PassDay.animation_appeared
pass_day_proceeded.emit(self)
data.day += 1
for e : Node2D in entity_container.get_children():
if e.has_method("_pass_day"):
e._pass_day()
pass_day_ended.emit(self)
data.proceed_pass_day()
if not %PassDay.is_animation_disappeared:
await %PassDay.animation_disappeared
for e : Node2D in entity_container.get_children():
if e.has_method("_end_pass_day"):
e._end_pass_day()
garden.update_garden_score()
data.end_pass_day()
save()
#endregion

View File

@@ -0,0 +1,128 @@
extends Resource
class_name RegionData
enum State {IN_PROGRESS,FAILED,SUCCEEDED}
signal plant_changing_score(p : PlantData, amount : int)
signal updated(region_data : RegionData)
signal pass_day_started(region_data : RegionData)
signal pass_day_proceeded(region_data : RegionData)
signal pass_day_ended(region_data : RegionData)
const DEFAULT_START_CHARGE := 10
const DEFAULT_OBJECTIVE := 10
@export var region_seed : int
@export var region_name : String
@export var day : int = 1
@export var entities_saved_data : Array[EntityData] = []
@export var score_by_plant : Dictionary[PlantData, int] = {}
@export var generated_chunk_entities : Array[Vector2i]
@export var tutorial_step : int = 0
@export var tutorial = false
@export var chunks_data : Dictionary[String, ChunkData]
@export var charges : int :
set(v):
charges = v
updated.emit(self)
@export var objective : int :
set(v):
objective = v
updated.emit(self)
var in_passing_day_animation := false
func _init(
parameter : RegionParameter = RegionParameter.new()
):
charges = parameter.charges
objective = parameter.objective
region_name = parameter.name
region_seed = parameter.region_seed
tutorial = parameter.tutorial
#region ------------------ Chunks ------------------
func get_coord_id(coord):
return "%d:%d" % [coord.x, coord.y]
func has_chunk_data(coord : Vector2i) -> bool:
return chunks_data.has(get_coord_id(coord))
func add_chunk_data(coord : Vector2i, data : ChunkData):
chunks_data[get_coord_id(coord)] = data
func get_chunk_data(coord : Vector2i) -> ChunkData:
return chunks_data[get_coord_id(coord)]
func get_or_create_chunk_data(coord : Vector2i) -> ChunkData:
if has_chunk_data(coord):
return get_chunk_data(coord)
else:
var new_chunk_data = ChunkData.new(coord)
add_chunk_data(coord, new_chunk_data)
return new_chunk_data
#endregion
#region ------------------ Score ------------------
func get_score():
var score = 0
for plant_data in score_by_plant:
score += score_by_plant[plant_data]
return score
func is_objective_reached():
return get_score() >= objective
func get_state() -> State:
if get_score() >= objective:
return State.SUCCEEDED
elif charges <= 0:
return State.FAILED
else:
return State.IN_PROGRESS
#endregion
#region ------------------ Day ------------------
func start_pass_day():
in_passing_day_animation = true
pass_day_started.emit(self)
func proceed_pass_day():
pass_day_proceeded.emit(self)
func end_pass_day():
pass_day_ended.emit(self)
in_passing_day_animation = false
#endregion
#region ------------------ Plants ------------------
func add_plant_data(plant_data : PlantData):
score_by_plant[plant_data] = plant_data.get_score()
plant_data.disappeared.connect(_on_plant_disappeared)
plant_data.updated.connect(_on_plant_updated)
func _on_plant_updated(plant_data : PlantData):
var old_plant_score = score_by_plant[plant_data]
score_by_plant[plant_data] = plant_data.get_score()
if old_plant_score != score_by_plant[plant_data]:
plant_changing_score.emit(plant_data, score_by_plant[plant_data] - old_plant_score)
updated.emit(self)
func _on_plant_disappeared(plant_data : PlantData):
plant_changing_score.emit(plant_data, - score_by_plant[plant_data])
score_by_plant.erase(plant_data)
updated.emit(self)
#endregion

View File

@@ -0,0 +1,21 @@
extends Resource
class_name RegionParameter
@export var charges : int
@export var objective : int
@export var name : String
@export var tutorial : bool
@export var region_seed : int
func _init(
_charges : int = 10,
_objective : int = 10,
_name = Random.generate_random_name(),
_tutorial = false,
_region_seed = randi(),
):
charges = _charges
objective = _objective
name = _name
tutorial = _tutorial
region_seed = _region_seed

View File

@@ -1,5 +1,5 @@
@tool
extends PlanetLayer
extends RegionLayer
class_name DecontaminationLayer
const DECONTAMINATION_TILE_TERRAIN_SET : int = 0
@@ -21,10 +21,10 @@ func place_decontaminations(coords : Array[Vector2i], save := false, on_finished
if save:
for coord in coords:
var chunk_coord = Vector2i(
floori(coord.x / float(Planet.CHUNK_TILE_SIZE)),
floori(coord.y / float(Planet.CHUNK_TILE_SIZE)),
floori(coord.x / float(Region.CHUNK_TILE_SIZE)),
floori(coord.y / float(Region.CHUNK_TILE_SIZE)),
)
(planet.data
(region.data
.get_chunk_data(chunk_coord)
.update_decontamination_tile_diff(coord, ChunkData.TileDiff.PRESENT))

View File

@@ -1,8 +1,8 @@
@tool
extends PlanetLayer
extends RegionLayer
class_name GroundLayer
const MATERIAL : Material = preload("res://stages/terrain/planet/resources/materials/moss_biome/ground_planet_tilemap.tres")
const MATERIAL : Material = preload("res://stages/terrain/region/resources/materials/moss_biome/ground_planet_tilemap.tres")
const GROUND_TILE_TERRAIN_SET : int = 0
const GROUND_TILE_TERRAIN : int = 3

View File

@@ -1,19 +1,19 @@
@abstract
extends TileMapLayer
class_name PlanetLayer
class_name RegionLayer
var threads : Array[Thread] = []
var is_generated = false
var planet : Planet
var region : Region
func _init(
_planet : Planet = null
_planet : Region = null
):
planet = _planet
region = _planet
func _ready():
tile_set = planet.tile_set
scale = Vector2.ONE * Planet.TILE_SCALE
tile_set = region.tile_set
scale = Vector2.ONE * Region.TILE_SCALE
navigation_enabled = false
setup()
@@ -58,13 +58,13 @@ func place_terrain_cells(
tile_terrain_set : int = 0,
tile_terrain : int = 0
):
planet.generation_semaphore.wait()
region.generation_semaphore.wait()
set_cells_terrain_connect(
coords,
tile_terrain_set,
tile_terrain
)
planet.generation_semaphore.post()
region.generation_semaphore.post()
func _exit_tree():
for t in threads:

Some files were not shown because too many files have changed in this diff Show More