Compare commits
8 Commits
91cc2d4e28
...
df993962d8
| Author | SHA1 | Date | |
|---|---|---|---|
| df993962d8 | |||
| 7d43e9f47b | |||
| 68c9bb504f | |||
| c02de730b3 | |||
| 195c1b206a | |||
| b0ccd593a0 | |||
| 3fc5bcdf8b | |||
| cdba3e081d |
@ -1,9 +1,10 @@
|
|||||||
[gd_scene load_steps=6 format=3 uid="uid://dsu2jbr2yqmoc"]
|
[gd_scene load_steps=7 format=3 uid="uid://dsu2jbr2yqmoc"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bri7wyjwm34ja" path="res://Assets/Levels/ApartmentNew.tscn" id="1_2r5mf"]
|
[ext_resource type="PackedScene" uid="uid://bri7wyjwm34ja" path="res://Assets/Levels/ApartmentNew.tscn" id="1_2r5mf"]
|
||||||
[ext_resource type="PackedScene" uid="uid://eeymjvfjb5pq" path="res://Assets/Levels/hospital_outside.tscn" id="2_kbvgm"]
|
[ext_resource type="PackedScene" uid="uid://eeymjvfjb5pq" path="res://Assets/Levels/hospital_outside.tscn" id="2_kbvgm"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cpwg1ula5qbrl" path="res://Assets/components/spawn_point.tscn" id="3_5q3xq"]
|
[ext_resource type="PackedScene" uid="uid://cpwg1ula5qbrl" path="res://Assets/components/spawn_point.tscn" id="3_5q3xq"]
|
||||||
[ext_resource type="Script" path="res://Assets/scripts/teleport.gd" id="4_4d3gv"]
|
[ext_resource type="Script" path="res://Assets/scripts/teleport.gd" id="4_4d3gv"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dn2rvffy4bdtr" path="res://Assets/components/teleport_boundry.tscn" id="5_jnw46"]
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_1qrko"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_1qrko"]
|
||||||
size = Vector3(1, 3.3443, 1.93066)
|
size = Vector3(1, 3.3443, 1.93066)
|
||||||
@ -33,4 +34,7 @@ shape = SubResource("BoxShape3D_1qrko")
|
|||||||
[node name="TeleportLocation" type="Node3D" parent="Area3D" groups=["TeleportLocation"]]
|
[node name="TeleportLocation" type="Node3D" parent="Area3D" groups=["TeleportLocation"]]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.02602, 18.2557, 23.8579)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.02602, 18.2557, 23.8579)
|
||||||
|
|
||||||
|
[node name="TeleportBoundry" parent="Area3D" instance=ExtResource("5_jnw46")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 31.8806, -34.8267, 0)
|
||||||
|
|
||||||
[connection signal="body_entered" from="Area3D" to="Area3D" method="_on_body_entered"]
|
[connection signal="body_entered" from="Area3D" to="Area3D" method="_on_body_entered"]
|
||||||
|
|||||||
@ -26,12 +26,15 @@ grow_vertical = 2
|
|||||||
|
|
||||||
[node name="Pause Label" type="RichTextLabel" parent="Pause Menu"]
|
[node name="Pause Label" type="RichTextLabel" parent="Pause Menu"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 5
|
anchors_preset = -1
|
||||||
anchor_left = 0.5
|
anchor_left = 0.406
|
||||||
anchor_right = 0.5
|
anchor_top = 0.059
|
||||||
offset_left = -35.0
|
anchor_right = 0.603
|
||||||
offset_right = 35.0
|
anchor_bottom = 0.154
|
||||||
offset_bottom = 28.0
|
offset_left = -0.52002
|
||||||
|
offset_top = 0.279995
|
||||||
|
offset_right = 0.239868
|
||||||
|
offset_bottom = -0.320023
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
text = "Paused"
|
text = "Paused"
|
||||||
|
|
||||||
|
|||||||
@ -2,10 +2,14 @@ extends HBoxContainer
|
|||||||
|
|
||||||
@export var Setting:GlobalSettings.Setting = GlobalSettings.Setting.Test_Value
|
@export var Setting:GlobalSettings.Setting = GlobalSettings.Setting.Test_Value
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
|
||||||
func _ready():
|
func _ready():
|
||||||
$Label.text = GlobalSettings.GetSettingName(Setting)
|
$Label.text = GlobalSettings.GetSettingName(Setting)
|
||||||
$HSlider.value = GlobalSettings.GetSetting(Setting)
|
$HSlider.value = GlobalSettings.GetSetting(Setting)
|
||||||
|
var SliderRange = GlobalSettings.GetSettingRange(Setting)
|
||||||
|
$HSlider.min_value = SliderRange.x
|
||||||
|
$HSlider.max_value = SliderRange.y
|
||||||
|
$HSlider.step = SliderRange.z
|
||||||
|
|
||||||
func _on_setting_slider_value_changed(value:float):
|
func _on_setting_slider_value_changed(value:float):
|
||||||
GlobalSettings.SetSetting(Setting, value)
|
GlobalSettings.SetSetting(Setting, value)
|
||||||
|
print(Setting, value)
|
||||||
|
|||||||
@ -6,18 +6,23 @@ extends Node3D
|
|||||||
var max_angle_radians = 1.5
|
var max_angle_radians = 1.5
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
var look_velocity = Input.get_vector("look_left", "look_right", "look_up", "look_down")
|
if not GlobalSettings.is_paused:
|
||||||
var rotate_degree = -look_velocity.y * GlobalSettings.GetSetting(GlobalSettings.Setting.Joystick_Speed)
|
var look_velocity = Input.get_vector("look_left", "look_right", "look_up", "look_down")
|
||||||
rotate_x(rotate_degree)
|
var rotate_degree = -look_velocity.y * (GlobalSettings.GetSetting(GlobalSettings.Setting.Joystick_Speed)) *delta
|
||||||
|
var rotation_after = rotate_degree + rotation.x
|
||||||
|
if rotation_after <= max_angle_radians and rotate_degree > 0:
|
||||||
|
rotate_x(rotate_degree)
|
||||||
|
elif rotation_after >= -max_angle_radians and rotate_degree < 0:
|
||||||
|
rotate_x(rotate_degree)
|
||||||
|
|
||||||
|
|
||||||
func _unhandled_input(event):
|
func _unhandled_input(event):
|
||||||
if event is InputEventMouseMotion:
|
if not GlobalSettings.is_paused:
|
||||||
var mouse_movement = -event.relative.y
|
if event is InputEventMouseMotion:
|
||||||
var rotate_amount = mouse_movement * GlobalSettings.GetSetting(GlobalSettings.Setting.Mouse_Speed)
|
var mouse_movement = -event.relative.y
|
||||||
var rotation_after = rotate_amount + rotation.x
|
var rotate_amount = mouse_movement * (GlobalSettings.GetSetting(GlobalSettings.Setting.Mouse_Speed) / 100)
|
||||||
if rotation_after <= max_angle_radians and rotate_amount > 0:
|
var rotation_after = rotate_amount + rotation.x
|
||||||
rotate_x(rotate_amount)
|
if rotation_after <= max_angle_radians and rotate_amount > 0:
|
||||||
elif rotation_after >= -max_angle_radians and rotate_amount < 0:
|
rotate_x(rotate_amount)
|
||||||
rotate_x(rotate_amount)
|
elif rotation_after >= -max_angle_radians and rotate_amount < 0:
|
||||||
|
rotate_x(rotate_amount)
|
||||||
@ -13,39 +13,39 @@ var HasGeneratorKey = false
|
|||||||
|
|
||||||
var Settings:Dictionary = {
|
var Settings:Dictionary = {
|
||||||
Setting.Mouse_Speed: {
|
Setting.Mouse_Speed: {
|
||||||
"value": 0.02,
|
"value": 1,
|
||||||
"text": "Mouse Speed",
|
"text": "Mouse Speed",
|
||||||
"range": Vector2(0.0001, 0.09)
|
"range": Vector3(0.5, 4, .05)
|
||||||
},
|
},
|
||||||
Setting.Joystick_Speed: {
|
Setting.Joystick_Speed: {
|
||||||
"value": 2,
|
"value": 4.0,
|
||||||
"text": "Joystick Speed",
|
"text": "Joystick Speed",
|
||||||
"range": Vector2(0.5, 4)
|
"range": Vector3(2, 6, 0.25)
|
||||||
},
|
},
|
||||||
Setting.SFX_Volume: {
|
Setting.SFX_Volume: {
|
||||||
"value": 100,
|
"value": 100.0,
|
||||||
"text": "SFX Volume",
|
"text": "SFX Volume",
|
||||||
"range": Vector2(0,100)
|
"range": Vector3(0,100, 0.5)
|
||||||
},
|
},
|
||||||
Setting.Music_Volume: {
|
Setting.Music_Volume: {
|
||||||
"value": 100,
|
"value": 100.0,
|
||||||
"text": "Music Volume",
|
"text": "Music Volume",
|
||||||
"range": Vector2(0,100)
|
"range": Vector3(0,100, 0.5)
|
||||||
},
|
},
|
||||||
Setting.Voice_Volume: {
|
Setting.Voice_Volume: {
|
||||||
"value": 100,
|
"value": 100.0,
|
||||||
"text": "Voice Volume",
|
"text": "Voice Volume",
|
||||||
"range": Vector2(0,100)
|
"range": Vector3(0,100, 0.5)
|
||||||
},
|
},
|
||||||
Setting.FOV: {
|
Setting.FOV: {
|
||||||
"value": 95,
|
"value": 95.0,
|
||||||
"text": "FOV",
|
"text": "FOV",
|
||||||
"range": Vector2(75,115)
|
"range": Vector3(75,115, 1)
|
||||||
},
|
},
|
||||||
Setting.Test_Value: {
|
Setting.Test_Value: {
|
||||||
"value": 69,
|
"value": 69.0,
|
||||||
"text": "Test Value",
|
"text": "Test Value",
|
||||||
"range": Vector2(0,100)
|
"range": Vector3(0,100, 0.25)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,20 +58,20 @@ func GetSetting(SettingName):
|
|||||||
return Settings.get(SettingName).get("value")
|
return Settings.get(SettingName).get("value")
|
||||||
|
|
||||||
func GetSettingName(SettingName):
|
func GetSettingName(SettingName):
|
||||||
print(Setting.get(SettingName))
|
return Settings.get(SettingName).get("text")
|
||||||
#return Setting.get(SettingName).get("text")
|
|
||||||
|
|
||||||
func GetSettingRange(SettingName):
|
func GetSettingRange(SettingName):
|
||||||
return Setting.get(SettingName).get("range")
|
return Settings.get(SettingName).get("range")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func SetSetting(SettingName, value):
|
func SetSetting(SettingName, value):
|
||||||
Settings[SettingName]["value"] = value
|
Settings[SettingName]["value"] = value
|
||||||
|
print(value)
|
||||||
|
|
||||||
func PrintSettings():
|
func PrintSettings():
|
||||||
for setting in Settings.keys():
|
for key in Settings.keys():
|
||||||
print(setting, ":", Settings.get(setting))
|
print(key, ":", Settings.get(key))
|
||||||
|
|
||||||
|
|
||||||
func SetCurrentMap(selected_map):
|
func SetCurrentMap(selected_map):
|
||||||
|
|||||||
@ -33,7 +33,7 @@ func _physics_process(delta):
|
|||||||
velocity.y -= gravity * delta
|
velocity.y -= gravity * delta
|
||||||
|
|
||||||
# Handle jump.
|
# Handle jump.
|
||||||
if Input.is_action_just_pressed("ui_accept") and is_on_floor() and current_condition != CONDITION.COUGHING and current_condition != CONDITION.SEVERE_COUGHING:
|
if Input.is_action_just_pressed("jump") and is_on_floor() and current_condition != CONDITION.COUGHING and current_condition != CONDITION.SEVERE_COUGHING:
|
||||||
velocity.y = JUMP_VELOCITY
|
velocity.y = JUMP_VELOCITY
|
||||||
|
|
||||||
# Get the input direction and handle the movement/deceleration.
|
# Get the input direction and handle the movement/deceleration.
|
||||||
@ -72,7 +72,7 @@ func _input(event):
|
|||||||
respawn()
|
respawn()
|
||||||
if not is_paused:
|
if not is_paused:
|
||||||
if event is InputEventMouseMotion:
|
if event is InputEventMouseMotion:
|
||||||
rotate_y(-event.relative.x * GlobalSettings.GetSetting(GlobalSettings.Setting.Mouse_Speed))
|
rotate_y(-event.relative.x * (GlobalSettings.GetSetting(GlobalSettings.Setting.Mouse_Speed)) / 100)
|
||||||
|
|
||||||
if event.is_action_pressed("vape"):
|
if event.is_action_pressed("vape"):
|
||||||
if current_condition == CONDITION.NORMAL:
|
if current_condition == CONDITION.NORMAL:
|
||||||
|
|||||||
@ -36,7 +36,7 @@ version_control/autoload_on_startup=true
|
|||||||
|
|
||||||
vape={
|
vape={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
|
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
|
||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":true,"script":null)
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":10,"pressure":0.0,"pressed":true,"script":null)
|
||||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"echo":false,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"echo":false,"script":null)
|
||||||
, 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":2,"position":Vector2(424, 13),"global_position":Vector2(428, 54),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
, 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":2,"position":Vector2(424, 13),"global_position":Vector2(428, 54),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||||
@ -101,6 +101,13 @@ quit={
|
|||||||
interact={
|
interact={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":3,"pressure":0.0,"pressed":true,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
jump={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user