terminal ui comes up

This commit is contained in:
Clevertop 2024-08-10 17:12:20 +10:00
parent 40e4281fd4
commit fada7c657b
4 changed files with 26 additions and 5 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://bojbawyoy11i4"]
[gd_scene load_steps=14 format=3 uid="uid://bojbawyoy11i4"]
[ext_resource type="Script" path="res://Scripts/ChronoManager.gd" id="1_5b2rd"]
[ext_resource type="Material" uid="uid://cr4ra7ijk1uec" path="res://Assets/Materials/floor.tres" id="2_0aj3l"]
@ -31,11 +31,15 @@ material = SubResource("StandardMaterial3D_itc1d")
[sub_resource type="BoxShape3D" id="BoxShape3D_y4l56"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_mfjp6"]
data = PackedVector3Array(-0.5, 1, 0.5, 0.5, 1, 0.5, -0.5, -1, 0.5, 0.5, 1, 0.5, 0.5, -1, 0.5, -0.5, -1, 0.5, 0.5, 1, -0.5, -0.5, 1, -0.5, 0.5, -1, -0.5, -0.5, 1, -0.5, -0.5, -1, -0.5, 0.5, -1, -0.5, 0.5, 1, 0.5, 0.5, 1, -0.5, 0.5, -1, 0.5, 0.5, 1, -0.5, 0.5, -1, -0.5, 0.5, -1, 0.5, -0.5, 1, -0.5, -0.5, 1, 0.5, -0.5, -1, -0.5, -0.5, 1, 0.5, -0.5, -1, 0.5, -0.5, -1, -0.5, 0.5, 1, 0.5, -0.5, 1, 0.5, 0.5, 1, -0.5, -0.5, 1, 0.5, -0.5, 1, -0.5, 0.5, 1, -0.5, -0.5, -1, 0.5, 0.5, -1, 0.5, -0.5, -1, -0.5, 0.5, -1, 0.5, 0.5, -1, -0.5, -0.5, -1, -0.5)
[sub_resource type="BoxMesh" id="BoxMesh_u6v2s"]
size = Vector3(1, 2, 1)
[node name="ChronoManager" type="Node3D"]
[node name="ChronoManager" type="Node3D" node_paths=PackedStringArray("gui")]
script = ExtResource("1_5b2rd")
gui = NodePath("Gui")
[node name="Player" parent="." instance=ExtResource("2_hsi55")]
@ -61,8 +65,13 @@ mesh = SubResource("BoxMesh_lcav8")
[node name="CollisionShape3D" type="CollisionShape3D" parent="EndZone/Area3D"]
shape = SubResource("BoxShape3D_y4l56")
[node name="Terminal" type="Node3D" parent="."]
[node name="Terminal" type="StaticBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.50596, 2.93638, 3.58967)
[node name="CollisionShape3D" type="CollisionShape3D" parent="Terminal"]
shape = SubResource("ConcavePolygonShape3D_mfjp6")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Terminal"]
mesh = SubResource("BoxMesh_u6v2s")
[connection signal="object_clicked" from="Player" to="." method="_on_player_object_clicked"]

View file

@ -44,3 +44,8 @@ func open_termimal():
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
#display terminal ui
pass
func _on_player_object_clicked(object):
if(object.name == "Terminal"):
open_termimal()

View file

@ -4,6 +4,8 @@ extends CharacterBody3D
@export var mouse_sensitivity : float = 0.003 # TODO: this is sketchy check that its framerate independant pls
@export var raycast : RayCast3D
signal object_clicked(object : Node3D)
const SPEED = 5.0
const JUMP_VELOCITY = 4.5
@ -31,7 +33,12 @@ func _physics_process(delta):
# interact with stuff
if Input.is_action_just_pressed("interact"):
print(raycast.)
if "name" in raycast.get_collider():
print(raycast.get_collider().name)
object_clicked.emit(raycast.get_collider())
else:
print("womp womp")
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.

View file

@ -10,7 +10,6 @@
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83982, 0)
script = ExtResource("1_tc5d2")
camera = NodePath("Camera3D")
mouse_sensitivity = null
raycast = NodePath("Camera3D/RayCast3D")
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
@ -23,6 +22,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.621505, 0)
[node name="RayCast3D" type="RayCast3D" parent="Camera3D"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0)
target_position = Vector3(0, -4, 0)
collide_with_areas = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_a6eig")