safe from sequence

This commit is contained in:
2023-01-31 16:40:46 +01:00
parent 2f6967084e
commit 61a732a698
8 changed files with 144 additions and 18 deletions
Binary file not shown.
+30
View File
@@ -0,0 +1,30 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://c37oos73shmdm"
path="res://.godot/imported/safe.glb-3bdd72b210b12d39e6232525a0589a4e.scn"
[deps]
source_file="res://Objects/Meshes/safe.glb"
dest_files=["res://.godot/imported/safe.glb-3bdd72b210b12d39e6232525a0589a4e.scn"]
[params]
nodes/root_type="Node3D"
nodes/root_name="Scene Root"
nodes/apply_root_scale=true
nodes/root_scale=1.0
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
import_script/path=""
_subresources={}
+14 -14
View File
File diff suppressed because one or more lines are too long
+44
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=3]
[gd_scene load_steps=9 format=3 uid="uid://bm3d233ul4asx"]
[ext_resource type="PackedScene" path="res://Objects/combi.tscn" id="1_7rjc3"]
[ext_resource type="Script" path="res://Scripts/Slot.gd" id="1_ksddl"]
+6 -2
View File
@@ -1,11 +1,12 @@
[gd_scene load_steps=15 format=3 uid="uid://bybgy8p6uvnxy"]
[gd_scene load_steps=16 format=3 uid="uid://bybgy8p6uvnxy"]
[ext_resource type="PackedScene" path="res://Player.tscn" id="1_pmt73"]
[ext_resource type="Script" path="res://Scripts/lichtknop.gd" id="2_gwtwo"]
[ext_resource type="AudioStream" uid="uid://dr8lncxad2pwm" path="res://Audio/click.wav" id="3_e26r5"]
[ext_resource type="PackedScene" path="res://Objects/Slot.tscn" id="4_kvwvq"]
[ext_resource type="PackedScene" uid="uid://bm3d233ul4asx" path="res://Objects/Slot.tscn" id="4_kvwvq"]
[ext_resource type="PackedScene" uid="uid://cpjo05ataob66" path="res://Objects/Painting.tscn" id="5_glq61"]
[ext_resource type="PackedScene" path="res://Objects/tekst.tscn" id="6_5og8x"]
[ext_resource type="PackedScene" uid="uid://2wem3a0y4agb" path="res://Objects/Safe.tscn" id="7_kfu4q"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_rahav"]
@@ -89,4 +90,7 @@ transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 1.98,
[node name="tekst" parent="." instance=ExtResource("6_5og8x")]
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, -0.182896, 0.257219, 0.0577565)
[node name="safe" parent="." instance=ExtResource("7_kfu4q")]
transform = Transform3D(0.3, 0, 0, 0, 0.3, 0, 0, 0, 0.3, -1.66055, 1.15536, -0.729811)
[connection signal="input_event" from="Lichtknopje" to="Lichtknopje" method="_on_input_event"]
+1 -1
View File
@@ -1,7 +1,7 @@
@tool
extends Node3D
const SIZE = 5
const SIZE = 3
enum Direction {UP, RIGHT, DOWN, LEFT}
var sequence = []
+48
View File
@@ -0,0 +1,48 @@
extends Node3D
var sequence
var sequence_guess = []
var i = 0
func _ready():
sequence = $".."/Painting.sequence
var bmat = StandardMaterial3D.new()
bmat.emission_enabled = true
bmat.albedo_color = Color.LIGHT_SLATE_GRAY
bmat.emission = Color.LIGHT_BLUE
$ButtonUp.set_surface_override_material(0, bmat)
$ButtonLeft.set_surface_override_material(0, bmat)
$ButtonDown.set_surface_override_material(0, bmat)
$ButtonRight.set_surface_override_material(0, bmat)
func add_sequence_guess(dir):
if sequence[i] == dir:
print(".")
i += 1
if (i == sequence.size()):
print("yay")
$Door.visible = false
$ButtonUp.visible = false
$ButtonDown.visible = false
$ButtonLeft.visible = false
$ButtonRight.visible = false
i = 0
else:
print("x")
i = 0
func _on_up_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
add_sequence_guess(0)
func _on_left_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
add_sequence_guess(3)
func _on_down_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
add_sequence_guess(2)
func _on_right_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
add_sequence_guess(1)