diff --git a/Assets/Textures/transparent_wall_new.png b/Assets/Textures/transparent_wall_new.png new file mode 100644 index 0000000..0609c16 Binary files /dev/null and b/Assets/Textures/transparent_wall_new.png differ diff --git a/Assets/Textures/transparent_wall_new.png.import b/Assets/Textures/transparent_wall_new.png.import new file mode 100644 index 0000000..93fe608 --- /dev/null +++ b/Assets/Textures/transparent_wall_new.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bb8771vptn2l8" +path.s3tc="res://.godot/imported/transparent_wall_new.png-e58866734075665465b8ec98c0ffb79c.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://Assets/Textures/transparent_wall_new.png" +dest_files=["res://.godot/imported/transparent_wall_new.png-e58866734075665465b8ec98c0ffb79c.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 diff --git a/Commands/command_block.gd b/Commands/command_block.gd index 2c78a34..073d230 100644 --- a/Commands/command_block.gd +++ b/Commands/command_block.gd @@ -3,15 +3,16 @@ extends RigidBody3D class_name Command_Block @export var command_name : String -@export var command_sprite : Texture2D: - set(new_texture): - if command_sprite != null: - command_sprite.changed.disconnect(on_texture_changed) - command_sprite = new_texture - command_sprite.changed.connect(on_texture_changed) +@export var command_sprite : Texture2D#: + #set(new_texture): + #if command_sprite != null: + #command_sprite.changed.disconnect(on_texture_changed) + #command_sprite = new_texture + #command_sprite.changed.connect(on_texture_changed) # Called when the node enters the scene tree for the first time. func _ready(): + $MeshInstance3D.material_override = $MeshInstance3D.material_override.duplicate() $MeshInstance3D.material_override.albedo_texture = command_sprite pass # Replace with function body. @@ -20,7 +21,7 @@ func _ready(): func _process(delta): pass -func on_texture_changed(): - print("meow") - $MeshInstance3D.material_override = $MeshInstance3D.material_override.duplicate() - $MeshInstance3D.material_override.albedo_texture = command_sprite +#func on_texture_changed(): + #print("meow") + #$MeshInstance3D.material_override = $MeshInstance3D.material_override.duplicate() + #$MeshInstance3D.material_override.albedo_texture = command_sprite diff --git a/Levels/StartingRoom.tscn b/Levels/StartingRoom.tscn index f8274ba..e0cf567 100644 --- a/Levels/StartingRoom.tscn +++ b/Levels/StartingRoom.tscn @@ -1,29 +1,100 @@ -[gd_scene load_steps=16 format=3 uid="uid://bojbawyoy11i4"] +[gd_scene load_steps=26 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"] [ext_resource type="PackedScene" uid="uid://d34smep2ukq7w" path="res://player.tscn" id="2_hsi55"] [ext_resource type="PackedScene" uid="uid://bnlexkofp68gv" path="res://gui.tscn" id="3_60lfp"] +[ext_resource type="Texture2D" uid="uid://c1fesrqdpjloa" path="res://Assets/Textures/ice_0_old.png" id="4_v03h0"] [ext_resource type="PackedScene" uid="uid://dqvq4ybcpws87" path="res://Commands/command_block.tscn" id="5_81jk1"] -[ext_resource type="Texture2D" uid="uid://contqwyu7r114" path="res://icon.svg" id="6_feqb2"] +[ext_resource type="Texture2D" uid="uid://dc23iehev1s8w" path="res://Assets/Textures/crystal_wall_2.png" id="6_g3qnb"] +[ext_resource type="Texture2D" uid="uid://bb8771vptn2l8" path="res://Assets/Textures/transparent_wall_new.png" id="6_nv7xj"] +[ext_resource type="Texture2D" uid="uid://dd150xco2ee5q" path="res://Assets/Textures/cobalt_stone_4.png" id="7_qjeey"] [sub_resource type="BoxMesh" id="BoxMesh_21vdj"] material = ExtResource("2_0aj3l") [sub_resource type="BoxShape3D" id="BoxShape3D_nndy8"] +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_itvfy"] +albedo_texture = ExtResource("4_v03h0") +emission = Color(1, 1, 1, 1) +subsurf_scatter_strength = 1.0 +uv1_scale = Vector3(3, 2, 1) +uv1_triplanar_sharpness = 0.0583145 +uv2_triplanar_sharpness = 0.170755 +texture_filter = 0 + +[sub_resource type="BoxMesh" id="BoxMesh_whsfn"] +material = SubResource("StandardMaterial3D_itvfy") + +[sub_resource type="BoxShape3D" id="BoxShape3D_okvc0"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6y00s"] +albedo_texture = ExtResource("7_qjeey") +emission = Color(1, 1, 1, 1) +subsurf_scatter_strength = 1.0 +uv1_scale = Vector3(3, 2, 1) +uv1_triplanar_sharpness = 0.0583145 +uv2_triplanar_sharpness = 0.170755 +texture_filter = 0 + +[sub_resource type="BoxMesh" id="BoxMesh_w6oj5"] +material = SubResource("StandardMaterial3D_6y00s") + +[sub_resource type="BoxShape3D" id="BoxShape3D_s1o2h"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jttjt"] +transparency = 1 +albedo_color = Color(1, 1, 1, 0.533333) +albedo_texture = ExtResource("6_nv7xj") +emission = Color(1, 1, 1, 1) +subsurf_scatter_strength = 1.0 +uv1_scale = Vector3(3, 2, 1) +uv1_triplanar_sharpness = 0.0583145 +uv2_triplanar_sharpness = 0.170755 +texture_filter = 0 + +[sub_resource type="BoxMesh" id="BoxMesh_wb4dr"] +material = SubResource("StandardMaterial3D_jttjt") + +[sub_resource type="BoxShape3D" id="BoxShape3D_26jet"] + [sub_resource type="MeshLibrary" id="MeshLibrary_udrkc"] -item/0/name = "dsa" +item/0/name = "stone square grey" item/0/mesh = SubResource("BoxMesh_21vdj") item/0/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) item/0/shapes = [SubResource("BoxShape3D_nndy8"), Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)] item/0/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) item/0/navigation_layers = 1 +item/1/name = "ice" +item/1/mesh = SubResource("BoxMesh_whsfn") +item/1/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +item/1/shapes = [SubResource("BoxShape3D_okvc0"), Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)] +item/1/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +item/1/navigation_layers = 1 +item/2/name = "cobalt stone" +item/2/mesh = SubResource("BoxMesh_w6oj5") +item/2/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +item/2/shapes = [SubResource("BoxShape3D_s1o2h"), Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)] +item/2/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +item/2/navigation_layers = 1 +item/3/name = "transparent wall" +item/3/mesh = SubResource("BoxMesh_wb4dr") +item/3/mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +item/3/shapes = [SubResource("BoxShape3D_26jet"), Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)] +item/3/navigation_mesh_transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) +item/3/navigation_layers = 1 [sub_resource type="Environment" id="Environment_u27ip"] background_mode = 1 background_color = Color(1, 1, 1, 1) ambient_light_energy = 0.5 +fog_light_color = Color(0.403903, 7.64076e-07, 2.40654e-08, 1) +fog_density = 0.0 +fog_sky_affect = 0.0 +volumetric_fog_density = 0.0 +volumetric_fog_albedo = Color(1, 0, 0, 1) +volumetric_fog_emission = Color(1, 0, 0, 1) [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_itc1d"] albedo_color = Color(0.571354, 1, 0.475134, 1) @@ -33,25 +104,20 @@ 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_paths=PackedStringArray("gui")] script = ExtResource("1_5b2rd") gui = NodePath("Gui") [node name="Player" parent="." instance=ExtResource("2_hsi55")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.12895, 0) [node name="GridMap" type="GridMap" parent="."] mesh_library = SubResource("MeshLibrary_udrkc") cell_size = Vector3(1, 1, 1) data = { -"cells": PackedInt32Array(65533, 65534, 851968, 65532, 65534, 851968, 65533, 65533, 851968, 65532, 65533, 851968, 65534, 65531, 851968, 65533, 65531, 851968, 65532, 65531, 851968, 65531, 65531, 851968, 65530, 65531, 851968, 65529, 65531, 851968, 65532, 65526, 851968, 65531, 65526, 851968, 65530, 65526, 851968, 65529, 65526, 851968, 65528, 65526, 851968, 65527, 65526, 851968, 65526, 65526, 851968, 65525, 65526, 851968, 65526, 65525, 851968, 65527, 65525, 851968, 65528, 65525, 851968, 65529, 65525, 851968, 65530, 65525, 851968, 65531, 65525, 851968, 65532, 65525, 851968, 65533, 65525, 851968, 65525, 65525, 851968, 65524, 65525, 851968, 65524, 65526, 851968, 65523, 65525, 851968, 65523, 65526, 851968, 65522, 65527, 851968, 65523, 65527, 851968, 65523, 65528, 851968, 65523, 65529, 851968, 65523, 65530, 851968, 65523, 65531, 851968, 65523, 65532, 851968, 196595, 65525, 851968, 196596, 65525, 851968, 196597, 65525, 851968, 196598, 65525, 851968, 196599, 65525, 851968, 196600, 65525, 851968, 196601, 65525, 851968, 196602, 65525, 851968, 196603, 65525, 851968, 196604, 65525, 851968, 196605, 65526, 851968, 196604, 65526, 851968, 196603, 65526, 851968, 196602, 65526, 851968, 196601, 65526, 851968, 196600, 65526, 851968, 196599, 65526, 851968, 196598, 65526, 851968, 196597, 65526, 851968, 196596, 65526, 851968, 196595, 65526, 851968, 196594, 65526, 851968, 131059, 65526, 851968, 131060, 65526, 851968, 131061, 65526, 851968, 131062, 65526, 851968, 131062, 65527, 851968, 131063, 65527, 851968, 131064, 65527, 851968, 131065, 65527, 851968, 131066, 65527, 851968, 131066, 65526, 851968, 131067, 65526, 851968, 131068, 65526, 851968, 131065, 65526, 851968, 131064, 65526, 851968, 131063, 65526, 851968, 131064, 3, 851968, 131063, 3, 851968, 131062, 3, 851968, 131062, 4, 851968, 131063, 4, 851968, 131063, 5, 786432, 131064, 5, 786432, 131065, 5, 786432, 131065, 4, 983040, 131064, 4, 851968, 131068, 8, 851968, 131063, 9, 786432, 131056, 0, 786432, 131059, 5, 786432, 131058, 5, 786432, 131057, 5, 786432, 131056, 5, 786432, 131056, 4, 786432, 131055, 4, 786432, 131055, 3, 786432, 131055, 2, 786432, 131056, 2, 786432, 131056, 1, 786432, -65550, 0, 786432, -65549, 0, 786432, -13, 0, 786432, -12, 0, 786432, 65524, 0, 786432, 65523, 0, 786432, 131059, 0, 786432, 131058, 0, 786432, 65522, 0, 786432, -14, 0, 786432, 65521, 0, 786432, -15, 0, 786432, 196594, 0, 786432, 196593, 0, 786432, 131057, 0, 786432, 65520, 0, 786432, -16, 0, 786432, -65551, 0, 786432, -131087, 0, 786432, -196623, 0, 786432, -196622, 0, 786432, -131086, 0, 786432, 262130, 0, 786432, 262129, 0, 786432, 327665, 0, 786432, 262128, 0, 786432, 196592, 0, 786432, -196621, 0, 786432, -131085, 0, 786432, -65548, 0, 786432, 196595, 0, 786432, -262158, 0, 786432, -262157, 0, 786432, -131084, 0, 786432, -65547, 0, 786432, -11, 0, 786432, 65525, 0, 786432, 131061, 0, 786432, 196597, 0, 786432, 196596, 0, 786432, 262132, 0, 786432, 327667, 0, 786432, 393203, 0, 786432, 393202, 0, 786432, 393201, 0, 786432, 327664, 0, 786432, 131055, 0, 786432, 65519, 0, 786432, -17, 0, 786432, -65552, 0, 786432, -131088, 0, 786432, -262160, 0, 786432, -327694, 0, 786432, -327693, 0, 786432, -262156, 0, 786432, -196620, 0, 786432, 131060, 0, 786432, 262131, 0, 786432, 327666, 0, 786432, -65553, 0, 786432, -131089, 0, 786432, -196625, 0, 786432, -196624, 0, 786432, -262159, 0, 786432, -327695, 0, 786432, 131062, 5, 786432, 131062, 6, 786432, 131062, 7, 786432, 131062, 8, 786432, 131062, 9, 786432, 131063, 6, 786432, 131063, 7, 786432, 131063, 8, 786432, 131064, 6, 786432, 131064, 7, 786432, 131064, 8, 786432, 131064, 9, 786432, 131065, 6, 786432, 131065, 7, 786432, 131065, 8, 786432, 131065, 9, 786432, 131066, 5, 786432, 131066, 6, 786432, 131066, 7, 786432, 131066, 8, 786432, 131066, 9, 786432, 131067, 5, 983040, 131067, 6, 786432, 131067, 7, 786432, 131067, 8, 786432, 131067, 9, 786432, 131065, 3, 983040, 131066, 4, 983040, 131068, 5, 983040, 131068, 6, 983040, 131067, 4, 983040, 131066, 3, 983040, 131066, 2, 983040, 131065, 2, 983040, 131067, 3, 983040, 131069, 6, 983040, 131069, 5, 983040, 131068, 4, 983040, 131067, 2, 983040, 131066, 1, 983040, 131068, 3, 983040, 131069, 4, 983040, 131070, 5, 983040, 131070, 6, 983040, 131068, 2, 983040, 131070, 4, 983040, 131071, 5, 983040, 131069, 3, 983040, 131068, 1, 983040, 131069, 1, 983040, 131070, 2, 983040, 131070, 3, 983040, 131071, 3, 983040, 131069, 2, 983040, 131068, 0, 983040, 65536, 5, 983040, 131071, 4, 983040, 65536, 4, 983040, 131070, 1, 983040, 131071, 2, 983040, 65536, 3, 983040, 65534, 0, 983040, 65534, 1, 983040, 65535, 1, 983040, 0, 1, 983040, 65533, 0, 983040, 65535, 0, 983040, 0, 0, 983040, 1, 0, 983040, 1, 1, 983040, 2, 1, 983040, 65533, 65535, 983040, 65532, 65535, 983040, 65534, 65535, 983040, 65535, 65535, 983040, 2, 0, 983040, 0, 65535, 983040, 65534, 65534, 983040, 65535, 65534, 983040, 1, 65535, 983040, 2, 65535, 983040, 0, 65534, 983040, 1, 65534, 983040, 65535, 65533, 983040, 65534, 65533, 983040, 0, 65533, 983040, 2, 65534, 983040, 1, 65533, 983040, 65527, 16, 393216, 65528, 16, 393216, 65529, 16, 393216, 65530, 16, 393216, 65531, 17, 393216, 65531, 18, 393216, 65531, 19, 393216, 65531, 20, 393216, 65530, 21, 393216, 65529, 21, 393216, 1, 16, 393216, 2, 17, 393216, 2, 18, 393216, 2, 19, 393216, 1, 20, 393216, 0, 20, 393216, 65535, 20, 393216, 65534, 19, 393216, 65534, 18, 393216, 65528, 21, 393216, 65527, 21, 393216, 65526, 20, 393216, 65526, 19, 393216, 65526, 17, 393216, 65526, 18, 393216, 65534, 17, 393216, 65535, 16, 393216) +"cells": PackedInt32Array(65532, 65526, 851968, 65531, 65526, 851968, 65530, 65526, 851968, 65529, 65526, 851968, 65528, 65526, 851968, 65527, 65526, 851968, 65526, 65526, 851968, 65525, 65526, 851968, 65526, 65525, 851968, 65527, 65525, 851968, 65528, 65525, 851968, 65529, 65525, 851968, 65530, 65525, 851968, 65531, 65525, 851968, 65532, 65525, 851968, 65533, 65525, 851968, 65525, 65525, 851968, 65524, 65525, 851968, 65524, 65526, 851968, 65523, 65525, 851968, 65523, 65526, 851968, 65522, 65527, 851968, 65523, 65527, 851968, 65523, 65528, 851968, 65523, 65529, 851968, 65523, 65530, 851968, 65523, 65531, 851968, 65523, 65532, 851968, 196595, 65525, 851968, 196596, 65525, 851968, 196597, 65525, 851968, 196598, 65525, 851968, 196599, 65525, 851968, 196600, 65525, 851968, 196601, 65525, 851968, 196602, 65525, 851968, 196603, 65525, 851968, 196604, 65525, 851968, 196605, 65526, 851968, 196604, 65526, 851968, 196603, 65526, 851968, 196602, 65526, 851968, 196601, 65526, 851968, 196600, 65526, 851968, 196599, 65526, 851968, 196598, 65526, 851968, 196597, 65526, 851968, 196596, 65526, 851968, 196595, 65526, 851968, 196594, 65526, 851968, 131059, 65526, 851968, 131060, 65526, 851968, 131061, 65526, 851968, 131062, 65526, 851968, 131062, 65527, 851968, 131063, 65527, 851968, 131064, 65527, 851968, 131065, 65527, 851968, 131066, 65527, 851968, 131066, 65526, 851968, 131067, 65526, 851968, 131068, 65526, 851968, 131065, 65526, 851968, 131064, 65526, 851968, 131063, 65526, 851968, 131056, 0, 786432, 131059, 5, 786432, 131058, 5, 786432, 131057, 5, 786432, 131056, 5, 786432, 131056, 4, 786432, 131055, 4, 786432, 131055, 3, 786432, 131055, 2, 786432, 131056, 2, 786432, 131056, 1, 786432, -65550, 0, 786432, -65549, 0, 786432, -13, 0, 786432, -12, 0, 786432, 65524, 0, 786432, 65523, 0, 786432, 131059, 0, 786432, 131058, 0, 786432, 65522, 0, 786432, -14, 0, 786432, 65521, 0, 786432, -15, 0, 786432, 196594, 0, 786432, 196593, 0, 786432, 131057, 0, 786432, 65520, 0, 786432, -16, 0, 786432, -65551, 0, 786432, -131087, 0, 786432, -196623, 0, 786432, -196622, 0, 786432, -131086, 0, 786432, 262130, 0, 786432, 262129, 0, 786432, 327665, 0, 786432, 262128, 0, 786432, 196592, 0, 786432, -196621, 0, 786432, -131085, 0, 786432, -65548, 0, 786432, 196595, 0, 786432, -262158, 0, 786432, -262157, 0, 786432, -131084, 0, 786432, -65547, 0, 786432, -11, 0, 786432, 65525, 0, 786432, 131061, 0, 786432, 196597, 0, 786432, 196596, 0, 786432, 262132, 0, 786432, 327667, 0, 786432, 393203, 0, 786432, 393202, 0, 786432, 393201, 0, 786432, 327664, 0, 786432, 131055, 0, 786432, 65519, 0, 786432, -17, 0, 786432, -65552, 0, 786432, -131088, 0, 786432, -262160, 0, 786432, -327694, 0, 786432, -327693, 0, 786432, -262156, 0, 786432, -196620, 0, 786432, 131060, 0, 786432, 262131, 0, 786432, 327666, 0, 786432, -65553, 0, 786432, -131089, 0, 786432, -196625, 0, 786432, -196624, 0, 786432, -262159, 0, 786432, -327695, 0, 786432, 65527, 16, 393216, 65528, 16, 393216, 65529, 16, 393216, 65530, 16, 393216, 65531, 17, 393216, 65531, 18, 393216, 65531, 19, 393216, 65531, 20, 393216, 65530, 21, 393216, 65529, 21, 393216, 1, 16, 393216, 2, 17, 393216, 2, 18, 393216, 2, 19, 393216, 1, 20, 393216, 0, 20, 393216, 65535, 20, 393216, 65534, 19, 393216, 65534, 18, 393216, 65528, 21, 393216, 65527, 21, 393216, 65526, 20, 393216, 65526, 19, 393216, 65526, 17, 393216, 65526, 18, 393216, 65534, 17, 393216, 65535, 16, 393216, 65535, 0, 1245186, 65535, 65535, 1245186, 0, 65535, 1245186, 0, 0, 1245186, 65534, 1, 1245185, 65534, 0, 1245185, 65534, 65535, 1245185, 65534, 65534, 1245185, 1, 65535, 1245185, 1, 0, 1245185, 1, 1, 1245185, 0, 1, 1245185, 65535, 1, 1245185, 2, 1, 1245185, 2, 0, 1245185, 2, 65535, 1245185, 2, 65533, 1245185, 1, 65533, 1245185, 0, 65533, 1245185, 65535, 65533, 1245185, 65533, 65534, 1245185, 65533, 65535, 1179649, 65533, 0, 1179649, 65533, 1, 1179649, 65533, 2, 1179649, 65534, 2, 1179649, 65535, 2, 1179649, 0, 2, 1179649, 1, 2, 1179649, 2, 2, 1179649, 65532, 3, 1179649, 65532, 2, 1179649, 65532, 1, 1179649, 65532, 0, 1179649, 65532, 65535, 1179649, 65532, 65534, 1179649, 65532, 65532, 1179649, 65533, 65532, 1179649, 65534, 65532, 1179649, 65535, 65532, 1179649, 0, 65532, 1179649, 1, 65532, 1179649, 2, 65532, 1179649, 3, 65532, 1179649, 3, 65533, 1179649, 3, 65535, 1179649, 3, 0, 1179649, 3, 1, 1179649, 3, 2, 1179649, 3, 3, 1179649, 2, 3, 1179649, 1, 3, 1179649, 0, 3, 1179649, 65535, 3, 1179649, 65534, 3, 1179649, 65533, 3, 1179649, 65531, 65531, 1179649, 65531, 65532, 1179649, 65531, 65534, 1179649, 65531, 65535, 1179649, 65531, 0, 1179649, 65531, 1, 1179649, 65531, 2, 1179649, 65531, 3, 1179649, 65531, 4, 1179649, 65532, 4, 1179649, 65533, 4, 1179649, 65534, 4, 1179649, 65535, 4, 1179649, 0, 4, 1179649, 1, 4, 1179649, 2, 4, 1179649, 3, 4, 1179649, 4, 4, 1179649, 4, 3, 1179649, 4, 2, 1179649, 4, 1, 1179649, 4, 0, 1179649, 4, 65535, 1179649, 4, 65533, 1179649, 4, 65532, 1179649, 4, 65531, 1179649, 3, 65531, 1179649, 2, 65531, 1179649, 1, 65531, 1179649, 0, 65531, 1179649, 65535, 65531, 1179649, 65534, 65531, 1179649, 65533, 65531, 1179649, 65532, 65531, 1179649, 131069, 3, 1179650, 131070, 3, 1179650, 131071, 3, 1179650, 65536, 3, 1179650, 65537, 3, 1179650, 65538, 3, 1179650, 65539, 2, 1179650, 65539, 1, 1179650, 131068, 1, 1179650, 131068, 2, 1179650, 131066, 4, 3, 131066, 3, 3, 131066, 2, 3, 131066, 1, 3, 131066, 0, 3, 131066, 65535, 3, 131066, 65534, 3, 131066, 65533, 3, 131066, 65532, 3, 131066, 65531, 3, 131066, 65530, 3, 131067, 65530, 3, 131068, 65530, 3, 0, 65530, 1179650, 65535, 65530, 1179650, 131069, 65530, 3, 131070, 65530, 3, 65538, 65530, 3, 65537, 65530, 3, 65539, 65530, 3, 65540, 65530, 3, 65541, 4, 3, 65541, 3, 3, 65541, 2, 3, 65541, 1, 3, 65541, 0, 3, 65541, 65535, 3, 65541, 65534, 3, 65541, 65533, 3, 65541, 65532, 3, 65541, 65531, 3, 65541, 65530, 3, 65541, 5, 3, 65540, 5, 3, 65539, 5, 3, 65538, 5, 3, 65537, 5, 3, 65536, 5, 3, 131071, 5, 3, 131070, 5, 3, 131069, 5, 3, 131068, 5, 3, 131067, 5, 3, 131066, 5, 3, 196602, 5, 3, 262138, 5, 1179651, 196602, 4, 3, 196602, 3, 3, 196602, 2, 3, 196602, 1, 3, 196602, 0, 3, 196602, 65535, 3, 196602, 65534, 3, 196602, 65533, 3, 196602, 65532, 3, 196602, 65531, 3, 196602, 65530, 3, 262138, 65530, 1179651, 262138, 65531, 1179651, 262138, 65532, 1179651, 262138, 65533, 1179651, 262138, 65534, 1179651, 262138, 65535, 1179651, 262138, 0, 1179651, 262138, 1, 1179651, 262138, 2, 1179651, 262138, 3, 1179651, 262138, 4, 1179651, 196613, 5, 3, 196613, 4, 3, 196613, 3, 3, 196613, 2, 3, 196613, 1, 3, 196613, 0, 3, 196613, 65535, 3, 196613, 65534, 3, 196613, 65533, 3, 196613, 65532, 3, 196613, 65531, 3, 196613, 65530, 3, 131077, 65530, 3, 131077, 65531, 3, 131077, 65532, 3, 131077, 65533, 3, 131077, 65534, 3, 131077, 65535, 3, 131077, 0, 3, 131077, 1, 3, 131077, 2, 3, 131077, 3, 3, 131077, 4, 3, 131077, 5, 3, 131076, 5, 3, 131075, 5, 3, 131074, 5, 3, 131073, 5, 3, 131072, 5, 3, 196607, 5, 3, 196606, 5, 3, 196605, 5, 3, 196604, 5, 3, 196603, 5, 3, 262139, 5, 3, 262140, 5, 3, 262141, 5, 3, 262142, 5, 3, 262143, 5, 3, 196608, 5, 3, 196609, 5, 3, 196610, 5, 3, 196611, 5, 3, 196612, 5, 3, 196603, 65530, 3, 196604, 65530, 3, 196605, 65530, 3, 196606, 65530, 3, 131073, 65530, 3, 131074, 65530, 3, 131075, 65530, 3, 131076, 65530, 3, 262139, 65530, 1179651, 262140, 65530, 1179651, 262141, 65530, 1179651, 262142, 65530, 1179651, 196609, 65530, 1179651, 196610, 65530, 1179651, 196611, 65530, 1179651, 196612, 65530, 1179651, 1, 65530, 0, 2, 65530, 0, 3, 65530, 0, 4, 65530, 0, 5, 65530, 0, 5, 65531, 0, 5, 65532, 0, 5, 65533, 0, 5, 65535, 0, 5, 0, 0, 5, 1, 0, 5, 2, 0, 5, 3, 0, 5, 4, 0, 5, 5, 0, 65530, 5, 0, 65531, 5, 0, 65532, 5, 0, 65533, 5, 0, 65534, 5, 0, 65535, 5, 0, 0, 5, 0, 1, 5, 0, 2, 5, 0, 3, 5, 0, 4, 5, 0, 65530, 65530, 0, 65530, 65531, 0, 65530, 65533, 0, 65530, 65534, 0, 65530, 65535, 0, 65530, 0, 0, 65530, 1, 0, 65530, 2, 0, 65530, 3, 0, 65530, 4, 0, 65531, 65530, 0, 65532, 65530, 0, 65533, 65530, 0, 65534, 65530, 0, 5, 65534, 0, 4, 65534, 1179649, 3, 65534, 1179649, 2, 65534, 1245185, 1, 65534, 1245185, 0, 65534, 1245185, 65535, 65534, 1245185, 65534, 65533, 1245185, 65533, 65533, 1245185, 65532, 65533, 1179649, 65531, 65533, 1179649, 65530, 65532, 0) } -metadata/_editor_floor_ = Vector3(0, 0, 0) +metadata/_editor_floor_ = Vector3(0, -32, 0) [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_u27ip") @@ -67,18 +133,14 @@ mesh = SubResource("BoxMesh_lcav8") [node name="CollisionShape3D" type="CollisionShape3D" parent="EndZone/Area3D"] shape = SubResource("BoxShape3D_y4l56") -[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") - [node name="BaseCommand" parent="." instance=ExtResource("5_81jk1")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.76166, 1, -1.59377) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.76166, 1.32179, -1.59377) command_name = "jump" -command_sprite = ExtResource("6_feqb2") +command_sprite = ExtResource("6_g3qnb") + +[node name="BaseCommand2" parent="." instance=ExtResource("5_81jk1")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.70813, 1.32179, -1.59377) +command_name = "jump" +command_sprite = ExtResource("7_qjeey") [connection signal="object_clicked" from="Player" to="." method="_on_player_object_clicked"] diff --git a/Scripts/Player.gd b/Scripts/Player.gd index 4c4eca9..51802ca 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -4,6 +4,10 @@ extends CharacterBody3D @export var mouse_sensitivity : float = 0.003 # TODO: this is sketchy check that its framerate independant pls @export var raycast : RayCast3D +@export var held_object : Node3D +@export var has_object : bool = false +@export var hand : Node3D + signal object_clicked(object : Node3D) const SPEED = 5.0 @@ -31,11 +35,23 @@ func _physics_process(delta): else: Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + # interact with stuff + if Input.is_action_just_pressed("drop"): + drop() + # interact with stuff if Input.is_action_just_pressed("interact"): if "name" in raycast.get_collider(): if "command_name" in raycast.get_collider(): print(raycast.get_collider().command_name) + + #hand.add_child(held_object) + if(!has_object): + held_object = raycast.get_collider() + held_object.reparent(hand) + held_object.position = Vector3(0,0,0) + held_object.freeze = true + has_object = true else: print(raycast.get_collider().name) object_clicked.emit(raycast.get_collider()) @@ -63,3 +79,10 @@ func _input(event): rotate_y(-event.relative.x * mouse_sensitivity) camera.rotate_x(-event.relative.y * mouse_sensitivity) camera.rotation.x = clampf(camera.rotation.x, -deg_to_rad(70), deg_to_rad(70)) + +func drop(): + if has_object: + held_object.reparent(get_tree().get_root()) + held_object.freeze = false + has_object = false + diff --git a/player.tscn b/player.tscn index c3f1098..feb72c0 100644 --- a/player.tscn +++ b/player.tscn @@ -6,11 +6,12 @@ [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_a6eig"] -[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "raycast")] +[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "raycast", "hand")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83982, 0) script = ExtResource("1_tc5d2") camera = NodePath("Camera3D") raycast = NodePath("Camera3D/RayCast3D") +hand = NodePath("Camera3D/hand") [node name="MeshInstance3D2" type="MeshInstance3D" parent="."] mesh = SubResource("CapsuleMesh_5q2rg") @@ -24,5 +25,8 @@ transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, target_position = Vector3(0, -4, 0) collide_with_areas = true +[node name="hand" type="Node3D" parent="Camera3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.930871, -0.621505, -0.929852) + [node name="CollisionShape3D" type="CollisionShape3D" parent="."] shape = SubResource("CapsuleShape3D_a6eig") diff --git a/project.godot b/project.godot index 4eea4d4..087eaaa 100644 --- a/project.godot +++ b/project.godot @@ -52,6 +52,12 @@ interact={ "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":1,"canceled":false,"pressed":false,"double_click":false,"script":null) ] } +drop={ +"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":81,"key_label":0,"unicode":113,"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":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) +] +} [rendering]