ander lichtkastje. sleutel in de la

This commit is contained in:
2023-02-02 22:32:36 +01:00
parent 504e9501fa
commit 46897a2742
11 changed files with 211 additions and 37 deletions
+1
View File
@@ -4,6 +4,7 @@ extends CharacterBody3D
const WALK_SPEED = 5.0
const MOUSE_SENS = 0.002
var has_flashlight = false
var has_key = false
var mouse_mode = 2
+6
View File
@@ -9,3 +9,9 @@ func _ready():
func _on_static_body_3d_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Kast/Drawer.position.z = abs($Kast/Drawer.position.z - 1.0)
func _on_sleutel_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Kast/Drawer/Sleutel.visible = false
get_node("../Player").has_key = true
+24
View File
@@ -0,0 +1,24 @@
extends Node3D
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_lock_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
if get_node("../Player").has_key:
$Deur.visible = false
$Lock.visible = false
func _on_lever_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Lever.rotation.z = $Lever.rotation.z + 180
$".."/Light.visible = !$".."/Light.visible