levels
This commit is contained in:
parent
22c132ca78
commit
6307a95c25
10 changed files with 156 additions and 20 deletions
|
|
@ -34,6 +34,7 @@ var pedestals : Array[Pedestal]
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
player.area.area_entered.connect(_player_area_entered)
|
||||
var temp_pedestals = pedstalContainer.get_children()
|
||||
for temp in temp_pedestals:
|
||||
pedestals.append(temp)
|
||||
|
|
@ -171,5 +172,9 @@ func _on_player_object_clicked(object):
|
|||
if(object.name == "StartButton"):
|
||||
start_room()
|
||||
|
||||
|
||||
func _player_area_entered(area : Area3D):
|
||||
#print(area.name)
|
||||
if "kill" in area:
|
||||
fail_room()
|
||||
gui.show_lose_screen("Touched a reset block", 2)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ extends CharacterBody3D
|
|||
@export var has_object : bool = false
|
||||
@export var hand : Node3D
|
||||
@export var collider : CollisionShape3D
|
||||
@export var area : Area3D
|
||||
|
||||
signal object_clicked(object : Node3D)
|
||||
|
||||
|
|
@ -155,3 +156,7 @@ func clear_effects():
|
|||
|
||||
func _on_chrono_manager_tick(time):
|
||||
clear_effects()
|
||||
|
||||
|
||||
func _on_area_3d_area_entered(area):
|
||||
pass # Replace with function body.
|
||||
|
|
|
|||
30
Scripts/kill_block.gd
Normal file
30
Scripts/kill_block.gd
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
@tool
|
||||
extends Area3D
|
||||
|
||||
@export var size : Vector3 = Vector3(1,1,1):
|
||||
set(new_size):
|
||||
size = new_size
|
||||
mesh.mesh = mesh.mesh.duplicate()
|
||||
mesh.mesh.size = size
|
||||
collider.shape = collider.shape.duplicate()
|
||||
collider.shape.size = size
|
||||
|
||||
@export var mesh : MeshInstance3D
|
||||
@export var collider : CollisionShape3D
|
||||
var kill = true
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
mesh = $MeshInstance3D
|
||||
collider = $CollisionShape3D
|
||||
mesh.mesh = mesh.mesh.duplicate()
|
||||
mesh.mesh.size = size
|
||||
collider.shape = collider.shape.duplicate()
|
||||
collider.shape.size = size
|
||||
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue