This commit is contained in:
Clevertop 2024-08-14 00:45:21 +10:00
parent 22c132ca78
commit 6307a95c25
10 changed files with 156 additions and 20 deletions

View file

@ -0,0 +1,7 @@
[gd_resource type="StandardMaterial3D" format=3 uid="uid://br3erknm4b1i0"]
[resource]
transparency = 1
albedo_color = Color(1, 0, 0, 0.67451)
rim_enabled = true
grow_amount = 0.14

View file

@ -23,22 +23,20 @@ data = {
[node name="EndZone" parent="." instance=ExtResource("3_okds4")] [node name="EndZone" parent="." instance=ExtResource("3_okds4")]
transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 9) transform = Transform3D(2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 9)
[node name="BaseCommand" parent="." instance=ExtResource("4_fhho5")] [node name="BaseCommand2" parent="." instance=ExtResource("4_fhho5")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.5, 1.5, -3)
command_name = "dash"
command_sprite = ExtResource("5_gb44l")
[node name="BaseCommand2" parent="." node_paths=PackedStringArray("collider") instance=ExtResource("4_fhho5")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 1.5, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 1.5, 0)
command_name = "dash" command_name = "dash"
command_sprite = ExtResource("5_gb44l") command_sprite = ExtResource("5_gb44l")
collider = NodePath("../BaseCommand/CollisionShape3D3")
[node name="BaseCommand3" parent="." node_paths=PackedStringArray("collider") instance=ExtResource("4_fhho5")] [node name="BaseCommand4" parent="." instance=ExtResource("4_fhho5")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.7692, 1.5, -2.27183)
command_name = "dash"
command_sprite = ExtResource("5_gb44l")
[node name="BaseCommand3" parent="." instance=ExtResource("4_fhho5")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1.5, 2.5) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1.5, 2.5)
command_name = "dash" command_name = "dash"
command_sprite = ExtResource("5_gb44l") command_sprite = ExtResource("5_gb44l")
collider = NodePath("../BaseCommand/CollisionShape3D3")
[node name="Sign" parent="." instance=ExtResource("6_03rde")] [node name="Sign" parent="." instance=ExtResource("6_03rde")]
transform = Transform3D(0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 3.64511, 1.6988, 3.67351) transform = Transform3D(0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, 3.64511, 1.6988, 3.67351)

View file

@ -34,21 +34,22 @@ sign_text = "Now you have
both kinds!" both kinds!"
show_pole = true show_pole = true
[node name="BaseCommand" parent="." instance=ExtResource("5_e13ui")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.18242, 2.66601, -2.91549)
command_name = "jump"
command_sprite = ExtResource("6_jhyls")
[node name="BaseCommand2" parent="." node_paths=PackedStringArray("collider") instance=ExtResource("5_e13ui")] [node name="BaseCommand2" parent="." node_paths=PackedStringArray("collider") instance=ExtResource("5_e13ui")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.58846, 2.66601, -2.91549) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.58846, 2.66601, -2.91549)
command_name = "dash" command_name = "dash"
command_sprite = ExtResource("7_7jmwn") command_sprite = ExtResource("7_7jmwn")
collider = NodePath("../BaseCommand/CollisionShape3D3") collider = NodePath("")
[node name="BaseCommand4" parent="." node_paths=PackedStringArray("collider") instance=ExtResource("5_e13ui")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.20865, 2.66601, -2.68806)
command_name = "jump"
command_sprite = ExtResource("6_jhyls")
collider = NodePath("")
[node name="BaseCommand3" parent="." node_paths=PackedStringArray("collider") instance=ExtResource("5_e13ui")] [node name="BaseCommand3" parent="." node_paths=PackedStringArray("collider") instance=ExtResource("5_e13ui")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.87202, 3.23129, -2.91549) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.87202, 3.23129, -2.91549)
command_name = "dash" command_name = "dash"
command_sprite = ExtResource("7_7jmwn") command_sprite = ExtResource("7_7jmwn")
collider = NodePath("../BaseCommand/CollisionShape3D3") collider = NodePath("")
[editable path="ChronoManager"] [editable path="ChronoManager"]

File diff suppressed because one or more lines are too long

60
Levels/Level 8.tscn Normal file

File diff suppressed because one or more lines are too long

View file

@ -34,6 +34,7 @@ var pedestals : Array[Pedestal]
# 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():
player.area.area_entered.connect(_player_area_entered)
var temp_pedestals = pedstalContainer.get_children() var temp_pedestals = pedstalContainer.get_children()
for temp in temp_pedestals: for temp in temp_pedestals:
pedestals.append(temp) pedestals.append(temp)
@ -171,5 +172,9 @@ func _on_player_object_clicked(object):
if(object.name == "StartButton"): if(object.name == "StartButton"):
start_room() 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)

View file

@ -8,6 +8,7 @@ extends CharacterBody3D
@export var has_object : bool = false @export var has_object : bool = false
@export var hand : Node3D @export var hand : Node3D
@export var collider : CollisionShape3D @export var collider : CollisionShape3D
@export var area : Area3D
signal object_clicked(object : Node3D) signal object_clicked(object : Node3D)
@ -155,3 +156,7 @@ func clear_effects():
func _on_chrono_manager_tick(time): func _on_chrono_manager_tick(time):
clear_effects() clear_effects()
func _on_area_3d_area_entered(area):
pass # Replace with function body.

30
Scripts/kill_block.gd Normal file
View 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

20
kill_block.tscn Normal file
View file

@ -0,0 +1,20 @@
[gd_scene load_steps=5 format=3 uid="uid://vj1tnhm3726q"]
[ext_resource type="Material" uid="uid://br3erknm4b1i0" path="res://Assets/Materials/kill.tres" id="1_2ed3b"]
[ext_resource type="Script" path="res://Scripts/kill_block.gd" id="1_pvkd4"]
[sub_resource type="BoxMesh" id="BoxMesh_j8om8"]
material = ExtResource("1_2ed3b")
[sub_resource type="BoxShape3D" id="BoxShape3D_j8noh"]
[node name="KillBlock" type="Area3D" node_paths=PackedStringArray("mesh", "collider")]
script = ExtResource("1_pvkd4")
mesh = NodePath("MeshInstance3D")
collider = NodePath("CollisionShape3D")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("BoxMesh_j8om8")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("BoxShape3D_j8noh")

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=4 format=3 uid="uid://d34smep2ukq7w"] [gd_scene load_steps=5 format=3 uid="uid://d34smep2ukq7w"]
[ext_resource type="Script" path="res://Scripts/Player.gd" id="1_tc5d2"] [ext_resource type="Script" path="res://Scripts/Player.gd" id="1_tc5d2"]
@ -8,13 +8,18 @@
radius = 0.47 radius = 0.47
height = 1.9 height = 1.9
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "raycast", "hand", "collider", "dash_node")] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cfrhy"]
radius = 0.47
height = 1.9
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("camera", "raycast", "hand", "collider", "area", "dash_node")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83982, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83982, 0)
script = ExtResource("1_tc5d2") script = ExtResource("1_tc5d2")
camera = NodePath("Camera3D") camera = NodePath("Camera3D")
raycast = NodePath("Camera3D/RayCast3D") raycast = NodePath("Camera3D/RayCast3D")
hand = NodePath("Camera3D/hand") hand = NodePath("Camera3D/hand")
collider = NodePath("CollisionShape3D") collider = NodePath("CollisionShape3D")
area = NodePath("Area3D")
dash_node = NodePath("Camera3D/DashDirection") dash_node = NodePath("Camera3D/DashDirection")
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."] [node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
@ -37,3 +42,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.0093)
[node name="CollisionShape3D" type="CollisionShape3D" parent="."] [node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("CapsuleShape3D_a6eig") shape = SubResource("CapsuleShape3D_a6eig")
[node name="Area3D" type="Area3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("CapsuleShape3D_cfrhy")