pedestals light up
This commit is contained in:
parent
4a564dc3f5
commit
220ca2886f
5 changed files with 44 additions and 5 deletions
|
|
@ -4,10 +4,12 @@ class_name Pedestal
|
||||||
@export var placed_command : Node3D
|
@export var placed_command : Node3D
|
||||||
@export var has_command : bool = false
|
@export var has_command : bool = false
|
||||||
@export var slot : Node3D
|
@export var slot : Node3D
|
||||||
|
@export var mesh :MeshInstance3D
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
|
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,11 @@ size = Vector3(0.8, 1, 0.8)
|
||||||
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_8evcs"]
|
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_8evcs"]
|
||||||
data = PackedVector3Array(-0.4, 0.5, 0.4, 0.4, 0.5, 0.4, -0.4, -0.5, 0.4, 0.4, 0.5, 0.4, 0.4, -0.5, 0.4, -0.4, -0.5, 0.4, 0.4, 0.5, -0.4, -0.4, 0.5, -0.4, 0.4, -0.5, -0.4, -0.4, 0.5, -0.4, -0.4, -0.5, -0.4, 0.4, -0.5, -0.4, 0.4, 0.5, 0.4, 0.4, 0.5, -0.4, 0.4, -0.5, 0.4, 0.4, 0.5, -0.4, 0.4, -0.5, -0.4, 0.4, -0.5, 0.4, -0.4, 0.5, -0.4, -0.4, 0.5, 0.4, -0.4, -0.5, -0.4, -0.4, 0.5, 0.4, -0.4, -0.5, 0.4, -0.4, -0.5, -0.4, 0.4, 0.5, 0.4, -0.4, 0.5, 0.4, 0.4, 0.5, -0.4, -0.4, 0.5, 0.4, -0.4, 0.5, -0.4, 0.4, 0.5, -0.4, -0.4, -0.5, 0.4, 0.4, -0.5, 0.4, -0.4, -0.5, -0.4, 0.4, -0.5, 0.4, 0.4, -0.5, -0.4, -0.4, -0.5, -0.4)
|
data = PackedVector3Array(-0.4, 0.5, 0.4, 0.4, 0.5, 0.4, -0.4, -0.5, 0.4, 0.4, 0.5, 0.4, 0.4, -0.5, 0.4, -0.4, -0.5, 0.4, 0.4, 0.5, -0.4, -0.4, 0.5, -0.4, 0.4, -0.5, -0.4, -0.4, 0.5, -0.4, -0.4, -0.5, -0.4, 0.4, -0.5, -0.4, 0.4, 0.5, 0.4, 0.4, 0.5, -0.4, 0.4, -0.5, 0.4, 0.4, 0.5, -0.4, 0.4, -0.5, -0.4, 0.4, -0.5, 0.4, -0.4, 0.5, -0.4, -0.4, 0.5, 0.4, -0.4, -0.5, -0.4, -0.4, 0.5, 0.4, -0.4, -0.5, 0.4, -0.4, -0.5, -0.4, 0.4, 0.5, 0.4, -0.4, 0.5, 0.4, 0.4, 0.5, -0.4, -0.4, 0.5, 0.4, -0.4, 0.5, -0.4, 0.4, 0.5, -0.4, -0.4, -0.5, 0.4, 0.4, -0.5, 0.4, -0.4, -0.5, -0.4, 0.4, -0.5, 0.4, 0.4, -0.5, -0.4, -0.4, -0.5, -0.4)
|
||||||
|
|
||||||
[node name="CommandPedestal" type="StaticBody3D" node_paths=PackedStringArray("slot")]
|
[node name="CommandPedestal" type="StaticBody3D" node_paths=PackedStringArray("slot", "mesh")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||||
script = ExtResource("1_02nqv")
|
script = ExtResource("1_02nqv")
|
||||||
slot = NodePath("slot")
|
slot = NodePath("slot")
|
||||||
|
mesh = NodePath("MeshInstance3D")
|
||||||
|
|
||||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||||
mesh = SubResource("BoxMesh_hrk6g")
|
mesh = SubResource("BoxMesh_hrk6g")
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
[gd_scene load_steps=27 format=3 uid="uid://bojbawyoy11i4"]
|
[gd_scene load_steps=28 format=3 uid="uid://bojbawyoy11i4"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Scripts/ChronoManager.gd" id="1_5b2rd"]
|
[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="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://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="PackedScene" uid="uid://bnlexkofp68gv" path="res://gui.tscn" id="3_60lfp"]
|
||||||
|
[ext_resource type="Material" uid="uid://didvwdmm46bmq" path="res://Assets/Materials/green_floor.tres" id="3_mnhg8"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c1fesrqdpjloa" path="res://Assets/Textures/ice_0_old.png" id="4_v03h0"]
|
[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="PackedScene" uid="uid://dqvq4ybcpws87" path="res://Commands/command_block.tscn" id="5_81jk1"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dc23iehev1s8w" path="res://Assets/Textures/crystal_wall_2.png" id="6_g3qnb"]
|
[ext_resource type="Texture2D" uid="uid://dc23iehev1s8w" path="res://Assets/Textures/crystal_wall_2.png" id="6_g3qnb"]
|
||||||
|
|
@ -107,6 +108,8 @@ material = SubResource("StandardMaterial3D_itc1d")
|
||||||
|
|
||||||
[node name="ChronoManager" type="Node3D" node_paths=PackedStringArray("gui", "pedestals")]
|
[node name="ChronoManager" type="Node3D" node_paths=PackedStringArray("gui", "pedestals")]
|
||||||
script = ExtResource("1_5b2rd")
|
script = ExtResource("1_5b2rd")
|
||||||
|
pedestal_off_mat = ExtResource("2_0aj3l")
|
||||||
|
pedestal_on_mat = ExtResource("3_mnhg8")
|
||||||
gui = NodePath("Gui")
|
gui = NodePath("Gui")
|
||||||
pedestals = [NodePath("Pedestals/CommandPedestal"), NodePath("Pedestals/CommandPedestal2"), NodePath("Pedestals/CommandPedestal3"), NodePath("Pedestals/CommandPedestal4"), NodePath("Pedestals/CommandPedestal5"), NodePath("Pedestals/CommandPedestal6"), NodePath("Pedestals/CommandPedestal7"), NodePath("Pedestals/CommandPedestal8"), NodePath("Pedestals/CommandPedestal9"), NodePath("Pedestals/CommandPedestal10")]
|
pedestals = [NodePath("Pedestals/CommandPedestal"), NodePath("Pedestals/CommandPedestal2"), NodePath("Pedestals/CommandPedestal3"), NodePath("Pedestals/CommandPedestal4"), NodePath("Pedestals/CommandPedestal5"), NodePath("Pedestals/CommandPedestal6"), NodePath("Pedestals/CommandPedestal7"), NodePath("Pedestals/CommandPedestal8"), NodePath("Pedestals/CommandPedestal9"), NodePath("Pedestals/CommandPedestal10")]
|
||||||
|
|
||||||
|
|
@ -148,10 +151,10 @@ command_sprite = ExtResource("7_qjeey")
|
||||||
[node name="Pedestals" type="Node3D" parent="."]
|
[node name="Pedestals" type="Node3D" parent="."]
|
||||||
|
|
||||||
[node name="CommandPedestal" parent="Pedestals" instance=ExtResource("10_sghta")]
|
[node name="CommandPedestal" parent="Pedestals" instance=ExtResource("10_sghta")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5, 1, 2.5)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5, 1, 1.5)
|
||||||
|
|
||||||
[node name="CommandPedestal2" parent="Pedestals" instance=ExtResource("10_sghta")]
|
[node name="CommandPedestal2" parent="Pedestals" instance=ExtResource("10_sghta")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5, 1, 1.5)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5, 1, 2.5)
|
||||||
|
|
||||||
[node name="CommandPedestal3" parent="Pedestals" instance=ExtResource("10_sghta")]
|
[node name="CommandPedestal3" parent="Pedestals" instance=ExtResource("10_sghta")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 1, 3.5)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 1, 3.5)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,11 @@ signal broadcast(command : String)
|
||||||
@export_group("Variables")
|
@export_group("Variables")
|
||||||
@export var level_tick : float = 1 # how often to run a command
|
@export var level_tick : float = 1 # how often to run a command
|
||||||
@export var level_time : float = 10 # the amoutn of time allowed for the level
|
@export var level_time : float = 10 # the amoutn of time allowed for the level
|
||||||
|
var tick_timer : float = 0
|
||||||
|
var room_started : bool = false
|
||||||
|
var current_tick = 0
|
||||||
|
@export var pedestal_off_mat : Material
|
||||||
|
@export var pedestal_on_mat : Material
|
||||||
|
|
||||||
@export_group("Node References")
|
@export_group("Node References")
|
||||||
@export var gui : Control
|
@export var gui : Control
|
||||||
|
|
@ -14,16 +18,37 @@ signal broadcast(command : String)
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready():
|
func _ready():
|
||||||
|
for i in pedestals.size():
|
||||||
|
pedestals[i].mesh.mesh = pedestals[i].mesh.mesh.duplicate()
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
|
if Input.is_action_just_pressed("debug_start"):
|
||||||
|
start_room()
|
||||||
|
|
||||||
|
if room_started and current_tick < level_time:
|
||||||
|
tick_timer += delta
|
||||||
|
|
||||||
|
if tick_timer > level_tick:
|
||||||
|
tick_timer = 0
|
||||||
|
current_tick += 1
|
||||||
|
print("Tick: " + str(current_tick))
|
||||||
|
for i in pedestals.size():
|
||||||
|
if i+1 == current_tick:
|
||||||
|
pedestals[i].mesh.mesh.material = pedestal_on_mat
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
#pedestals[i].mesh.material
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func start_room():
|
func start_room():
|
||||||
|
print("START")
|
||||||
|
room_started = true
|
||||||
|
|
||||||
# open door
|
# open door
|
||||||
# start timers
|
# start timers
|
||||||
# start running commands
|
# start running commands
|
||||||
|
|
@ -32,6 +57,9 @@ func start_room():
|
||||||
|
|
||||||
func reset_room():
|
func reset_room():
|
||||||
# run if timer expires, resets puzzle
|
# run if timer expires, resets puzzle
|
||||||
|
# replace door
|
||||||
|
# put player back in start room
|
||||||
|
# reset timers
|
||||||
pass
|
pass
|
||||||
|
|
||||||
func finish_room():
|
func finish_room():
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,11 @@ drop={
|
||||||
, 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)
|
, 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)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
debug_start={
|
||||||
|
"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":49,"key_label":0,"unicode":49,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue