Compare commits
10 Commits
36cde498e0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| bbf9faa043 | |||
|
|
f6cc2d611e | ||
|
|
adbec01a63 | ||
| 24e531faca | |||
|
|
64310b848b | ||
|
|
af5ff6f284 | ||
|
|
f7d3476a56 | ||
|
|
e1b09df8f4 | ||
|
|
78d8ab4b10 | ||
|
|
abe877c5da |
9
Assets/Materials/GoldGlow.tres
Normal file
9
Assets/Materials/GoldGlow.tres
Normal file
@@ -0,0 +1,9 @@
|
||||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://c1evlkhnj37ky"]
|
||||
|
||||
[resource]
|
||||
transparency = 1
|
||||
blend_mode = 1
|
||||
albedo_color = Color(0.59, 0.463445, 0.00589999, 1)
|
||||
emission_enabled = true
|
||||
emission = Color(0.774314, 0.602011, 0.0986466, 1)
|
||||
emission_energy_multiplier = 5.0
|
||||
BIN
Assets/Models/BowCursor.blend
Normal file
BIN
Assets/Models/BowCursor.blend
Normal file
Binary file not shown.
64
Assets/Models/BowCursor.blend.import
Normal file
64
Assets/Models/BowCursor.blend.import
Normal file
@@ -0,0 +1,64 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://cbvijkdp1lqqw"
|
||||
path="res://.godot/imported/BowCursor.blend-a70c23414219af23efa6df09ac2509cc.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Models/BowCursor.blend"
|
||||
dest_files=["res://.godot/imported/BowCursor.blend-a70c23414219af23efa6df09ac2509cc.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"Bow": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/path": "uid://c1evlkhnj37ky"
|
||||
},
|
||||
"arrow": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/path": "uid://c1evlkhnj37ky"
|
||||
}
|
||||
}
|
||||
}
|
||||
blender/nodes/visible=0
|
||||
blender/nodes/active_collection_only=false
|
||||
blender/nodes/punctual_lights=true
|
||||
blender/nodes/cameras=true
|
||||
blender/nodes/custom_properties=true
|
||||
blender/nodes/modifiers=1
|
||||
blender/meshes/colors=false
|
||||
blender/meshes/uvs=true
|
||||
blender/meshes/normals=true
|
||||
blender/meshes/export_geometry_nodes_instances=false
|
||||
blender/meshes/tangents=true
|
||||
blender/meshes/skins=2
|
||||
blender/meshes/export_bones_deforming_mesh_only=false
|
||||
blender/materials/unpack_enabled=true
|
||||
blender/materials/export_materials=1
|
||||
blender/animation/limit_playback=true
|
||||
blender/animation/always_sample=true
|
||||
blender/animation/group_tracks=true
|
||||
BIN
Assets/Models/BowCursor.blend1
Normal file
BIN
Assets/Models/BowCursor.blend1
Normal file
Binary file not shown.
BIN
Assets/Models/PlatformGenerator.blend
Normal file
BIN
Assets/Models/PlatformGenerator.blend
Normal file
Binary file not shown.
53
Assets/Models/PlatformGenerator.blend.import
Normal file
53
Assets/Models/PlatformGenerator.blend.import
Normal file
@@ -0,0 +1,53 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://x3hgkrig0jim"
|
||||
path="res://.godot/imported/PlatformGenerator.blend-673b683482efcd8b1ad86a5def6fa344.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Models/PlatformGenerator.blend"
|
||||
dest_files=["res://.godot/imported/PlatformGenerator.blend-673b683482efcd8b1ad86a5def6fa344.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
blender/nodes/visible=0
|
||||
blender/nodes/active_collection_only=false
|
||||
blender/nodes/punctual_lights=true
|
||||
blender/nodes/cameras=true
|
||||
blender/nodes/custom_properties=true
|
||||
blender/nodes/modifiers=1
|
||||
blender/meshes/colors=false
|
||||
blender/meshes/uvs=true
|
||||
blender/meshes/normals=true
|
||||
blender/meshes/export_geometry_nodes_instances=false
|
||||
blender/meshes/tangents=true
|
||||
blender/meshes/skins=2
|
||||
blender/meshes/export_bones_deforming_mesh_only=false
|
||||
blender/materials/unpack_enabled=true
|
||||
blender/materials/export_materials=1
|
||||
blender/animation/limit_playback=true
|
||||
blender/animation/always_sample=true
|
||||
blender/animation/group_tracks=true
|
||||
BIN
Assets/Models/PlatformGenerator.blend1
Normal file
BIN
Assets/Models/PlatformGenerator.blend1
Normal file
Binary file not shown.
BIN
Assets/Models/SwordCursor.blend
Normal file
BIN
Assets/Models/SwordCursor.blend
Normal file
Binary file not shown.
60
Assets/Models/SwordCursor.blend.import
Normal file
60
Assets/Models/SwordCursor.blend.import
Normal file
@@ -0,0 +1,60 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://b4c4cu400yrgt"
|
||||
path="res://.godot/imported/SwordCursor.blend-f9c7473568c1bc60c7978b764065f405.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Models/SwordCursor.blend"
|
||||
dest_files=["res://.godot/imported/SwordCursor.blend-f9c7473568c1bc60c7978b764065f405.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
"Sword": {
|
||||
"use_external/enabled": true,
|
||||
"use_external/path": "uid://c1evlkhnj37ky"
|
||||
}
|
||||
}
|
||||
}
|
||||
blender/nodes/visible=0
|
||||
blender/nodes/active_collection_only=false
|
||||
blender/nodes/punctual_lights=true
|
||||
blender/nodes/cameras=true
|
||||
blender/nodes/custom_properties=true
|
||||
blender/nodes/modifiers=1
|
||||
blender/meshes/colors=false
|
||||
blender/meshes/uvs=true
|
||||
blender/meshes/normals=true
|
||||
blender/meshes/export_geometry_nodes_instances=false
|
||||
blender/meshes/tangents=true
|
||||
blender/meshes/skins=2
|
||||
blender/meshes/export_bones_deforming_mesh_only=false
|
||||
blender/materials/unpack_enabled=true
|
||||
blender/materials/export_materials=1
|
||||
blender/animation/limit_playback=true
|
||||
blender/animation/always_sample=true
|
||||
blender/animation/group_tracks=true
|
||||
BIN
Assets/Models/SwordCursor.blend1
Normal file
BIN
Assets/Models/SwordCursor.blend1
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
FX_CloudAlpha01.jpg
Normal file
BIN
FX_CloudAlpha01.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 486 KiB |
35
FX_CloudAlpha01.jpg.import
Normal file
35
FX_CloudAlpha01.jpg.import
Normal file
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cmihquuk54hfs"
|
||||
path.s3tc="res://.godot/imported/FX_CloudAlpha01.jpg-6e424269c7228922324e3e6b2eeab06c.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://FX_CloudAlpha01.jpg"
|
||||
dest_files=["res://.godot/imported/FX_CloudAlpha01.jpg-6e424269c7228922324e3e6b2eeab06c.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
BIN
FX_CloudAlpha02.png
Normal file
BIN
FX_CloudAlpha02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
35
FX_CloudAlpha02.png.import
Normal file
35
FX_CloudAlpha02.png.import
Normal file
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://daeuuulok4yfk"
|
||||
path.s3tc="res://.godot/imported/FX_CloudAlpha02.png-0967462c32312bef5563f3774394b2f1.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://FX_CloudAlpha02.png"
|
||||
dest_files=["res://.godot/imported/FX_CloudAlpha02.png-0967462c32312bef5563f3774394b2f1.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
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/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
|
||||
@@ -1,11 +1,10 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://hmyrn2pbbhpm"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://hmyrn2pbbhpm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bici4k5vkuoos" path="res://Scripts/player_camera.gd" id="1_ocbkm"]
|
||||
[ext_resource type="Script" uid="uid://bnqpqdped5uw2" path="res://Scripts/camera_Look.gd" id="2_8uhk6"]
|
||||
[ext_resource type="Theme" uid="uid://bey4nvrdo2vy" path="res://Prefabs/DefaultTheme.tres" id="3_8uhk6"]
|
||||
|
||||
[sub_resource type="CameraAttributesPractical" id="CameraAttributesPractical_ocbkm"]
|
||||
dof_blur_far_enabled = true
|
||||
dof_blur_far_distance = 15.0
|
||||
dof_blur_near_enabled = true
|
||||
dof_blur_near_distance = 6.0
|
||||
@@ -17,6 +16,9 @@ bg_color = Color(0.458824, 0, 0.145098, 1)
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8uhk6"]
|
||||
bg_color = Color(0.457868, 0.677542, 0.145981, 1)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_8uhk6"]
|
||||
size = Vector3(60, 1, 60)
|
||||
|
||||
[node name="CameraFollow" type="Node3D"]
|
||||
script = ExtResource("1_ocbkm")
|
||||
|
||||
@@ -32,34 +34,58 @@ anchors_preset = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="BoxContainer" type="BoxContainer" parent="Camera3D/Control"]
|
||||
layout_mode = 1
|
||||
offset_right = 3400.0
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="Camera3D/Control"]
|
||||
layout_mode = 2
|
||||
offset_right = 330.0
|
||||
offset_bottom = 1440.0
|
||||
size_flags_horizontal = 0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Camera3D/Control/BoxContainer"]
|
||||
custom_minimum_size = Vector2(236.82, 3.065)
|
||||
[node name="GOLD" type="Label" parent="Camera3D/Control/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 8
|
||||
size_flags_vertical = 0
|
||||
theme = ExtResource("3_8uhk6")
|
||||
text = "Gold: 35"
|
||||
|
||||
[node name="HealthBar" type="ProgressBar" parent="Camera3D/Control/BoxContainer/VBoxContainer"]
|
||||
[node name="Arrows" type="Label" parent="Camera3D/Control/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
theme = ExtResource("3_8uhk6")
|
||||
text = "Arrows"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Camera3D/Control"]
|
||||
custom_minimum_size = Vector2(236.82, 3.065)
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -120.0
|
||||
offset_right = 236.82
|
||||
grow_vertical = 0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 8
|
||||
alignment = 2
|
||||
|
||||
[node name="HealthBar" type="ProgressBar" parent="Camera3D/Control/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 10
|
||||
theme = ExtResource("3_8uhk6")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_6wc88")
|
||||
value = 42.34
|
||||
|
||||
[node name="StaminaBar" type="ProgressBar" parent="Camera3D/Control/BoxContainer/VBoxContainer"]
|
||||
[node name="StaminaBar" type="ProgressBar" parent="Camera3D/Control/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
theme = ExtResource("3_8uhk6")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_8uhk6")
|
||||
value = 42.34
|
||||
|
||||
[node name="GOLD" type="Label" parent="Camera3D/Control/BoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
theme = ExtResource("3_8uhk6")
|
||||
text = "Gold: 35"
|
||||
[node name="MouseTable" type="Area3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
|
||||
collision_layer = 128
|
||||
collision_mask = 128
|
||||
priority = 1
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="MouseTable"]
|
||||
shape = SubResource("BoxShape3D_8uhk6")
|
||||
|
||||
120
Prefabs/arrow.tscn
Normal file
120
Prefabs/arrow.tscn
Normal file
File diff suppressed because one or more lines are too long
12
Prefabs/cloud_spawner.tscn
Normal file
12
Prefabs/cloud_spawner.tscn
Normal file
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cu6f8karst8uk"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bot4t8im34ldh" path="res://Scripts/cloudSpawner.gd" id="1_t6aj5"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_t6aj5"]
|
||||
transparency = 1
|
||||
albedo_color = Color(1, 1, 1, 0)
|
||||
|
||||
[node name="CloudSpawner" type="CSGBox3D"]
|
||||
size = Vector3(57.1482, 23.8151, 69.293)
|
||||
material = SubResource("StandardMaterial3D_t6aj5")
|
||||
script = ExtResource("1_t6aj5")
|
||||
@@ -51,8 +51,8 @@ margin = 0.0
|
||||
radius = 0.0860376
|
||||
|
||||
[node name="GOLDCOIN" type="RigidBody3D"]
|
||||
collision_layer = 32
|
||||
collision_mask = 33
|
||||
collision_layer = 16
|
||||
collision_mask = 17
|
||||
mass = 0.1
|
||||
continuous_cd = true
|
||||
contact_monitor = true
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=15 format=3 uid="uid://bacgd5lmvaxea"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://bacgd5lmvaxea"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bcgt64gerg8pv" path="res://Scripts/player.gd" id="1_5wxv7"]
|
||||
[ext_resource type="Material" uid="uid://b4rpp31c0dx2m" path="res://Assets/Materials/BasicMat.tres" id="1_y6xdh"]
|
||||
@@ -6,11 +6,19 @@
|
||||
[ext_resource type="Script" uid="uid://c2xwiexy5b3b3" path="res://Scripts/player_attack.gd" id="3_knrd4"]
|
||||
[ext_resource type="Script" uid="uid://wnisqyoyai2h" path="res://Scripts/player_on_floor.gd" id="4_hck1p"]
|
||||
[ext_resource type="Script" uid="uid://dhnl0penaqfkx" path="res://Scripts/player_dodge_roll.gd" id="5_hck1p"]
|
||||
[ext_resource type="Script" uid="uid://255h63wdkwpv" path="res://Scripts/ranged_attack.gd" id="6_08u7w"]
|
||||
[ext_resource type="PackedScene" uid="uid://b12w4ut17srje" path="res://Assets/Models/Character1.blend" id="7_juxdh"]
|
||||
[ext_resource type="PackedScene" uid="uid://bxye0cuxw1mbr" path="res://Prefabs/arrow.tscn" id="7_kgmex"]
|
||||
[ext_resource type="PackedScene" uid="uid://b4c4cu400yrgt" path="res://Assets/Models/SwordCursor.blend" id="8_4qbli"]
|
||||
[ext_resource type="PackedScene" uid="uid://jkl8odkxg2s2" path="res://mousedebug.tscn" id="11_2xbkd"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_5wxv7"]
|
||||
size = Vector3(0.945, 0.13, 0.135)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_08u7w"]
|
||||
transparency = 1
|
||||
albedo_color = Color(1, 1, 1, 0)
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_y5hcb"]
|
||||
radius = 0.362
|
||||
|
||||
@@ -36,22 +44,6 @@ tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = PackedFloat32Array(0, 1, 0.652269, 0.475497, -0.696594)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_hck1p"]
|
||||
resource_name = "dodge"
|
||||
step = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Body:rotation")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(0, 0, 6.28319)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_4qbli"]
|
||||
resource_name = "attack"
|
||||
length = 0.5
|
||||
@@ -70,6 +62,23 @@ tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = PackedFloat32Array(0, 1, 0, -0.86255, 0, 0.505973, 0.166667, 1, 0, 0.949105, 0, -0.314961, 0.193146, 1, 0, 0.949105, 0, -0.314961, 0.3, 1, 0, -0.371061, 0, 0.928609, 0.433352, 1, 0, -0.86255, 0, 0.505973)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_hck1p"]
|
||||
resource_name = "dodge"
|
||||
length = 0.3
|
||||
step = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Body:rotation")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.3),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(0, 0, 6.28319)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_4qbli"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_juxdh"),
|
||||
@@ -80,8 +89,14 @@ _data = {
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_juxdh"]
|
||||
radius = 2.5
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_2xbkd"]
|
||||
size = Vector3(1, 3.50049, 1.52917)
|
||||
|
||||
[node name="Player" type="CharacterBody3D"]
|
||||
collision_layer = 20
|
||||
collision_mask = 5
|
||||
script = ExtResource("1_5wxv7")
|
||||
arrows = 100
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="."]
|
||||
transform = Transform3D(1, -1.74846e-07, 0, 1.74846e-07, 1, 0, 0, 0, 1, -2.406e-07, 1.87607, 0.0537765)
|
||||
@@ -97,11 +112,18 @@ script = ExtResource("3_knrd4")
|
||||
|
||||
[node name="On Floor" type="Node" parent="State Machine"]
|
||||
script = ExtResource("4_hck1p")
|
||||
move_speed = 7.0
|
||||
move_speed = 9.0
|
||||
|
||||
[node name="Dodge Roll" type="Node" parent="State Machine"]
|
||||
script = ExtResource("5_hck1p")
|
||||
|
||||
[node name="Ranged Attack" type="Node" parent="State Machine"]
|
||||
script = ExtResource("6_08u7w")
|
||||
fired_object = ExtResource("7_kgmex")
|
||||
object_speed = 40.0
|
||||
move_speed = 2.0
|
||||
move_transition_speed = 5.0
|
||||
|
||||
[node name="Body" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0.0537765)
|
||||
material_override = ExtResource("1_y6xdh")
|
||||
@@ -115,9 +137,13 @@ metadata/extras = {
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, -0.5, 0.0393383)
|
||||
|
||||
[node name="ShittySword" type="MeshInstance3D" parent="Body"]
|
||||
transform = Transform3D(-0.487984, 0, -0.872853, 0, 1, 0, 0.872853, 0, -0.487984, 0.652269, 0.475497, -0.696594)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.652269, 0.475497, -0.696594)
|
||||
mesh = SubResource("BoxMesh_5wxv7")
|
||||
skeleton = NodePath("../..")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_08u7w")
|
||||
|
||||
[node name="SwordCursor" parent="Body/ShittySword" instance=ExtResource("8_4qbli")]
|
||||
transform = Transform3D(0.644047, 0.760603, 0.0817732, -3.35396e-06, -0.106892, 0.994271, 0.764986, -0.640357, -0.068841, -0.0904393, 4.17233e-07, 0.438631)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
@@ -128,11 +154,24 @@ libraries = {
|
||||
&"": SubResource("AnimationLibrary_4qbli")
|
||||
}
|
||||
|
||||
[node name="Area3D" type="Area3D" parent="."]
|
||||
collision_layer = 32
|
||||
collision_mask = 32
|
||||
[node name="PickupMagnet" type="Area3D" parent="."]
|
||||
collision_layer = 16
|
||||
collision_mask = 16
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="PickupMagnet"]
|
||||
shape = SubResource("SphereShape3D_juxdh")
|
||||
|
||||
[connection signal="body_entered" from="Area3D" to="." method="_on_area_3d_body_entered"]
|
||||
[node name="MOUSE" parent="." node_paths=PackedStringArray("player") instance=ExtResource("11_2xbkd")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.21551, 0.500001, -0.339623)
|
||||
player = NodePath("..")
|
||||
|
||||
[node name="SwordHit" type="Area3D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="SwordHit"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.25024, -0.766663)
|
||||
shape = SubResource("BoxShape3D_2xbkd")
|
||||
|
||||
[connection signal="area_entered" from="PickupMagnet" to="." method="_on_area_3d_area_entered"]
|
||||
[connection signal="body_entered" from="PickupMagnet" to="." method="_on_area_3d_body_entered"]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
[gd_scene load_steps=22 format=4 uid="uid://dctwrgdviw2bq"]
|
||||
[gd_scene load_steps=24 format=4 uid="uid://dctwrgdviw2bq"]
|
||||
|
||||
[ext_resource type="Material" uid="uid://cautxfwhf4hrq" path="res://Assets/Materials/BROWN.tres" id="1_sfuv8"]
|
||||
[ext_resource type="Material" uid="uid://dv5fpke6frr4n" path="res://Assets/Materials/BLACK.tres" id="1_sq2hy"]
|
||||
[ext_resource type="Script" uid="uid://blcfh1bg820w7" path="res://Scripts/rat.gd" id="1_xmfkn"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_o45vq"]
|
||||
resource_name = "rat1"
|
||||
@@ -327,9 +328,15 @@ _data = {
|
||||
&"run": SubResource("Animation_rf35q")
|
||||
}
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_xmfkn"]
|
||||
size = Vector3(0.433838, 2.92389, 1)
|
||||
|
||||
[node name="rat" type="CharacterBody3D" groups=["breakable", "npc", "rat", "spawned"]]
|
||||
collision_layer = 64
|
||||
collision_mask = 45
|
||||
collision_layer = 8
|
||||
collision_mask = 9
|
||||
script = ExtResource("1_xmfkn")
|
||||
start_health = 3
|
||||
loot_dropped = 100
|
||||
|
||||
[node name="StateMachine" type="Node" parent="."]
|
||||
|
||||
@@ -396,4 +403,8 @@ target_position = Vector3(0, 0, -0.2)
|
||||
transform = Transform3D(0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, 0, -0.0699478, -0.342128)
|
||||
target_position = Vector3(0, 0, -0.2)
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.45218, 0)
|
||||
shape = SubResource("BoxShape3D_xmfkn")
|
||||
|
||||
[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_navigation_agent_3d_velocity_computed"]
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://dbqyyunvx6fdj"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://dbqyyunvx6fdj"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://hmyrn2pbbhpm" path="res://Prefabs/PlayerCamera.tscn" id="2_qq11w"]
|
||||
[ext_resource type="PackedScene" uid="uid://bacgd5lmvaxea" path="res://Prefabs/player.tscn" id="3_hfnh2"]
|
||||
[ext_resource type="PackedScene" uid="uid://deaibsufjpy1e" path="res://Prefabs/Decorations/chandelier.tscn" id="4_qq11w"]
|
||||
[ext_resource type="PackedScene" uid="uid://dqjh2pu32667h" path="res://Prefabs/Decorations/torch.tscn" id="5_l8yri"]
|
||||
[ext_resource type="PackedScene" uid="uid://drmam18yg3du5" path="res://Prefabs/goldcoin.tscn" id="6_nc5b6"]
|
||||
[ext_resource type="PackedScene" uid="uid://lhqrdftu1js3" path="res://Prefabs/Decorations/tombstone.tscn" id="7_uchfh"]
|
||||
[ext_resource type="PackedScene" uid="uid://d0u2u3cvfkdlj" path="res://Assets/Models/Test1.blend" id="8_46b76"]
|
||||
[ext_resource type="PackedScene" uid="uid://dctwrgdviw2bq" path="res://Prefabs/rat.tscn" id="8_igv2b"]
|
||||
[ext_resource type="PackedScene" uid="uid://1shngq3vrbu" path="res://coin_spawner.tscn" id="9_46b76"]
|
||||
[ext_resource type="PackedScene" uid="uid://cu6f8karst8uk" path="res://Prefabs/cloud_spawner.tscn" id="8_tadml"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_31lxn"]
|
||||
sky_top_color = Color(0.1, 0.1, 0.1, 1)
|
||||
@@ -32,13 +31,10 @@ fog_light_color = Color(0.117, 0.14115, 0.18, 1)
|
||||
fog_light_energy = 1.65
|
||||
fog_density = 1.0
|
||||
volumetric_fog_enabled = true
|
||||
volumetric_fog_length = 120.0
|
||||
volumetric_fog_length = 40.0
|
||||
adjustment_enabled = true
|
||||
adjustment_contrast = 1.5
|
||||
|
||||
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_qq11w"]
|
||||
data = PackedVector3Array(-1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1)
|
||||
|
||||
[node name="TestLevel" type="Node3D"]
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
@@ -50,12 +46,6 @@ shadow_bias = 0.0
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_vab8d")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="."]
|
||||
transform = Transform3D(5, 0, 0, 0, 50, 0, 0, 0, 5, 0, -50, 0)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
|
||||
shape = SubResource("ConcavePolygonShape3D_qq11w")
|
||||
|
||||
[node name="Test1" type="Node3D" parent="."]
|
||||
|
||||
[node name="Camera3D" parent="." node_paths=PackedStringArray("player") instance=ExtResource("2_qq11w")]
|
||||
@@ -101,42 +91,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.33433, 0, -4.47843)
|
||||
[node name="Torch4" parent="." instance=ExtResource("5_l8yri")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.9561, 0, -4.17663)
|
||||
|
||||
[node name="GOLDCOIN" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.7488, 0.999622, 2.02556)
|
||||
|
||||
[node name="GOLDCOIN2" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.94198, 0.999622, 1.68753)
|
||||
|
||||
[node name="GOLDCOIN3" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.61372, 0.999622, 1.5643)
|
||||
|
||||
[node name="GOLDCOIN4" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.76262, 0.999622, 1.10972)
|
||||
|
||||
[node name="GOLDCOIN5" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.13946, 0.999622, 1.32129)
|
||||
|
||||
[node name="GOLDCOIN6" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.02307, 1.44894, 0.736525)
|
||||
|
||||
[node name="GOLDCOIN7" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.135758, 3.0102, -28.9616)
|
||||
|
||||
[node name="GOLDCOIN8" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.328938, 3.0102, -29.2996)
|
||||
|
||||
[node name="GOLDCOIN9" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.000678062, 3.0102, -29.4228)
|
||||
|
||||
[node name="GOLDCOIN10" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.149578, 3.0102, -29.8774)
|
||||
|
||||
[node name="GOLDCOIN11" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.526418, 3.0102, -29.6658)
|
||||
|
||||
[node name="GOLDCOIN12" parent="." instance=ExtResource("6_nc5b6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.410028, 3.45952, -30.2506)
|
||||
|
||||
[node name="Tombstone" parent="." instance=ExtResource("7_uchfh")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.07396, -0.0927737, -29.9195)
|
||||
|
||||
@@ -163,5 +117,7 @@ transform = Transform3D(0.0790682, 0, 0.996869, 0, 1, 0, -0.996869, 0, 0.0790682
|
||||
|
||||
[node name="Test2" parent="." instance=ExtResource("8_46b76")]
|
||||
|
||||
[node name="CoinSpawner" parent="." instance=ExtResource("9_46b76")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.81324, 3.94453, 0.757049)
|
||||
[node name="CloudSpawner" parent="." instance=ExtResource("8_tadml")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -18.6754, -11.9108)
|
||||
size = Vector3(57.1482, 29.6659, 69.293)
|
||||
number_of_clouds = 10
|
||||
|
||||
43
Scripts/arrow.gd
Normal file
43
Scripts/arrow.gd
Normal file
@@ -0,0 +1,43 @@
|
||||
extends Projectile
|
||||
class_name Arrow
|
||||
|
||||
@onready var hit_ray: RayCast3D = $HitRay
|
||||
@onready var land_depth: Marker3D = $LandDepth
|
||||
@onready var arrow: MeshInstance3D = $Arrow
|
||||
@onready var pickup_collision: Area3D = $PickupCollision
|
||||
|
||||
var follow_target
|
||||
var spawn_out = false
|
||||
|
||||
const SPEED_DRAIN_RATE : float = 10.0
|
||||
|
||||
func _ready() -> void:
|
||||
pickup_collision.monitorable = false
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if !despawn:
|
||||
if hit_ray.is_colliding():
|
||||
despawn = true
|
||||
var body_hit = hit_ray.get_collider()
|
||||
if body_hit is EnemyCharacter:
|
||||
body_hit.hit(damage)
|
||||
reparent(body_hit)
|
||||
var stick_point = hit_ray.get_collision_point()
|
||||
if land_depth.global_position.distance_to(stick_point) > .2:
|
||||
arrow_move(delta)
|
||||
else:
|
||||
arrow_move(delta)
|
||||
else:
|
||||
pickup_collision.monitorable = true
|
||||
|
||||
pickup_follow(delta)
|
||||
|
||||
func arrow_move(delta):
|
||||
current_speed = clamp(current_speed - (delta * SPEED_DRAIN_RATE),.001,1000)
|
||||
var applied_gravity = -9.8 * ((start_speed - current_speed) / current_speed)
|
||||
global_position += global_transform.basis * Vector3(0,applied_gravity,-current_speed) * delta
|
||||
|
||||
func pickup_follow(delta):
|
||||
if follow_target != null:
|
||||
follow_target.arrows += 1
|
||||
queue_free()
|
||||
1
Scripts/arrow.gd.uid
Normal file
1
Scripts/arrow.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b0crflswpal5l
|
||||
@@ -16,7 +16,6 @@ func _process(delta: float) -> void:
|
||||
|
||||
func camera_fov():
|
||||
var distance_to_target = global_position.distance_to(target.global_position)
|
||||
attributes.dof_blur_far_distance = distance_to_target + 15.0
|
||||
attributes.dof_blur_near_distance = distance_to_target - 3
|
||||
|
||||
func camera_height_change(delta):
|
||||
|
||||
20
Scripts/cloudSpawner.gd
Normal file
20
Scripts/cloudSpawner.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
extends CSGSpawner
|
||||
|
||||
@export var number_of_clouds : int = 50
|
||||
const CLOUD_1 = preload("res://cloud1.tscn")
|
||||
|
||||
func _ready() -> void:
|
||||
spawn_clouds()
|
||||
|
||||
func spawn_clouds():
|
||||
while number_of_clouds >= 0:
|
||||
number_of_clouds -= 1
|
||||
|
||||
var spawn_pos = random_box_pos()
|
||||
var set_pos = self.global_position + spawn_pos
|
||||
var cloud = CLOUD_1.instantiate()
|
||||
cloud.visible = false
|
||||
add_child(cloud)
|
||||
cloud.global_position = set_pos
|
||||
await cloud.global_position == set_pos
|
||||
cloud.visible = true
|
||||
1
Scripts/cloudSpawner.gd.uid
Normal file
1
Scripts/cloudSpawner.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bot4t8im34ldh
|
||||
11
Scripts/csg_spawner.gd
Normal file
11
Scripts/csg_spawner.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends CSGBox3D
|
||||
class_name CSGSpawner
|
||||
|
||||
func _ready() -> void:
|
||||
visible = false
|
||||
|
||||
func random_box_pos():
|
||||
var x : float = randf_range(size.x / 2, -size.x /2)
|
||||
var y : float = randf_range(size.y/ 2, -size.y /2)
|
||||
var z : float = randf_range(size.z / 2, -size.z /2)
|
||||
return Vector3(x,y,z)
|
||||
1
Scripts/csg_spawner.gd.uid
Normal file
1
Scripts/csg_spawner.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c28po5p783mb2
|
||||
41
Scripts/enemy.gd
Normal file
41
Scripts/enemy.gd
Normal file
@@ -0,0 +1,41 @@
|
||||
extends CharacterBody3D
|
||||
class_name EnemyCharacter
|
||||
|
||||
@export var start_health : int = 10
|
||||
@export var loot_dropped : int = 3
|
||||
|
||||
const GOLDCOIN = preload("res://Prefabs/goldcoin.tscn")
|
||||
const MAX_AV = 15
|
||||
const MAX_LV = 2
|
||||
|
||||
|
||||
var health
|
||||
|
||||
func _ready() -> void:
|
||||
health = start_health
|
||||
|
||||
func hit(damage):
|
||||
health -= damage
|
||||
print("HEALTH : ",health)
|
||||
print("HIT")
|
||||
if health <= 0:
|
||||
die()
|
||||
|
||||
func die():
|
||||
drop_loot()
|
||||
queue_free()
|
||||
|
||||
func drop_loot():
|
||||
while loot_dropped > 0:
|
||||
var instance_coin = GOLDCOIN.instantiate()
|
||||
var av_x = randf_range(-MAX_AV,MAX_AV)
|
||||
var av_y = randf_range(-MAX_AV,MAX_AV)
|
||||
var av_z = randf_range(-MAX_AV,MAX_AV)
|
||||
var lv_x = randf_range(-MAX_LV,MAX_LV)
|
||||
var lv_y = randf_range(0,MAX_LV)
|
||||
var lv_z = randf_range(-MAX_LV,MAX_LV)
|
||||
get_tree().current_scene.add_child(instance_coin)
|
||||
instance_coin.global_position = global_position
|
||||
instance_coin.angular_velocity = Vector3(av_x,av_y,av_z)
|
||||
instance_coin.linear_velocity = Vector3(lv_x,lv_y,lv_z)
|
||||
loot_dropped -= 1
|
||||
1
Scripts/enemy.gd.uid
Normal file
1
Scripts/enemy.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cf6bja6cahxl5
|
||||
@@ -10,9 +10,6 @@ const SPAWN_OUT_HEIGHT = 14.0
|
||||
func _process(delta: float) -> void:
|
||||
if follow_target != null:
|
||||
if spawn_out:
|
||||
#if global_position.y < SPAWN_OUT_HEIGHT: REMOVED BECAUSE I DIDN'T LIKE THE LOOK, LEAVING FOR NOW IN CASE I WANT TO MAKE A DIFFERENT EFFECT HAPPEN
|
||||
#linear_velocity = Vector3(0,10,0)
|
||||
#else:
|
||||
follow_target.gold += amount
|
||||
queue_free()
|
||||
else:
|
||||
|
||||
28
Scripts/mouseDebug.gd
Normal file
28
Scripts/mouseDebug.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends Node3D
|
||||
|
||||
@export var player : Player
|
||||
|
||||
@onready var sword_cursor: Node3D = $SwordCursor
|
||||
@onready var bow_cursor: Node3D = $BowCursor
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
follow_mouse()
|
||||
swap_models()
|
||||
point_from_player()
|
||||
|
||||
func follow_mouse():
|
||||
var mouse_pos = MousePos.get_mouse_world_position(00001000)
|
||||
if mouse_pos != null:
|
||||
global_position = Vector3(mouse_pos.x,.1,mouse_pos.z)
|
||||
|
||||
func swap_models():
|
||||
if Input.is_action_pressed("ranged_attack"):
|
||||
sword_cursor.visible = false
|
||||
bow_cursor.visible = true
|
||||
else:
|
||||
sword_cursor.visible = true
|
||||
bow_cursor.visible = false
|
||||
|
||||
func point_from_player():
|
||||
var player_pos_xz_only = Vector3(player.global_position.x,global_position.y,player.global_position.z)
|
||||
look_at(player_pos_xz_only, Vector3.UP)
|
||||
1
Scripts/mouseDebug.gd.uid
Normal file
1
Scripts/mouseDebug.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cne68wmdyr4ld
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
extends Node3D
|
||||
|
||||
const RAY_LENGTH := 1000
|
||||
const RAY_LENGTH := 5000
|
||||
|
||||
"""
|
||||
Uses default collision_mask. But can be overrided for custom collision
|
||||
@@ -33,7 +33,7 @@ func _do_raycast_on_mouse_position(collision_mask: int = 0b00000000_00000000_000
|
||||
query.collide_with_areas = true
|
||||
query.collision_mask = collision_mask
|
||||
|
||||
var result = space_state.intersect_ray(query) # raycast result
|
||||
var result = space_state.intersect_ray(query) # raycast result
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ var dodge_direction
|
||||
|
||||
@onready var body: MeshInstance3D = $Body
|
||||
@onready var anim_player: AnimationPlayer = $AnimationPlayer
|
||||
@onready var sword_hit_area: Area3D = $SwordHit
|
||||
|
||||
var gold_to_vacuum = []
|
||||
var gold = 0
|
||||
@@ -12,6 +13,8 @@ var gold = 0
|
||||
const MAX_HEALTH : float = 100
|
||||
var health = MAX_HEALTH
|
||||
|
||||
@export var arrows = 10
|
||||
|
||||
const MAX_STAMINA : float = 100
|
||||
var stamina = MAX_STAMINA
|
||||
|
||||
@@ -20,6 +23,9 @@ const STAMINA_REGEN_RATE = 10.0
|
||||
const DODGE_STAMINA_COST = 30.0
|
||||
const ATTACK_STAMINA_COST = 10.0
|
||||
|
||||
func _ready() -> void:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
stamina_regen(delta)
|
||||
move_and_slide()
|
||||
@@ -31,3 +37,7 @@ func stamina_regen(delta):
|
||||
func _on_area_3d_body_entered(body: Node3D) -> void:
|
||||
if body is Gold:
|
||||
body.follow_target = self
|
||||
|
||||
func _on_area_3d_area_entered(area: Area3D) -> void:
|
||||
if area.get_parent() is Arrow:
|
||||
area.get_parent().follow_target = self
|
||||
|
||||
@@ -2,9 +2,10 @@ extends Node3D
|
||||
|
||||
@export var player : Player
|
||||
|
||||
@onready var gold_label: Label = $Camera3D/Control/BoxContainer/GOLD
|
||||
@onready var health_bar: ProgressBar = $Camera3D/Control/BoxContainer/VBoxContainer/HealthBar
|
||||
@onready var stamina_bar: ProgressBar = $Camera3D/Control/BoxContainer/VBoxContainer/StaminaBar
|
||||
@onready var gold_label: Label = $Camera3D/Control/VBoxContainer2/GOLD
|
||||
@onready var arrow_label: Label = $Camera3D/Control/VBoxContainer2/Arrows
|
||||
@onready var health_bar: ProgressBar = $Camera3D/Control/VBoxContainer/HealthBar
|
||||
@onready var stamina_bar: ProgressBar = $Camera3D/Control/VBoxContainer/StaminaBar
|
||||
|
||||
|
||||
const CAM_MOVE_SPEED = 5
|
||||
@@ -12,6 +13,7 @@ const CAM_MOVE_SPEED = 5
|
||||
func _physics_process(delta: float) -> void:
|
||||
follow_player(delta)
|
||||
gold_label.text = "Gold : " + str(player.gold)
|
||||
arrow_label.text = "Arrows : " + str(player.arrows)
|
||||
stamina_bar.value = player.stamina
|
||||
health_bar.value = player.health
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ var dodge_timer = DODGE_TIME
|
||||
|
||||
func Enter():
|
||||
character.anim_player.play("dodge")
|
||||
character.visible = false
|
||||
|
||||
func Physics_Update(delta):
|
||||
if dodge_timer > 0:
|
||||
@@ -19,3 +20,6 @@ func Physics_Update(delta):
|
||||
|
||||
character.velocity.x = character.dodge_direction.x * DODGE_SPEED
|
||||
character.velocity.z = character.dodge_direction.y * DODGE_SPEED
|
||||
|
||||
func Exit():
|
||||
character.visible = true
|
||||
|
||||
@@ -8,3 +8,7 @@ func Physics_Update(delta):
|
||||
apply_gravity(delta)
|
||||
respawn_on_fall(delta)
|
||||
attack()
|
||||
|
||||
if Input.is_action_just_pressed("ranged_attack"):
|
||||
if character.arrows > 0:
|
||||
Transitioned.emit(self,"ranged attack")
|
||||
|
||||
@@ -39,9 +39,9 @@ func apply_gravity(delta):
|
||||
character.velocity.y -= 9.8 * delta
|
||||
|
||||
func body_look_at_mouse():
|
||||
var mouse_raycast = MousePos.get_mouse_world_position()
|
||||
var mouse_raycast = MousePos.get_mouse_world_position(1000)
|
||||
if mouse_raycast != null:
|
||||
character.body.look_at(Vector3(mouse_raycast.x,character.body.global_position.y,mouse_raycast.y),Vector3.UP)
|
||||
character.body.look_at(Vector3(mouse_raycast.x,character.body.global_position.y,mouse_raycast.z),Vector3.UP)
|
||||
|
||||
func standard_movement(delta):
|
||||
if character.is_on_floor():
|
||||
|
||||
8
Scripts/projectile.gd
Normal file
8
Scripts/projectile.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
extends Node3D
|
||||
class_name Projectile
|
||||
|
||||
var damage = 1
|
||||
var power
|
||||
var start_speed
|
||||
var current_speed
|
||||
var despawn = false
|
||||
1
Scripts/projectile.gd.uid
Normal file
1
Scripts/projectile.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://de4r7j0yuar0s
|
||||
40
Scripts/ranged_attack.gd
Normal file
40
Scripts/ranged_attack.gd
Normal file
@@ -0,0 +1,40 @@
|
||||
extends PlayerState
|
||||
class_name PlayerRangedAttack
|
||||
|
||||
@export var fired_object : PackedScene
|
||||
@export var object_speed : float = 20.0
|
||||
@export var arrow_damage : float = 1
|
||||
|
||||
var charged_power = 0.0
|
||||
|
||||
const CHARGE_RATE = 25.0
|
||||
|
||||
func Enter():
|
||||
character.velocity = Vector3.ZERO
|
||||
|
||||
func Physics_Update(delta):
|
||||
body_look_at_mouse()
|
||||
standard_movement(delta)
|
||||
apply_gravity(delta)
|
||||
if Input.is_action_just_released("ranged_attack"):
|
||||
fire_projectile()
|
||||
Transitioned.emit(self,"on floor")
|
||||
|
||||
charge_shot(delta)
|
||||
|
||||
func charge_shot(delta):
|
||||
charged_power = clamp(charged_power + delta * CHARGE_RATE,0,100)
|
||||
|
||||
func fire_projectile():
|
||||
var arrow_spawn = fired_object.instantiate()
|
||||
get_tree().current_scene.add_child(arrow_spawn)
|
||||
character.arrows -= 1
|
||||
arrow_spawn.start_speed = object_speed
|
||||
arrow_spawn.current_speed = object_speed
|
||||
arrow_spawn.power = charged_power
|
||||
arrow_spawn.transform.basis = character.body.global_transform.basis
|
||||
arrow_spawn.global_position = character.body.global_position
|
||||
print("ARROW POS :", arrow_spawn.global_position)
|
||||
|
||||
func Exit():
|
||||
print("CHARGE POWER: ",charged_power)
|
||||
1
Scripts/ranged_attack.gd.uid
Normal file
1
Scripts/ranged_attack.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://255h63wdkwpv
|
||||
1
Scripts/rat.gd
Normal file
1
Scripts/rat.gd
Normal file
@@ -0,0 +1 @@
|
||||
extends EnemyCharacter
|
||||
1
Scripts/rat.gd.uid
Normal file
1
Scripts/rat.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://blcfh1bg820w7
|
||||
35
cloud1.tscn
Normal file
35
cloud1.tscn
Normal file
@@ -0,0 +1,35 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://b6d8oy7iuad4a"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://daeuuulok4yfk" path="res://FX_CloudAlpha02.png" id="1_g3s35"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_g3s35"]
|
||||
colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_017xs"]
|
||||
gradient = SubResource("Gradient_g3s35")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_017xs"]
|
||||
emission_shape = 3
|
||||
emission_box_extents = Vector3(5, 5, 5)
|
||||
angle_min = 1.07288e-05
|
||||
angle_max = 360.0
|
||||
gravity = Vector3(0, 0, 0)
|
||||
color_ramp = SubResource("GradientTexture1D_017xs")
|
||||
turbulence_noise_speed = Vector3(0.345, 0, 0)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7tvac"]
|
||||
transparency = 1
|
||||
shading_mode = 0
|
||||
albedo_texture = ExtResource("1_g3s35")
|
||||
billboard_mode = 1
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_0l02b"]
|
||||
material = SubResource("StandardMaterial3D_7tvac")
|
||||
size = Vector2(30, 30)
|
||||
|
||||
[node name="Node3D" type="GPUParticles3D"]
|
||||
amount = 20
|
||||
lifetime = 60.0
|
||||
explosiveness = 0.98
|
||||
process_material = SubResource("ParticleProcessMaterial_017xs")
|
||||
draw_pass_1 = SubResource("QuadMesh_0l02b")
|
||||
83
clouds.gdshader
Normal file
83
clouds.gdshader
Normal file
@@ -0,0 +1,83 @@
|
||||
shader_type spatial;
|
||||
render_mode unshaded;
|
||||
|
||||
uniform sampler3D cloud_noise_texture;
|
||||
uniform float cloud_scale : hint_range(0.001, 5.0) = 1.0;
|
||||
uniform float cloud_threshold : hint_range(0.0, 1.0) = 0.5;
|
||||
uniform float cloud_threshold_multiplier: hint_range(0.00, 10.00) = 0.05;
|
||||
uniform int max_steps : hint_range(1, 200) = 64;
|
||||
uniform float step_size : hint_range(0.01, 0.5) = 0.1;
|
||||
uniform float cloud_scroll_speed : hint_range(-1.0, 1.0) = 0.5;
|
||||
uniform vec3 minBounds = vec3(-1.0, -1.0, -1.0);
|
||||
uniform vec3 maxBounds = vec3(1.0, 1.0, 1.0);
|
||||
|
||||
uniform sampler3D detail_noise_texture;
|
||||
uniform float detail_intensity = 0.5;
|
||||
|
||||
float sample_detail_noise(vec3 position) {
|
||||
return texture(detail_noise_texture, position).r;
|
||||
}
|
||||
|
||||
float sample_cloud(vec3 position) {
|
||||
vec3 offsetPos = position + cloud_scroll_speed * TIME;
|
||||
float main_cloud = texture(cloud_noise_texture, offsetPos).r;
|
||||
float detail = sample_detail_noise(position * 10.0); // 10.0 is an arbitrary value for higher frequency
|
||||
return mix(main_cloud, detail, detail_intensity);
|
||||
}
|
||||
|
||||
float raymarch(vec3 ro_model, vec3 rd_model, vec2 intersections) {
|
||||
float total_density = 0.0;
|
||||
float t = intersections.x; // start from the entry point
|
||||
float max_t = intersections.y; // march up to the exit point
|
||||
|
||||
for (int i = 0; i < max_steps && t < max_t; i++) {
|
||||
vec3 pos_model = ro_model + t * rd_model;
|
||||
float density = sample_cloud(pos_model * cloud_scale);
|
||||
density = smoothstep(cloud_threshold - 0.05, cloud_threshold + cloud_threshold_multiplier, density);
|
||||
total_density += density * step_size;
|
||||
t += step_size;
|
||||
}
|
||||
return total_density;
|
||||
}
|
||||
|
||||
|
||||
// Return both entry and exit intersections with the mesh
|
||||
vec2 getRayIntersections(vec3 ro, vec3 rd) {
|
||||
vec3 t1 = (minBounds - ro) / rd;
|
||||
vec3 t2 = (maxBounds - ro) / rd;
|
||||
|
||||
vec3 tmin = min(t1, t2);
|
||||
vec3 tmax = max(t1, t2);
|
||||
|
||||
float t_near = max(max(tmin.x, tmin.y), tmin.z);
|
||||
float t_far = min(min(tmax.x, tmax.y), tmax.z);
|
||||
|
||||
if (t_near > t_far || t_far < 0.0) {
|
||||
return vec2(-1.0, -1.0); // No intersection
|
||||
}
|
||||
|
||||
return vec2(t_near, t_far);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec3 ro_world = INV_VIEW_MATRIX[3].xyz;
|
||||
vec4 clipPos = vec4((FRAGCOORD.xy / VIEWPORT_SIZE.xy) * 2.0 - 1.0, FRAGCOORD.z, 1.0);
|
||||
vec4 viewPos = INV_PROJECTION_MATRIX * clipPos;
|
||||
vec3 rd_world = normalize(viewPos.xyz / viewPos.w);
|
||||
rd_world = mat3(INV_VIEW_MATRIX) * rd_world;
|
||||
|
||||
vec2 intersections = getRayIntersections(ro_world, rd_world);
|
||||
|
||||
// Check if there's no intersection
|
||||
if (intersections.x == -1.0) {
|
||||
discard;
|
||||
}
|
||||
|
||||
vec3 ro_model = mat3(inverse(MODEL_MATRIX)) * (ro_world - MODEL_MATRIX[3].xyz);
|
||||
vec3 rd_model = mat3(inverse(MODEL_MATRIX)) * rd_world;
|
||||
|
||||
float cloud_intensity = raymarch(ro_model, rd_model, intersections);
|
||||
|
||||
ALBEDO = vec3(0.8, 0.8, 0.9) * cloud_intensity;
|
||||
ALPHA = cloud_intensity;
|
||||
}
|
||||
1
clouds.gdshader.uid
Normal file
1
clouds.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bb8xxifcect78
|
||||
15
mousedebug.tscn
Normal file
15
mousedebug.tscn
Normal file
@@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://jkl8odkxg2s2"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cne68wmdyr4ld" path="res://Scripts/mouseDebug.gd" id="1_ehadm"]
|
||||
[ext_resource type="PackedScene" uid="uid://b4c4cu400yrgt" path="res://Assets/Models/SwordCursor.blend" id="2_1bvqy"]
|
||||
[ext_resource type="PackedScene" uid="uid://cbvijkdp1lqqw" path="res://Assets/Models/BowCursor.blend" id="3_onpyn"]
|
||||
|
||||
[node name="MouseCursor" type="Node3D"]
|
||||
script = ExtResource("1_ehadm")
|
||||
|
||||
[node name="SwordCursor" parent="." instance=ExtResource("2_1bvqy")]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
|
||||
|
||||
[node name="BowCursor" parent="." instance=ExtResource("3_onpyn")]
|
||||
transform = Transform3D(-4.37114e-08, -1, 4.37114e-08, 0, -4.37114e-08, -1, 1, -4.37114e-08, 1.91069e-15, 0, 0, 0.525167)
|
||||
visible = false
|
||||
@@ -70,10 +70,18 @@ attack={
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
ranged_attack={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
3d_physics/layer_6="Objects"
|
||||
3d_physics/layer_3="Player"
|
||||
3d_physics/layer_4="Enemies"
|
||||
3d_physics/layer_5="Objects"
|
||||
3d_physics/layer_6="conflicts with MouseTable for some reason, leaving open for now"
|
||||
3d_physics/layer_8="MouseTable"
|
||||
|
||||
[rendering]
|
||||
|
||||
Reference in New Issue
Block a user