splishy splashy

This commit is contained in:
2023-02-07 16:54:29 +01:00
parent dace1fa599
commit 4fb34f2ffc
67 changed files with 1063 additions and 102 deletions
-3
View File
@@ -29,8 +29,5 @@ func message(msg: String, title: String = ""):
func _process(delta):
timer += delta
func _on_bottle_service_child_entered_tree(node):
pass # Replace with function body.
func _on_close_pressed(node):
node.get_parent().queue_free()
+2 -4
View File
@@ -5,16 +5,14 @@ const SIZE = 5
enum Direction {UP, RIGHT, DOWN, LEFT}
var sequence = []
var arrow = preload("res://Images/arrow.png")
func _ready():
randomize()
var arrow = Image.load_from_file("res://Images/arrow.png")
arrow.convert(Image.FORMAT_RG8)
var painting = Image.create(128*SIZE, 128*SIZE, false, Image.FORMAT_RG8)
var painting_em = Image.create(128*SIZE, 128*SIZE, false, Image.FORMAT_RG8)
painting_em.fill(Color.BLACK)
painting.fill(Color.YELLOW_GREEN)
for x in range(SIZE):
for y in range(SIZE):
+1 -2
View File
@@ -14,7 +14,6 @@ var mouse_mode = 2
func _ready():
Input.set_mouse_mode(mouse_mode)
add_collision_exception_with($"../Room/Doorframe/Door")
func _input(event):
if !won:
@@ -52,7 +51,7 @@ func _physics_process(delta):
if $"../WorldEnvironment".environment.background_energy_multiplier > 10.0:
get_tree().quit()
func _on_flash_light_input_event(camera, event, position, normal, shape_idx):
func _on_flash_light_input_event(_camera, event, _position, _normal, _shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Pivot/Camera/FlashLight.visible = true
has_flashlight = true
+5 -5
View File
@@ -22,22 +22,22 @@ func add_sequence_guess(dir):
if sequence[0] == dir:
add_sequence_guess(dir)
func _on_up_input_event(camera, event, position, normal, shape_idx):
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):
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):
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):
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)
func _on_flash_light_input_event(camera, event, position, normal, shape_idx):
func _on_flash_light_input_event(_camera, event, _position, _normal, _shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$FlashLight.visible = false
+1 -1
View File
@@ -12,7 +12,7 @@ func get_number():
10 * $Body/"3"/Cylinder/StaticBody3D.number + \
$Body/"4"/Cylinder/StaticBody3D.number
func _on_static_body_3d_input_event(camera, event, position, normal, shape_idx):
func _on_static_body_3d_input_event(_camera, event, _position, _normal, _shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Body/Knop/Audio.playing = true
if get_number() == combination:
+38
View File
@@ -0,0 +1,38 @@
extends Control
var room = preload("res://Kamer.tscn").instantiate()
var opacity_dragon = 1.0
var opacity_panel = 1.0
var fadeout = false
var start = false
@onready var anim = $Draakje
func _ready():
get_tree().get_root().print_tree()
anim.playing = true
var size = get_viewport_rect().size
anim.position = Vector2(size.x/2, size.y/2)
func _process(delta):
if fadeout:
opacity_dragon -= delta
anim.material.set_shader_parameter("opacity", opacity_dragon)
if opacity_dragon <= 0.25:
if !start:
get_tree().root.add_child(room)
var bg = get_theme_stylebox("panel")
bg.bg_color = Color.BLACK
opacity_panel -= delta * 4
bg.bg_color.a = opacity_panel
print(bg)
if opacity_panel <= 0:
queue_free()
#Recenter draakje
func _on_item_rect_changed():
if anim:
var size = get_viewport_rect().size
anim.position = Vector2(size.x/2, size.y/2)
func _on_draakje_animation_finished():
fadeout = true
+1 -1
View File
@@ -2,7 +2,7 @@ extends StaticBody3D
var number = 0
func _on_input_event(camera, event, position, normal, shape_idx):
func _on_input_event(_camera, event, _position, _normal, _shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$"..".rotate_x(PI/5)
$Audio.playing = true
+3 -8
View File
@@ -1,17 +1,12 @@
extends Node3D
var secret
func _ready():
secret = randi() % 10000
#$".."/CombiCode.mesh.text = "%04d" % combination #met leading 0'en
func _on_static_body_3d_input_event(camera, event, position, normal, shape_idx):
func _on_static_body_3d_input_event(_camera, event, _position, _normal, _shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
print("Laatje!")
$Kast/Drawer.position.z = abs($Kast/Drawer.position.z - 1.0)
func _on_sleutel_input_event(camera, event, position, normal, shape_idx):
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
+6 -10
View File
@@ -2,28 +2,24 @@ extends Node3D
@onready var indirect_light = $"../IndirectLight"
@onready var dakraam = $"../Room/Dakraam"
@onready var light = $"../Light"
var dakraam_glas
func _ready():
if dakraam:
dakraam_glas = $"../Room/Dakraam".get_surface_override_material(0)
func _on_lock_input_event(camera, event, position, normal, shape_idx):
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):
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 + PI
if light != null:
light.visible = !light.visible
indirect_light.visible = !indirect_light.visible
if indirect_light.visible:
dakraam.set_surface_override_material(0, dakraam_glas)
else:
indirect_light.visible = !indirect_light.visible
if indirect_light.visible:
dakraam.set_surface_override_material(0, dakraam_glas)
else:
dakraam.set_surface_override_material(0, null)
dakraam.set_surface_override_material(0, null)
+1 -1
View File
@@ -1,6 +1,6 @@
extends StaticBody3D
func _on_input_event(camera, event, position, normal, shape_idx):
func _on_input_event(_camera, event, _position, _normal, _shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Light.visible = !$Light.visible
$Audio.playing = true
+1 -1
View File
@@ -7,7 +7,7 @@ func switch_fish():
$"Red Herring".visible = $"Red Herring Singing".visible
$"Red Herring Singing".visible = !$"Red Herring Singing".visible
func _on_knop_input_event(camera, event, position, normal, shape_idx):
func _on_knop_input_event(_camera, event, _position, _normal, _shape_idx):
if event is InputEventMouseButton and event.is_action_pressed("interact"):
$Music.playing = !$Music.playing
$"../Muziek".playing = !$Music.playing