summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Andrade de Almeida <vct.a.almeida@gmail.com>2022-07-17 03:56:24 -0300
committerVictor Andrade de Almeida <vct.a.almeida@gmail.com>2022-07-17 03:56:24 -0300
commite5a6000694f2f27d3eac1c77b79dfd792bd9f14e (patch)
treee3c26f0fee9ebb27fe5808f6ec81b992c9d2f4bc
parent6843ddb6d5f2fb0702b0031c6a830d11b812d31d (diff)
downloadgamejam-gmtk-2022-e5a6000694f2f27d3eac1c77b79dfd792bd9f14e.tar.gz
gamejam-gmtk-2022-e5a6000694f2f27d3eac1c77b79dfd792bd9f14e.tar.bz2
gamejam-gmtk-2022-e5a6000694f2f27d3eac1c77b79dfd792bd9f14e.zip
Improve key pressure plate
-rw-r--r--Scenes/PlateKey.gd5
-rw-r--r--Scenes/PlateKey.tscn6
2 files changed, 9 insertions, 2 deletions
diff --git a/Scenes/PlateKey.gd b/Scenes/PlateKey.gd
index 1342469..aa3bb8b 100644
--- a/Scenes/PlateKey.gd
+++ b/Scenes/PlateKey.gd
@@ -1,13 +1,18 @@
extends Plate
export(NodePath) var crystal_path
+export(Color) var active_color
onready var crystal : Crystal = get_node(crystal_path) setget set_crystal
+onready var mesh : MeshInstance = $Mesh
func activate(entity : Entity, dungeon):
if crystal == null or crystal.is_active:
return
+ var material = mesh.get_active_material(0)
+ material.albedo_color = active_color
+
crystal.add_action("cor_activate", [0.2])
func set_crystal(value : Crystal):
diff --git a/Scenes/PlateKey.tscn b/Scenes/PlateKey.tscn
index 14c3fbc..53b56c8 100644
--- a/Scenes/PlateKey.tscn
+++ b/Scenes/PlateKey.tscn
@@ -3,14 +3,16 @@
[ext_resource path="res://Scenes/PlateKey.gd" type="Script" id=1]
[sub_resource type="CubeMesh" id=1]
-size = Vector3( 0.9, 0.05, 0.9 )
+size = Vector3( 1, 0.05, 1 )
[sub_resource type="SpatialMaterial" id=2]
-albedo_color = Color( 0.34902, 0.541176, 0.835294, 1 )
+resource_local_to_scene = true
+albedo_color = Color( 0.231373, 0.654902, 0.839216, 1 )
[node name="PlateKey" type="Spatial"]
script = ExtResource( 1 )
valid_symbols = [ "1", "2", "3" ]
+active_color = Color( 0.290196, 0.415686, 0.572549, 1 )
[node name="Mesh" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.025, 0 )