About 'Making a Locked Door Part 3 - Finishing Off Locked Doors'!

In this video (objectives)…

1 Have the Locked Door open when the combination is Correct 2 Add sounds to our numberpad

After watching (learning outcomes)…

Make locked doors fully functional and polished!

(Unique Video Reference: 21_HM_GDT)

We would love to know…

  • What you found good about this lecture?
  • What we could do better?

Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…

  • Be in the correct forum (for the course).
  • Be in the right sub-forum (for the section)
  • Have the correct lecture tag.

Enjoy your stay in our thriving community!

Put some instructions and forced the player to press the OK button to continue.

func check_number_pad_guess(button_text):
	if guess == combination and button_text == "OK":
		$AudioStreamPlayer.stream = load("res://SFX/threeTone1.ogg")
		$AudioStreamPlayer.play()	
		light.texture = load(Global.green_light)
		$Timer.start()
	else:
		reset_lock()

func number_pad_selection(button_int):
	$AudioStreamPlayer.stream = load("res://SFX/twoTone1.ogg")
	$AudioStreamPlayer.play()	
	guess.append(button_int)
	update_display()


func reset_lock():
	light.texture = load(Global.red_light)
	display.clear()
	display.bbcode_text = "[center]" + "Enter Code" + "[/center]"
	guess.clear()


func update_display():
	display.bbcode_text = "[center]" + PoolStringArray(guess).join("") + "[/center]"
	if guess.size() == combination.size():
		display.bbcode_text = "[center]" + "Press OK" + "[/center]"


func _on_Timer_timeout():
	emit_signal("combination_correct")
	hide()
	reset_lock()
2 Likes

Privacy & Terms