From cce3f56caa9f6b8101217d1e2ae5087e21f87061 Mon Sep 17 00:00:00 2001 From: Clevertop Date: Sun, 11 Aug 2024 11:05:16 +1000 Subject: [PATCH] adding new commands --- Commands/controlled_blink_new.png.import | 13 +++++++------ Levels/StartingRoom.tscn | 9 ++++++++- Scripts/ChronoManager.gd | 3 +++ Scripts/Player.gd | 22 +++++++++++++++++++++- player.tscn | 3 ++- 5 files changed, 41 insertions(+), 9 deletions(-) diff --git a/Commands/controlled_blink_new.png.import b/Commands/controlled_blink_new.png.import index 096a05c..a05d64a 100644 --- a/Commands/controlled_blink_new.png.import +++ b/Commands/controlled_blink_new.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://cmvnccuywukyw" -path="res://.godot/imported/controlled_blink_new.png-ef520718def84896c1c552a01ac129ff.ctex" +path.s3tc="res://.godot/imported/controlled_blink_new.png-ef520718def84896c1c552a01ac129ff.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://Commands/controlled_blink_new.png" -dest_files=["res://.godot/imported/controlled_blink_new.png-ef520718def84896c1c552a01ac129ff.ctex"] +dest_files=["res://.godot/imported/controlled_blink_new.png-ef520718def84896c1c552a01ac129ff.s3tc.ctex"] [params] -compress/mode=0 +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=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ 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 +detect_3d/compress_to=0 diff --git a/Levels/StartingRoom.tscn b/Levels/StartingRoom.tscn index 6204d38..6d7e4e5 100644 --- a/Levels/StartingRoom.tscn +++ b/Levels/StartingRoom.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=29 format=3 uid="uid://bojbawyoy11i4"] +[gd_scene load_steps=30 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"] @@ -11,6 +11,7 @@ [ext_resource type="Texture2D" uid="uid://dd150xco2ee5q" path="res://Assets/Textures/cobalt_stone_4.png" id="7_qjeey"] [ext_resource type="PackedScene" uid="uid://cq4rfdsc5kghr" path="res://Commands/command_pedestal.tscn" id="10_sghta"] [ext_resource type="Texture2D" uid="uid://vc7wwv4wgabf" path="res://Commands/jump.png" id="10_x6wpo"] +[ext_resource type="Texture2D" uid="uid://cmvnccuywukyw" path="res://Commands/controlled_blink_new.png" id="11_oknde"] [ext_resource type="AudioStream" uid="uid://jm6vo1vxrlyx" path="res://Assets/62986__radian__chime-0011.wav" id="12_bm4h4"] [sub_resource type="BoxMesh" id="BoxMesh_21vdj"] @@ -159,6 +160,11 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 1.322, -1.5) command_name = "jump" command_sprite = ExtResource("10_x6wpo") +[node name="JumpCommand5" parent="." instance=ExtResource("5_81jk1")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.5, 1.322, -2.5) +command_name = "phase" +command_sprite = ExtResource("11_oknde") + [node name="Pedestals" type="Node3D" parent="."] [node name="CommandPedestal" parent="Pedestals" instance=ExtResource("10_sghta")] @@ -198,4 +204,5 @@ stream = ExtResource("12_bm4h4") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0) [connection signal="broadcast" from="." to="Player" method="_on_chrono_manager_broadcast"] +[connection signal="tick" from="." to="Player" method="_on_chrono_manager_tick"] [connection signal="object_clicked" from="Player" to="." method="_on_player_object_clicked"] diff --git a/Scripts/ChronoManager.gd b/Scripts/ChronoManager.gd index d5ccdce..e7e659c 100644 --- a/Scripts/ChronoManager.gd +++ b/Scripts/ChronoManager.gd @@ -2,6 +2,7 @@ extends Node3D # this is basically the level manager signal broadcast(command : String) +signal tick(time : int) @export_group("Variables") @export var level_tick : float = 1 # how often to run a command @@ -55,9 +56,11 @@ func _process(delta): current_tick += 1 if current_tick == 11: gui.show_lose_screen("Time Expired", 3) + player.clear_effects() fail_room() pass print("Tick: " + str(current_tick)) + tick.emit(current_tick) for i in pedestals.size(): if i+1 == current_tick: var activated_pedestal = pedestals[i] diff --git a/Scripts/Player.gd b/Scripts/Player.gd index 95d6f78..ef77093 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -7,10 +7,11 @@ extends CharacterBody3D @export var held_object : Node3D @export var has_object : bool = false @export var hand : Node3D +@export var collider : CollisionShape3D signal object_clicked(object : Node3D) -const SPEED = 5.0 +var SPEED = 5.0 const JUMP_VELOCITY = 4.5 # Get the gravity from the project settings to be synced with RigidBody nodes. @@ -105,5 +106,24 @@ func _on_chrono_manager_broadcast(command): match command: "jump": velocity.y = JUMP_VELOCITY + "teleport": + pass + "run": + SPEED = 10 + "phase": + collider.disabled = true _: printerr("bad command sent") + +func clear_effects(): + #enable collider + collider.disabled = false + #end dash + + + SPEED = 5 + pass + + +func _on_chrono_manager_tick(time): + clear_effects() diff --git a/player.tscn b/player.tscn index 15fcab0..aaaaf1a 100644 --- a/player.tscn +++ b/player.tscn @@ -8,12 +8,13 @@ radius = 0.47 height = 1.9 -[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "raycast", "hand")] +[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "raycast", "hand", "collider")] 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") +collider = NodePath("CollisionShape3D") [node name="MeshInstance3D2" type="MeshInstance3D" parent="."] mesh = SubResource("CapsuleMesh_5q2rg")