Author SHA1 Message Date
deifiedexile 2670392e2d Added animation tree to player model
Deploy Promiscuity Auth API / deploy (push) Successful in 45s
Deploy Promiscuity Character API / deploy (push) Successful in 43s
Deploy Promiscuity Locations API / deploy (push) Successful in 44s
k8s smoke test / test (push) Successful in 7s
2026-02-20 13:48:02 -06:00
null f4ff1308b8 Added hidden card game.
Deploy Promiscuity Auth API / deploy (push) Successful in 46s
Deploy Promiscuity Character API / deploy (push) Successful in 43s
Deploy Promiscuity Locations API / deploy (push) Successful in 46s
k8s smoke test / test (push) Successful in 7s
2026-02-13 12:30:24 -06:00
admin 6dc4d53ba0 Dialog bug fix/tweaks
Deploy Promiscuity Auth API / deploy (push) Successful in 47s
Deploy Promiscuity Character API / deploy (push) Successful in 43s
Deploy Promiscuity Locations API / deploy (push) Successful in 44s
k8s smoke test / test (push) Successful in 7s
2026-02-13 11:55:19 -06:00
admin ba6edd455a Merge pull request 'Adding simple dialog system' (#8) from dialog into main
Deploy Promiscuity Auth API / deploy (push) Successful in 49s
Deploy Promiscuity Character API / deploy (push) Successful in 1m33s
Deploy Promiscuity Locations API / deploy (push) Successful in 1m15s
k8s smoke test / test (push) Successful in 21s
Reviewed-on: #8
2026-02-13 11:44:13 -06:00
admin a66c39e9f8 Adding simple dialog system 2026-02-13 11:41:39 -06:00
admin 6f809c3684 Update README.md
Deploy Promiscuity Auth API / deploy (push) Successful in 45s
Deploy Promiscuity Character API / deploy (push) Successful in 42s
Deploy Promiscuity Locations API / deploy (push) Successful in 46s
k8s smoke test / test (push) Successful in 7s
2026-02-13 11:12:54 -06:00
pillboxstyx 2d27e4254e Merge pull request 'Starting to add a sprint, will figure out how to hook in the run animation next' (#7) from pillboxstyx/addingSprint into main
Deploy Promiscuity Auth API / deploy (push) Successful in 46s
Deploy Promiscuity Character API / deploy (push) Successful in 44s
Deploy Promiscuity Locations API / deploy (push) Successful in 45s
k8s smoke test / test (push) Successful in 7s
Reviewed-on: #7
2026-02-13 02:50:06 -06:00
pillboxstyx b3287ccf6f Starting to add a sprint, will figure out how to hook in the run animation next 2026-02-13 02:48:07 -06:00
20 changed files with 749 additions and 262 deletions
+1
View File
@@ -15,6 +15,7 @@
## Controls ## Controls
- Move: WASD - Move: WASD
- Jump: Space - Jump: Space
- Sprint: Shift
- Interact (enter/exit car): E - Interact (enter/exit car): E
- Flashlight: F - Flashlight: F
- Phone: Tab - Phone: Tab
Binary file not shown.

After

Width:  |  Height:  |  Size: 519 KiB

+40
View File
@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bstshxshmlfiq"
path="res://.godot/imported/card.webp-99b23fadea1c063dd14bdfc3719125c0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/images/card.webp"
dest_files=["res://.godot/imported/card.webp-99b23fadea1c063dd14bdfc3719125c0.ctex"]
[params]
compress/mode=0
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=false
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=1
+1
View File
@@ -26,6 +26,7 @@ MenuSfx="*res://scenes/UI/menu_sfx.tscn"
AuthState="*res://scenes/UI/auth_state.gd" AuthState="*res://scenes/UI/auth_state.gd"
CharacterService="*res://scenes/UI/character_service.gd" CharacterService="*res://scenes/UI/character_service.gd"
SelectedCharacter="*res://scenes/UI/selected_character.gd" SelectedCharacter="*res://scenes/UI/selected_character.gd"
DialogSystem="*res://scenes/UI/dialog_system.gd"
[dotnet] [dotnet]
+14
View File
@@ -0,0 +1,14 @@
extends Node2D
@export var card_name: String
@export var card_text: String
@export var card_cost: int
@onready var card_name_node := $CardName
@onready var card_text_node := $CardText
@onready var card_cost_node := $CardCost
func _ready():
card_name_node.text = card_name
card_text_node.text = card_text
card_cost_node.text = str(card_cost)
+1
View File
@@ -0,0 +1 @@
uid://chk06witxlje
+39
View File
@@ -0,0 +1,39 @@
[gd_scene load_steps=3 format=3 uid="uid://cqumma8ibtbsx"]
[ext_resource type="Script" uid="uid://chk06witxlje" path="res://scenes/CardGame/card.gd" id="1_qu2n3"]
[ext_resource type="Texture2D" uid="uid://bstshxshmlfiq" path="res://assets/images/card.webp" id="2_xgndj"]
[node name="Card" type="Node2D"]
script = ExtResource("1_qu2n3")
[node name="CardBackbround" type="Sprite2D" parent="."]
scale = Vector2(0.25, 0.25)
texture = ExtResource("2_xgndj")
[node name="CardName" type="Label" parent="."]
offset_left = -44.0
offset_top = 22.0
offset_right = 47.0
offset_bottom = 45.0
horizontal_alignment = 1
vertical_alignment = 1
[node name="CardText" type="RichTextLabel" parent="."]
offset_left = -75.0
offset_top = 64.0
offset_right = 75.0
offset_bottom = 115.0
text = "Test Text"
horizontal_alignment = 1
vertical_alignment = 1
[node name="CardCost" type="Label" parent="."]
offset_left = -80.0
offset_top = -125.0
offset_right = -45.0
offset_bottom = -89.0
text = "2"
horizontal_alignment = 1
vertical_alignment = 1
[node name="CardImage" type="Sprite2D" parent="."]
+12
View File
@@ -0,0 +1,12 @@
extends Node2D
var card_scene = preload("uid://cqumma8ibtbsx")
func _ready():
var card = card_scene.instantiate()
var size = get_viewport().get_visible_rect().size
card.card_text = "YOOOOOO"
card.card_name = "HAHAHAH"
card.card_cost = 2
card.position = Vector2(size.x / 2, size.y / 2)
add_child(card)
+1
View File
@@ -0,0 +1 @@
uid://btx5q72aali0g
+6
View File
@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://q4abhlwqdvay"]
[ext_resource type="Script" uid="uid://btx5q72aali0g" path="res://scenes/CardGame/cards.gd" id="1_l08q2"]
[node name="Node2D" type="Node2D"]
script = ExtResource("1_l08q2")
+15
View File
@@ -1,6 +1,7 @@
[gd_scene load_steps=14 format=3] [gd_scene load_steps=14 format=3]
[ext_resource type="Script" path="res://scenes/Characters/repo_bot.gd" id="1_repo_bot"] [ext_resource type="Script" path="res://scenes/Characters/repo_bot.gd" id="1_repo_bot"]
[ext_resource type="Script" path="res://scenes/Interaction/dialog_trigger_area.gd" id="2_dialog"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_body"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_body"]
albedo_color = Color(0.78, 0.8, 0.82, 1) albedo_color = Color(0.78, 0.8, 0.82, 1)
@@ -54,6 +55,9 @@ material = SubResource("StandardMaterial3D_accent")
radius = 0.3 radius = 0.3
height = 1.1 height = 1.1
[sub_resource type="SphereShape3D" id="SphereShape3D_interact"]
radius = 1.7
[node name="RepoBot" type="Node3D"] [node name="RepoBot" type="Node3D"]
script = ExtResource("1_repo_bot") script = ExtResource("1_repo_bot")
@@ -114,3 +118,14 @@ mesh = SubResource("CylinderMesh_limb")
[node name="Backpack" type="MeshInstance3D" parent="Body"] [node name="Backpack" type="MeshInstance3D" parent="Body"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0.22) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, 0.22)
mesh = SubResource("BoxMesh_pack") mesh = SubResource("BoxMesh_pack")
[node name="InteractArea" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
script = ExtResource("2_dialog")
collision_layer = 2
collision_mask = 1
prompt_text = "Press E to talk"
dialog_text = "Repo Bot: Welcome to Promiscuity.\n\nPress E again to close this dialog."
[node name="CollisionShape3D" type="CollisionShape3D" parent="InteractArea"]
shape = SubResource("SphereShape3D_interact")
@@ -0,0 +1,64 @@
extends Area3D
@export var target_group: StringName = &"player"
@export var prompt_text := "Press E to talk"
@export_multiline var dialog_text := ""
@export var auto_popup := false
@export_enum("Every Entry", "Once") var auto_popup_mode := 0
@export var auto_popup_close_on_exit := false
var _has_triggered := false
func _ready() -> void:
collision_layer = 2
collision_mask = 1
body_entered.connect(_on_body_entered)
body_exited.connect(_on_body_exited)
func _exit_tree() -> void:
if not auto_popup and DialogSystem:
DialogSystem.unregister_interactable(self)
func _on_body_entered(body: Node) -> void:
if not (target_group == StringName() or body.is_in_group(target_group)):
return
if auto_popup:
if DialogSystem and DialogSystem.has_method("is_dialog_open") and DialogSystem.is_dialog_open():
if not (DialogSystem.has_method("is_dialog_open_from") and DialogSystem.is_dialog_open_from(self)):
return
if auto_popup_mode == 1 and _has_triggered:
return
_has_triggered = true
if DialogSystem and auto_popup_close_on_exit and DialogSystem.has_method("show_text_from"):
DialogSystem.show_text_from(self, dialog_text)
return
if DialogSystem and DialogSystem.has_method("show_text"):
DialogSystem.show_text(dialog_text)
return
if DialogSystem:
DialogSystem.register_interactable(self)
func _on_body_exited(body: Node) -> void:
if not (target_group == StringName() or body.is_in_group(target_group)):
return
if auto_popup:
if auto_popup_close_on_exit and DialogSystem:
if DialogSystem.has_method("close_if_source"):
DialogSystem.close_if_source(self)
elif DialogSystem.has_method("close_if_text"):
DialogSystem.close_if_text(dialog_text)
return
return
if target_group == StringName() or body.is_in_group(target_group):
DialogSystem.unregister_interactable(self)
func get_dialog_prompt() -> String:
return prompt_text
func get_dialog_text() -> String:
return dialog_text
@@ -0,0 +1 @@
uid://bk53njt7i3kmv
+12
View File
@@ -2,12 +2,24 @@ extends Node3D
@export var day_length := 120.0 # seconds for full rotation @export var day_length := 120.0 # seconds for full rotation
@export var start_light_angle := -90.0 @export var start_light_angle := -90.0
@export var show_spawn_dialog := true
@export_multiline var spawn_dialog_text := "Welcome to Promiscuity.\n\nPress E to close this message."
@export var spawn_dialog_auto_close_seconds := 4.0
var end_light_angle = start_light_angle + 360.0 var end_light_angle = start_light_angle + 360.0
var start_radians = start_light_angle * PI / 180 var start_radians = start_light_angle * PI / 180
var time := 0.0 var time := 0.0
@onready var sun := $DirectionalLight3D @onready var sun := $DirectionalLight3D
func _ready() -> void:
if show_spawn_dialog and DialogSystem and DialogSystem.has_method("show_text"):
await get_tree().process_frame
DialogSystem.show_text(spawn_dialog_text)
if spawn_dialog_auto_close_seconds > 0.0:
await get_tree().create_timer(spawn_dialog_auto_close_seconds).timeout
if DialogSystem and DialogSystem.has_method("close_if_text"):
DialogSystem.close_if_text(spawn_dialog_text)
func _process(delta): func _process(delta):
time = fmod((time + delta), day_length) time = fmod((time + delta), day_length)
var t = time / day_length var t = time / day_length
+214 -128
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=18 format=3 uid="uid://dchj6g2i8ebph"] [gd_scene load_steps=61 format=3 uid="uid://dchj6g2i8ebph"]
[ext_resource type="Script" uid="uid://brgmxhhhtakja" path="res://scenes/Levels/level.gd" id="1_a4mo8"] [ext_resource type="Script" uid="uid://brgmxhhhtakja" path="res://scenes/Levels/level.gd" id="1_a4mo8"]
[ext_resource type="PackedScene" uid="uid://bb6hj6l23043x" path="res://assets/models/human.blend" id="1_eg4yq"] [ext_resource type="PackedScene" uid="uid://bb6hj6l23043x" path="res://assets/models/human.blend" id="1_eg4yq"]
@@ -6,8 +6,9 @@
[ext_resource type="PackedScene" uid="uid://c5of6aaxop1hl" path="res://scenes/block.tscn" id="2_tc7dm"] [ext_resource type="PackedScene" uid="uid://c5of6aaxop1hl" path="res://scenes/block.tscn" id="2_tc7dm"]
[ext_resource type="Script" uid="uid://b7fopt7sx74g8" path="res://scenes/Levels/menu.gd" id="3_tc7dm"] [ext_resource type="Script" uid="uid://b7fopt7sx74g8" path="res://scenes/Levels/menu.gd" id="3_tc7dm"]
[ext_resource type="PackedScene" path="res://scenes/Characters/repo_bot.tscn" id="4_repo"] [ext_resource type="PackedScene" path="res://scenes/Characters/repo_bot.tscn" id="4_repo"]
[ext_resource type="PackedScene" uid="uid://bnqaqbgynoyys" path="res://assets/models/TestCharAnimated.glb" id="5_fi66n"]
[ext_resource type="PackedScene" path="res://scenes/Vehicles/car.tscn" id="5_car"] [ext_resource type="PackedScene" path="res://scenes/Vehicles/car.tscn" id="5_car"]
[ext_resource type="PackedScene" uid="uid://bnqaqbgynoyys" path="res://assets/models/TestCharAnimated.glb" id="5_fi66n"]
[ext_resource type="Script" uid="uid://bk53njt7i3kmv" path="res://scenes/Interaction/dialog_trigger_area.gd" id="6_dialog"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_2q6dc"] [sub_resource type="PhysicsMaterial" id="PhysicsMaterial_2q6dc"]
bounce = 0.5 bounce = 0.5
@@ -21,21 +22,191 @@ bounce = 0.5
[sub_resource type="SphereShape3D" id="SphereShape3D_mx8sn"] [sub_resource type="SphereShape3D" id="SphereShape3D_mx8sn"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_he7fi"]
animation = &"Idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_42npc"]
animation = &"Idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_neck2"]
animation = &"Idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_bg4jh"]
animation = &"Idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_43ksg"]
animation = &"Jump"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_loupo"]
animation = &"Jump"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_1meta"]
animation = &"LStrafe"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_i35yb"]
animation = &"LStrafeWalk"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_18iqp"]
animation = &"LTurn"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_px5jg"]
animation = &"LTurn90"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_f2oql"]
animation = &"RStrafe"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8hdhy"]
animation = &"RStrafe"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8ydj0"]
animation = &"RStrafeWalk"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ol8dr"]
animation = &"RTurn"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_eorea"]
animation = &"RTurn90"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_mwo3k"]
animation = &"Run"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_j43p6"]
animation = &"Run"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7qd4n"]
animation = &"Walk"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_5wdrc"]
animation = &"Walk"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_k13o0"]
animation = &"Walk"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_pqisa"]
animation = &"Walk"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5qdlo"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hwpvo"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2jvac"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_m443h"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ccri0"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_aqwus"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_tknc3"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ygago"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_koxac"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_0pp6t"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_3xa5y"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8m234"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_jnqa2"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_vwq6c"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_e2sp2"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_r45s2"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_p7els"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_elh2a"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_bwsrl"]
states/End/position = Vector2(664, 130)
states/Idle/node = SubResource("AnimationNodeAnimation_bg4jh")
states/Idle/position = Vector2(318, 57)
"states/Idle 2/node" = SubResource("AnimationNodeAnimation_he7fi")
"states/Idle 2/position" = Vector2(397, 105)
"states/Idle 3/node" = SubResource("AnimationNodeAnimation_42npc")
"states/Idle 3/position" = Vector2(312, 279)
"states/Idle 4/node" = SubResource("AnimationNodeAnimation_neck2")
"states/Idle 4/position" = Vector2(437, 356)
states/Jump/node = SubResource("AnimationNodeAnimation_loupo")
states/Jump/position = Vector2(282, 356)
"states/Jump 2/node" = SubResource("AnimationNodeAnimation_43ksg")
"states/Jump 2/position" = Vector2(421, 287)
states/LStrafe/node = SubResource("AnimationNodeAnimation_1meta")
states/LStrafe/position = Vector2(1401, 100)
states/LStrafeWalk/node = SubResource("AnimationNodeAnimation_i35yb")
states/LStrafeWalk/position = Vector2(1346, 175)
states/LTurn/node = SubResource("AnimationNodeAnimation_18iqp")
states/LTurn/position = Vector2(1516, 83)
states/LTurn90/node = SubResource("AnimationNodeAnimation_px5jg")
states/LTurn90/position = Vector2(1550, 208)
states/RStrafe/node = SubResource("AnimationNodeAnimation_8hdhy")
states/RStrafe/position = Vector2(856, 161)
"states/RStrafe 2/node" = SubResource("AnimationNodeAnimation_f2oql")
"states/RStrafe 2/position" = Vector2(956, 208)
states/RStrafeWalk/node = SubResource("AnimationNodeAnimation_8ydj0")
states/RStrafeWalk/position = Vector2(1181, 155)
states/RTurn/node = SubResource("AnimationNodeAnimation_ol8dr")
states/RTurn/position = Vector2(1065, 162)
states/RTurn90/node = SubResource("AnimationNodeAnimation_eorea")
states/RTurn90/position = Vector2(1218, 92)
states/Run/node = SubResource("AnimationNodeAnimation_j43p6")
states/Run/position = Vector2(293, 225)
"states/Run 2/node" = SubResource("AnimationNodeAnimation_mwo3k")
"states/Run 2/position" = Vector2(421, 161)
states/Start/position = Vector2(156, 121)
states/Walk/node = SubResource("AnimationNodeAnimation_pqisa")
states/Walk/position = Vector2(414, 57)
"states/Walk 2/node" = SubResource("AnimationNodeAnimation_7qd4n")
"states/Walk 2/position" = Vector2(303, 111)
"states/Walk 3/node" = SubResource("AnimationNodeAnimation_5wdrc")
"states/Walk 3/position" = Vector2(312, 175)
"states/Walk 4/node" = SubResource("AnimationNodeAnimation_k13o0")
"states/Walk 4/position" = Vector2(421, 219)
transitions = ["Idle", "Walk", SubResource("AnimationNodeStateMachineTransition_5qdlo"), "Walk 2", "Idle 2", SubResource("AnimationNodeStateMachineTransition_hwpvo"), "Walk 3", "Run 2", SubResource("AnimationNodeStateMachineTransition_2jvac"), "Run", "Walk 4", SubResource("AnimationNodeStateMachineTransition_m443h"), "Start", "Idle", SubResource("AnimationNodeStateMachineTransition_ccri0"), "Start", "Walk 2", SubResource("AnimationNodeStateMachineTransition_aqwus"), "Start", "Walk 3", SubResource("AnimationNodeStateMachineTransition_tknc3"), "Start", "Run", SubResource("AnimationNodeStateMachineTransition_ygago"), "Idle 3", "Jump 2", SubResource("AnimationNodeStateMachineTransition_koxac"), "Jump", "Idle 4", SubResource("AnimationNodeStateMachineTransition_0pp6t"), "Start", "Jump", SubResource("AnimationNodeStateMachineTransition_3xa5y"), "Start", "Idle 3", SubResource("AnimationNodeStateMachineTransition_8m234"), "Walk", "End", SubResource("AnimationNodeStateMachineTransition_jnqa2"), "Idle 2", "End", SubResource("AnimationNodeStateMachineTransition_vwq6c"), "Run 2", "End", SubResource("AnimationNodeStateMachineTransition_e2sp2"), "Walk 4", "End", SubResource("AnimationNodeStateMachineTransition_r45s2"), "Jump 2", "End", SubResource("AnimationNodeStateMachineTransition_p7els"), "Idle 4", "End", SubResource("AnimationNodeStateMachineTransition_elh2a")]
[sub_resource type="SphereShape3D" id="SphereShape3D_dialog_zone"]
radius = 2.5
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dialog_zone"]
transparency = 1
cull_mode = 2
shading_mode = 0
albedo_color = Color(0.2, 0.8, 0.35, 0.18)
[sub_resource type="SphereMesh" id="SphereMesh_dialog_zone"]
material = SubResource("StandardMaterial3D_dialog_zone")
radius = 2.5
height = 5.0
[sub_resource type="BoxShape3D" id="BoxShape3D_2q6dc"] [sub_resource type="BoxShape3D" id="BoxShape3D_2q6dc"]
size = Vector3(1080, 2, 1080) size = Vector3(1080, 2, 1080)
[sub_resource type="BoxMesh" id="BoxMesh_w7c3h"] [sub_resource type="BoxMesh" id="BoxMesh_w7c3h"]
size = Vector3(1080, 2, 1080) size = Vector3(1080, 2, 1080)
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_fi66n"]
[sub_resource type="Sky" id="Sky_a4mo8"]
sky_material = SubResource("ProceduralSkyMaterial_fi66n")
[sub_resource type="Environment" id="Environment_a4mo8"] [sub_resource type="Environment" id="Environment_a4mo8"]
background_mode = 2
sky = SubResource("Sky_a4mo8")
ambient_light_source = 3
[node name="Node3D" type="Node3D"] [node name="Node3D" type="Node3D"]
script = ExtResource("1_a4mo8") script = ExtResource("1_a4mo8")
@@ -62,6 +233,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
mesh = SubResource("SphereMesh_w7c3h") mesh = SubResource("SphereMesh_w7c3h")
[node name="Player" type="RigidBody3D" parent="."] [node name="Player" type="RigidBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.6563287, 0, 0)
physics_material_override = SubResource("PhysicsMaterial_w8frs") physics_material_override = SubResource("PhysicsMaterial_w8frs")
script = ExtResource("1_muv8p") script = ExtResource("1_muv8p")
camera_path = NodePath("Camera3D") camera_path = NodePath("Camera3D")
@@ -70,124 +242,6 @@ phone_path = NodePath("../PhoneUI")
[node name="TestCharAnimated" parent="Player" instance=ExtResource("5_fi66n")] [node name="TestCharAnimated" parent="Player" instance=ExtResource("5_fi66n")]
transform = Transform3D(-0.9998549, 0, 0.01703362, 0, 1, 0, -0.01703362, 0, -0.9998549, 0, 0, 0) transform = Transform3D(-0.9998549, 0, 0.01703362, 0, 1, 0, -0.01703362, 0, -0.9998549, 0, 0, 0)
[node name="Skeleton3D" parent="Player/TestCharAnimated/Armature" index="0"]
bones/0/position = Vector3(0.0026170756, -0.0012418391, -0.98996276)
bones/0/rotation = Quaternion(-0.7278173, -0.05346041, 0.012412205, 0.6835714)
bones/1/position = Vector3(8.593209e-06, 0.09923458, -0.012273359)
bones/1/rotation = Quaternion(-0.031655744, 0.011362745, 0.022744056, 0.9991754)
bones/2/position = Vector3(-2.2989244e-10, 0.117319785, 2.9730852e-08)
bones/2/rotation = Quaternion(0.010291794, 0.001169461, 0.013815534, 0.9998509)
bones/3/position = Vector3(-2.3358266e-09, 0.13458829, -1.382244e-08)
bones/3/rotation = Quaternion(0.067557335, 0.0021622085, 0.013776206, 0.99761796)
bones/4/position = Vector3(2.508626e-07, 0.15027755, 0.008779066)
bones/4/rotation = Quaternion(0.051882792, -0.00090027065, 0.0039363643, 0.998645)
bones/5/position = Vector3(2.152588e-08, 0.103218146, 0.03142428)
bones/5/rotation = Quaternion(-0.06595954, 0.011917545, -0.0014885183, 0.99775004)
bones/6/position = Vector3(1.5477327e-06, 0.18474667, 0.06636399)
bones/7/position = Vector3(0.061058242, 0.09106279, 0.0075706206)
bones/7/rotation = Quaternion(-0.5982132, -0.43452233, 0.50765175, -0.4422909)
bones/8/position = Vector3(1.1842036e-08, 0.12922287, 5.2578955e-08)
bones/8/rotation = Quaternion(0.5434686, 0.18407291, 0.20301422, 0.7934383)
bones/9/position = Vector3(1.5054144e-07, 0.2740467, 2.2048344e-08)
bones/9/rotation = Quaternion(-5.192343e-09, -1.1239315e-06, 0.01273731, 0.99991894)
bones/10/position = Vector3(1.9432857e-08, 0.27614468, 9.6609995e-08)
bones/10/rotation = Quaternion(0.048323337, -0.28487536, 0.026756868, 0.9569718)
bones/11/position = Vector3(-0.030029751, 0.037888147, 0.021671427)
bones/11/rotation = Quaternion(0.2098604, -0.059559863, 0.20750383, 0.9536002)
bones/12/position = Vector3(-3.3527822e-08, 0.0474497, -1.48403245e-08)
bones/12/rotation = Quaternion(-0.14269812, 0.08661232, -0.24053419, 0.9561793)
bones/13/position = Vector3(-9.313215e-09, 0.043821093, 1.7813335e-08)
bones/13/rotation = Quaternion(-0.121022485, -0.07554186, 0.024044419, 0.98947906)
bones/14/position = Vector3(-4.847594e-08, 0.034590863, -5.3379924e-08)
bones/15/position = Vector3(-0.02822038, 0.12266627, 0.0023182186)
bones/15/rotation = Quaternion(0.06621808, 0.00073213095, 0.008435749, 0.99776924)
bones/16/position = Vector3(-8.136956e-09, 0.03891963, -1.4837047e-08)
bones/16/rotation = Quaternion(0.1509963, 7.805282e-07, -0.015479834, 0.98841316)
bones/17/position = Vector3(7.499967e-09, 0.034151517, -5.4443618e-08)
bones/17/rotation = Quaternion(0.070082076, 7.71772e-07, -0.007181638, 0.99751544)
bones/18/position = Vector3(2.700483e-09, 0.030779874, 4.9589467e-08)
bones/19/position = Vector3(-1.2452401e-07, 0.12775533, -8.01722e-08)
bones/19/rotation = Quaternion(0.13653132, -0.0038339633, -0.022952663, 0.9903624)
bones/20/position = Vector3(2.5990463e-09, 0.036139663, 1.713758e-10)
bones/20/rotation = Quaternion(0.15125485, 1.1823237e-06, -0.015500045, 0.9883733)
bones/21/position = Vector3(2.9034163e-07, 0.034597658, -3.6051716e-08)
bones/21/rotation = Quaternion(0.1599333, 1.4124467e-06, -0.016389191, 0.98699176)
bones/22/position = Vector3(-3.0519334e-07, 0.03680197, -9.1170705e-08)
bones/23/position = Vector3(0.022166358, 0.12147022, -9.993157e-05)
bones/23/rotation = Quaternion(0.18325116, -0.004651328, -0.031451236, 0.9825519)
bones/24/position = Vector3(4.5585904e-09, 0.036011815, -8.07135e-09)
bones/24/rotation = Quaternion(0.18138836, 1.5675009e-06, -0.018595627, 0.9832358)
bones/25/position = Vector3(-9.647604e-09, 0.033073086, -1.46341534e-08)
bones/25/rotation = Quaternion(0.1552087, 2.2643005e-06, -0.015905593, 0.9877537)
bones/26/position = Vector3(-2.434721e-07, 0.03660111, 2.471306e-07)
bones/27/position = Vector3(0.04725836, 0.109081924, 0.0022613404)
bones/27/rotation = Quaternion(0.23387046, -0.0035344863, -0.048872076, 0.97103226)
bones/28/position = Vector3(4.3135207e-09, 0.041366525, 3.569472e-08)
bones/28/rotation = Quaternion(0.15124865, 1.4340599e-05, -0.015863812, 0.98836845)
bones/29/position = Vector3(1.195453e-08, 0.02594832, 1.5542597e-08)
bones/29/rotation = Quaternion(0.14350323, 3.322942e-05, -0.014478063, 0.98954403)
bones/30/position = Vector3(-2.4944999e-08, 0.029238665, 6.2325825e-08)
bones/31/position = Vector3(-0.06105696, 0.09106397, 0.007570758)
bones/31/rotation = Quaternion(0.60009927, -0.4346891, 0.52418536, 0.4197095)
bones/32/position = Vector3(2.116817e-08, 0.12922288, 7.016769e-08)
bones/32/rotation = Quaternion(0.46432823, -0.26300937, -0.23269261, 0.813068)
bones/33/position = Vector3(-2.350565e-08, 0.27404687, 1.5161348e-08)
bones/33/rotation = Quaternion(7.667138e-08, -5.0620065e-06, -0.058376648, 0.99829465)
bones/34/position = Vector3(1.3629875e-07, 0.27614468, -9.158248e-09)
bones/34/rotation = Quaternion(0.059040155, 0.17509013, -0.005968382, 0.9827626)
bones/35/position = Vector3(0.030029776, 0.03788806, 0.021671649)
bones/35/rotation = Quaternion(0.21378386, 0.065372065, -0.22564878, 0.94821185)
bones/36/position = Vector3(-2.7939748e-09, 0.04744962, -1.7240383e-08)
bones/36/rotation = Quaternion(-0.14410053, -0.076146945, 0.2772088, 0.9468854)
bones/37/position = Vector3(5.58785e-09, 0.04382136, 3.566345e-08)
bones/37/rotation = Quaternion(-0.1552004, 0.07467698, -0.026057797, 0.9847117)
bones/38/position = Vector3(8.2187e-08, 0.034590647, -2.4929412e-07)
bones/39/position = Vector3(0.028220426, 0.1226661, 0.0023184721)
bones/39/rotation = Quaternion(0.059513006, -0.0009918809, -0.010980465, 0.99816674)
bones/40/position = Vector3(-1.1795999e-08, 0.038919587, -4.9162594e-09)
bones/40/rotation = Quaternion(0.15128906, 2.1640317e-06, 0.012328284, 0.98841274)
bones/41/position = Vector3(-1.4053852e-07, 0.034151636, -1.1118345e-08)
bones/41/rotation = Quaternion(0.07021882, 5.966413e-07, 0.0057199914, 0.9975152)
bones/42/position = Vector3(-7.1266735e-09, 0.030779934, 3.7720538e-10)
bones/43/position = Vector3(1.69263e-07, 0.12775521, 2.5128352e-07)
bones/43/rotation = Quaternion(0.13051407, 0.003691554, 0.018921439, 0.99125904)
bones/44/position = Vector3(4.8907918e-09, 0.036139727, -8.499214e-09)
bones/44/rotation = Quaternion(0.15154669, 1.6962191e-06, 0.012345144, 0.988373)
bones/45/position = Vector3(-2.8403383e-07, 0.03459763, -4.4995545e-09)
bones/45/rotation = Quaternion(0.16023898, 1.233635e-06, 0.013053549, 0.98699194)
bones/46/position = Vector3(2.8485744e-07, 0.03680191, -9.493007e-09)
bones/47/position = Vector3(-0.022166327, 0.12146996, -9.982591e-05)
bones/47/rotation = Quaternion(0.1774532, 0.0045050457, 0.02645378, 0.98376334)
bones/48/position = Vector3(4.6136024e-09, 0.036011953, 3.056637e-08)
bones/48/rotation = Quaternion(0.18173504, 1.8501213e-06, 0.014812392, 0.98323596)
bones/49/position = Vector3(-3.407626e-08, 0.033073153, 1.8664657e-08)
bones/49/rotation = Quaternion(0.15551038, 3.26233e-07, 0.012668259, 0.98775303)
bones/50/position = Vector3(2.3113911e-07, 0.03660121, -1.1142021e-08)
bones/51/position = Vector3(-0.047258336, 0.109081805, 0.0022614468)
bones/51/rotation = Quaternion(0.22849467, 0.003407588, 0.042977322, 0.97259015)
bones/52/position = Vector3(-1.5261804e-08, 0.041366428, -1.9607107e-09)
bones/52/rotation = Quaternion(0.1515478, 7.4422354e-07, 0.01235583, 0.98837274)
bones/53/position = Vector3(1.4340932e-08, 0.025948457, 3.3946527e-08)
bones/53/rotation = Quaternion(0.14377311, 5.8452275e-07, 0.011701506, 0.98954153)
bones/54/position = Vector3(4.750415e-09, 0.029238641, -1.2388978e-09)
bones/55/position = Vector3(0.09123873, -0.06657194, -0.0005540352)
bones/55/rotation = Quaternion(0.13601132, 0.07838244, 0.9844897, -0.07834015)
bones/56/position = Vector3(-1.3288446e-09, 0.40599436, 1.0443015e-08)
bones/56/rotation = Quaternion(-0.13252214, -0.014519276, 0.03215593, 0.99055195)
bones/57/position = Vector3(5.707578e-09, 0.42099008, -1.5425995e-08)
bones/57/rotation = Quaternion(0.5344839, -0.021701135, -0.027458949, 0.8444537)
bones/58/position = Vector3(-6.5650525e-09, 0.15721555, -2.6694579e-08)
bones/58/rotation = Quaternion(0.2693438, -0.032380052, -0.014592491, 0.96238893)
bones/59/position = Vector3(2.4854705e-08, 0.09999996, -3.1755625e-09)
bones/60/position = Vector3(-0.091250315, -0.066556, -0.0005535231)
bones/60/rotation = Quaternion(-0.09026457, -0.016758345, 0.9954146, -0.026857648)
bones/61/position = Vector3(1.3129254e-08, 0.40599442, 3.8557886e-09)
bones/61/rotation = Quaternion(-0.07401098, 0.084030755, -0.024547135, 0.99340767)
bones/62/position = Vector3(-7.3885964e-10, 0.42099023, -5.226429e-09)
bones/62/rotation = Quaternion(0.56540585, 0.011310213, -0.008501466, 0.8246915)
bones/63/position = Vector3(7.93632e-09, 0.1572156, -2.6982683e-10)
bones/63/rotation = Quaternion(0.28907102, 0.031904068, 0.014082117, 0.9566723)
bones/64/position = Vector3(7.567915e-10, 0.099999994, -3.2595668e-09)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player"] [node name="CollisionShape3D" type="CollisionShape3D" parent="Player"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
shape = SubResource("SphereShape3D_mx8sn") shape = SubResource("SphereShape3D_mx8sn")
@@ -199,8 +253,40 @@ fov = 49.0
[node name="SpotLight3D" type="SpotLight3D" parent="Player"] [node name="SpotLight3D" type="SpotLight3D" parent="Player"]
[node name="AnimationTree" type="AnimationTree" parent="Player"]
root_node = NodePath("../TestCharAnimated")
tree_root = SubResource("AnimationNodeStateMachine_bwsrl")
anim_player = NodePath("../TestCharAnimated/AnimationPlayer")
[node name="Car" parent="." instance=ExtResource("5_car")] [node name="Car" parent="." instance=ExtResource("5_car")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, -3) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, -3)
[node name="DialogZone" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, -2.5)
script = ExtResource("6_dialog")
prompt_text = "Press E to inspect area"
dialog_text = "Dialog trigger area"
[node name="CollisionShape3D" type="CollisionShape3D" parent="DialogZone"]
shape = SubResource("SphereShape3D_dialog_zone")
[node name="Visual" type="MeshInstance3D" parent="DialogZone"]
mesh = SubResource("SphereMesh_dialog_zone")
[node name="AutoDialogZone" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4, 0, -6.5)
script = ExtResource("6_dialog")
dialog_text = "Auto dialog trigger"
auto_popup = true
auto_popup_close_on_exit = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="AutoDialogZone"]
shape = SubResource("SphereShape3D_dialog_zone")
[node name="Visual" type="MeshInstance3D" parent="AutoDialogZone"]
transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0)
mesh = SubResource("SphereMesh_dialog_zone")
[node name="Ground" type="StaticBody3D" parent="."] [node name="Ground" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
+170
View File
@@ -0,0 +1,170 @@
extends CanvasLayer
var _interactables: Array[Node] = []
var _active_interactable: Node = null
var _dialog_visible := false
var _dialog_source: Node = null
var _prompt_label: Label
var _dialog_panel: PanelContainer
var _dialog_label: RichTextLabel
func _ready() -> void:
layer = 50
process_mode = Node.PROCESS_MODE_ALWAYS
_setup_ui()
_set_dialog_visible(false)
_update_prompt_visibility()
func _process(_delta: float) -> void:
if Input.is_action_just_pressed("interact"):
if _dialog_visible:
_set_dialog_visible(false)
return
if _active_interactable != null:
_open_dialog_for(_active_interactable)
func register_interactable(interactable: Node) -> void:
if interactable == null:
return
if _interactables.has(interactable):
return
_interactables.append(interactable)
_refresh_active_interactable()
func unregister_interactable(interactable: Node) -> void:
if interactable == null:
return
_interactables.erase(interactable)
_refresh_active_interactable()
func _refresh_active_interactable() -> void:
while _interactables.size() > 0 and not is_instance_valid(_interactables[_interactables.size() - 1]):
_interactables.pop_back()
_active_interactable = _interactables[_interactables.size() - 1] if _interactables.size() > 0 else null
_update_prompt_visibility()
func _open_dialog_for(interactable: Node) -> void:
if _dialog_label:
_dialog_label.text = _get_dialog_text(interactable)
_dialog_source = interactable
_set_dialog_visible(true)
func show_text(text: String) -> void:
if _dialog_label:
_dialog_label.text = text
_dialog_source = null
_set_dialog_visible(true)
func show_text_from(source: Node, text: String) -> void:
if _dialog_label:
_dialog_label.text = text
_dialog_source = source
_set_dialog_visible(true)
func close_if_text(expected_text: String) -> void:
if not _dialog_visible:
return
if _dialog_label == null:
return
if _dialog_label.text != expected_text:
return
_set_dialog_visible(false)
func is_dialog_open() -> bool:
return _dialog_visible
func is_dialog_open_from(source: Node) -> bool:
return _dialog_visible and _dialog_source == source
func close_if_source(source: Node) -> void:
if not _dialog_visible:
return
if _dialog_source != source:
return
_set_dialog_visible(false)
func _set_dialog_visible(dialog_open: bool) -> void:
_dialog_visible = dialog_open
if not _dialog_visible:
_dialog_source = null
if _dialog_panel:
_dialog_panel.visible = _dialog_visible
_update_prompt_visibility()
func _update_prompt_visibility() -> void:
if _prompt_label == null:
return
var has_active := _active_interactable != null
_prompt_label.visible = has_active and not _dialog_visible
if _prompt_label.visible:
_prompt_label.text = _get_prompt_text(_active_interactable)
func _get_prompt_text(interactable: Node) -> String:
if interactable == null:
return ""
if interactable.has_method("get_dialog_prompt"):
return String(interactable.call("get_dialog_prompt"))
return "Press E to interact"
func _get_dialog_text(interactable: Node) -> String:
if interactable == null:
return ""
if interactable.has_method("get_dialog_text"):
return String(interactable.call("get_dialog_text"))
return "..."
func _setup_ui() -> void:
var root := Control.new()
root.name = "DialogRoot"
root.set_anchors_preset(Control.PRESET_FULL_RECT)
root.mouse_filter = Control.MOUSE_FILTER_IGNORE
add_child(root)
_prompt_label = Label.new()
_prompt_label.name = "PromptLabel"
_prompt_label.set_anchors_preset(Control.PRESET_CENTER_BOTTOM)
_prompt_label.offset_left = -140.0
_prompt_label.offset_top = -64.0
_prompt_label.offset_right = 140.0
_prompt_label.offset_bottom = -36.0
_prompt_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
_prompt_label.mouse_filter = Control.MOUSE_FILTER_IGNORE
_prompt_label.text = "Press E to interact"
root.add_child(_prompt_label)
_dialog_panel = PanelContainer.new()
_dialog_panel.name = "DialogPanel"
_dialog_panel.visible = false
_dialog_panel.set_anchors_preset(Control.PRESET_CENTER_BOTTOM)
_dialog_panel.offset_left = -300.0
_dialog_panel.offset_top = -220.0
_dialog_panel.offset_right = 300.0
_dialog_panel.offset_bottom = -80.0
_dialog_panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
root.add_child(_dialog_panel)
_dialog_label = RichTextLabel.new()
_dialog_label.name = "DialogText"
_dialog_label.custom_minimum_size = Vector2(560.0, 120.0)
_dialog_label.fit_content = true
_dialog_label.scroll_active = false
_dialog_label.bbcode_enabled = true
_dialog_label.text = ""
_dialog_panel.add_child(_dialog_label)
+1
View File
@@ -0,0 +1 @@
uid://be24usagr8kml
+3
View File
@@ -64,3 +64,6 @@ func _update_login_button() -> void:
_login_button.text = "LOG OUT" _login_button.text = "LOG OUT"
else: else:
_login_button.text = "LOG IN" _login_button.text = "LOG IN"
func _on_secret_button_pressed():
get_tree().change_scene_to_file("uid://q4abhlwqdvay")
+9
View File
@@ -90,6 +90,14 @@ size_flags_vertical = 4
theme = ExtResource("1_tx5wa") theme = ExtResource("1_tx5wa")
text = "QUIT" text = "QUIT"
[node name="SecretButton" type="Button" parent="."]
show_behind_parent = true
layout_mode = 0
offset_left = 840.0
offset_top = 142.0
offset_right = 856.0
offset_bottom = 159.0
[node name="LogoutRequest" type="HTTPRequest" parent="."] [node name="LogoutRequest" type="HTTPRequest" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
@@ -97,4 +105,5 @@ unique_name_in_owner = true
[connection signal="pressed" from="MarginContainer/CenterContainer/ContentVBox/VBoxContainer/StartButton" to="." method="_on_start_button_pressed"] [connection signal="pressed" from="MarginContainer/CenterContainer/ContentVBox/VBoxContainer/StartButton" to="." method="_on_start_button_pressed"]
[connection signal="pressed" from="MarginContainer/CenterContainer/ContentVBox/VBoxContainer/SettingsButton" to="." method="_on_settings_button_pressed"] [connection signal="pressed" from="MarginContainer/CenterContainer/ContentVBox/VBoxContainer/SettingsButton" to="." method="_on_settings_button_pressed"]
[connection signal="pressed" from="MarginContainer/CenterContainer/ContentVBox/VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"] [connection signal="pressed" from="MarginContainer/CenterContainer/ContentVBox/VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"]
[connection signal="pressed" from="SecretButton" to="." method="_on_secret_button_pressed"]
[connection signal="request_completed" from="LogoutRequest" to="." method="_on_logout_request_completed"] [connection signal="request_completed" from="LogoutRequest" to="." method="_on_logout_request_completed"]
+13 -2
View File
@@ -4,11 +4,11 @@ extends RigidBody3D
# of collisions. So that's why we're using a RigidBody3D instead. # of collisions. So that's why we're using a RigidBody3D instead.
const MOVE_SPEED := 8.0 const MOVE_SPEED := 8.0
const SPRINT_MOVE_SPEED :=13
const ACCELLERATION := 30.0 const ACCELLERATION := 30.0
const DECELLERATION := 40.0 const DECELLERATION := 40.0
const JUMP_SPEED := 4.0 const JUMP_SPEED := 4.0
const MAX_NUMBER_OF_JUMPS := 2 const MAX_NUMBER_OF_JUMPS := 2
const MIN_FOV := 10 const MIN_FOV := 10
const MAX_FOV := 180 const MAX_FOV := 180
const ZOOM_FACTOR := 1.1 # Zoom out when >1, in when < 1 const ZOOM_FACTOR := 1.1 # Zoom out when >1, in when < 1
@@ -37,7 +37,9 @@ var _jump_triggered := false
@export var anim_idle_name := "Idle" @export var anim_idle_name := "Idle"
@export var anim_walk_name := "Walk" @export var anim_walk_name := "Walk"
@export var anim_jump_name := "Jump" @export var anim_jump_name := "Jump"
@export var anim_run_name := "Run"
@export var anim_walk_speed_threshold := 0.25 @export var anim_walk_speed_threshold := 0.25
@export var anim_sprint_speed_threshold := 10.0
var jump_sound = preload("res://assets/audio/jump.ogg") var jump_sound = preload("res://assets/audio/jump.ogg")
var audio_player = AudioStreamPlayer.new() var audio_player = AudioStreamPlayer.new()
@@ -49,6 +51,7 @@ var audio_player = AudioStreamPlayer.new()
var phone_visible := false var phone_visible := false
func _ready() -> void: func _ready() -> void:
add_to_group("player")
axis_lock_angular_x = true axis_lock_angular_x = true
axis_lock_angular_z = true axis_lock_angular_z = true
angular_damp = 6.0 angular_damp = 6.0
@@ -117,8 +120,13 @@ func _integrate_forces(state):
right = _last_move_right right = _last_move_right
var dir := (right * input2v.x + forward * input2v.y).normalized() var dir := (right * input2v.x + forward * input2v.y).normalized()
var target_v := dir * MOVE_SPEED var target_v := dir * MOVE_SPEED
# Sprinting
if Input.is_key_pressed(KEY_SHIFT):
target_v = dir * SPRINT_MOVE_SPEED
var ax := ACCELLERATION if dir != Vector3.ZERO else DECELLERATION var ax := ACCELLERATION if dir != Vector3.ZERO else DECELLERATION
linear_velocity.x = move_toward(linear_velocity.x, target_v.x, ax * state.step) linear_velocity.x = move_toward(linear_velocity.x, target_v.x, ax * state.step)
linear_velocity.z = move_toward(linear_velocity.z, target_v.z, ax * state.step) linear_velocity.z = move_toward(linear_velocity.z, target_v.z, ax * state.step)
@@ -188,6 +196,10 @@ func _update_animation(on_floor: bool, velocity: Vector3) -> void:
if _anim_player.current_animation != anim_jump_name: if _anim_player.current_animation != anim_jump_name:
_anim_player.play(anim_jump_name) _anim_player.play(anim_jump_name)
return return
if on_floor and horizontal_speed > anim_sprint_speed_threshold and _anim_player.has_animation(anim_run_name):
if _anim_player.current_animation != anim_walk_name:
_anim_player.play(anim_walk_name)
return
if horizontal_speed > anim_walk_speed_threshold and _anim_player.has_animation(anim_walk_name): if horizontal_speed > anim_walk_speed_threshold and _anim_player.has_animation(anim_walk_name):
if _anim_player.current_animation != anim_walk_name: if _anim_player.current_animation != anim_walk_name:
_anim_player.play(anim_walk_name) _anim_player.play(anim_walk_name)
@@ -233,4 +245,3 @@ func exit_vehicle(exit_point: Node3D, vehicle_camera: Camera3D) -> void:
vehicle_camera.current = false vehicle_camera.current = false
if cam: if cam:
cam.current = true cam.current = true