adding new commands

This commit is contained in:
Clevertop 2024-08-11 11:05:16 +10:00
parent bfaef2f33f
commit cce3f56caa
5 changed files with 41 additions and 9 deletions

View file

@ -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

View file

@ -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"]

View file

@ -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]

View file

@ -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()

View file

@ -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")