Commit f3d9da91 authored by Julia Santos's avatar Julia Santos

Laundry notepad puzzle now requires you turn on the washing machine to...

Laundry notepad puzzle now requires you turn on the washing machine to succeed. Cutscenes now also play after finishing the tutorial quests and after trying to start the lab.
parent 4c0f341d
......@@ -10,7 +10,6 @@ func _ready():
func _input(event): # executes when clicked on
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
print("Clicked")
if tracking:
dialogueBox.text = getDialogue()
......@@ -27,9 +26,10 @@ func getDialogue():
return "Dialogue 4"
3:
sceneProgress = 0
get_parent().hide()
get_parent().queue_free() # dont need that scene anymore
tracking = false
return "Dialogue 1"
func start():
tracking = true
......@@ -43,7 +43,6 @@ __meta__ = {
}
[node name="Scene control" type="StaticBody2D" parent="."]
input_pickable = true
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Scene control"]
......
extends StaticBody2D
onready var sceneProgress = 0
onready var dialogueBox = get_parent().get_node("Dialogue")
onready var tracking = false
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func _input(event): # executes when clicked on
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
if tracking:
dialogueBox.text = getDialogue()
func getDialogue():
match sceneProgress:
0:
sceneProgress += 1
return "Dialogue 2"
1:
sceneProgress += 1
return "Dialogue 3"
2:
sceneProgress += 1
return "Dialogue 4"
3:
sceneProgress = 0
get_parent().queue_free() # dont need that scene anymore
tracking = false
return "Dialogue 1"
func start():
tracking = true
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Cutscenes/Cutscene 2.gd" type="Script" id=1]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 515.38, 299.307 )
[node name="Node2D" type="Node2D"]
[node name="Panel" type="Panel" parent="."]
margin_left = -15.0
margin_top = -13.0
margin_right = 1047.0
margin_bottom = 628.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="."]
margin_left = 101.975
margin_top = 61.2005
margin_right = 238.975
margin_bottom = 143.2
rect_scale = Vector2( 6, 6 )
text = "Cutscene 2"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Dialogue" type="Label" parent="."]
margin_left = 293.916
margin_top = 382.225
margin_right = 430.916
margin_bottom = 464.225
rect_scale = Vector2( 3, 3 )
text = "Dialogue 1"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Scene control" type="StaticBody2D" parent="."]
input_pickable = true
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Scene control"]
position = Vector2( 511.03, 299.848 )
shape = SubResource( 1 )
extends StaticBody2D
onready var sceneProgress = 0
onready var dialogueBox = get_parent().get_node("Dialogue")
onready var tracking = false
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func _input(event): # executes when clicked on
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:
if tracking:
dialogueBox.text = getDialogue()
func getDialogue():
match sceneProgress:
0:
sceneProgress += 1
return "Dialogue 2"
1:
sceneProgress += 1
return "Dialogue 3"
2:
sceneProgress += 1
return "Dialogue 4"
3:
sceneProgress = 0
get_parent().queue_free() # dont need that scene anymore
tracking = false
return "Dialogue 1"
func start():
tracking = true
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Cutscenes/Cutscene 2b.gd" type="Script" id=1]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 515.38, 299.307 )
[node name="Node2D" type="Node2D"]
[node name="Panel" type="Panel" parent="."]
margin_left = -15.0
margin_top = -13.0
margin_right = 1047.0
margin_bottom = 628.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="."]
margin_left = 101.975
margin_top = 61.2005
margin_right = 238.975
margin_bottom = 143.2
rect_scale = Vector2( 6, 6 )
text = "Cutscene 2b"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Dialogue" type="Label" parent="."]
margin_left = 293.916
margin_top = 382.225
margin_right = 430.916
margin_bottom = 464.225
rect_scale = Vector2( 3, 3 )
text = "Dialogue 1"
align = 1
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Scene control" type="StaticBody2D" parent="."]
input_pickable = true
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Scene control"]
position = Vector2( 511.03, 299.848 )
shape = SubResource( 1 )
......@@ -77,9 +77,11 @@ func _groceries_put_away(): # when the groceries are put away
func _eaten(): # completing first "Eat" quest
quests.finishQuest("Eat")
_start_cutscene_2()
func _start_lab(): # trying the lab the first time, adds the new quests
if !quests.hasQuest("Eat") and !quests.hasQuest("Do laundry"):
_start_cutscene_2b()
quests.add("Clean bathroom")
quests.add("Repot plants")
quests.add("Figure out what's making that noise")
......@@ -128,6 +130,15 @@ func _start_cutscene_1():
cutsceneHandler.get_node("1").show()
cutsceneHandler.get_node("1/Scene control").start()
func _start_cutscene_2():
if !quests.hasQuest("Eat") and !quests.hasQuest("Do laundry"):
cutsceneHandler.get_node("2").show()
cutsceneHandler.get_node("2/Scene control").start()
func _start_cutscene_2b():
cutsceneHandler.get_node("2b").show()
cutsceneHandler.get_node("2b/Scene control").start()
# ----------------- Notebook puzzle events -----------------
func getGroceries():
return groceries
......@@ -161,6 +172,7 @@ func _laundry_finished(): # finishing notebook puzzle for laundry
quests.finishQuest("Do laundry")
inventory.remove_item_name("Dirty clothes")
inventory.remove_item_name("Laundry detergent")
_start_cutscene_2()
func _return_laundry_notepad(): # exiting laundry notebook puzzle
zoom_out()
......
......@@ -140,7 +140,7 @@ __meta__ = {
}
[node name="Drawer" type="StaticBody2D" parent="."]
position = Vector2( 476.616, 296.38 )
position = Vector2( 465.504, 296.38 )
scale = Vector2( 0.829244, 0.829244 )
input_pickable = true
script = ExtResource( 5 )
......@@ -174,7 +174,7 @@ __meta__ = {
}
[node name="Soap" type="StaticBody2D" parent="."]
position = Vector2( 422.724, 267.782 )
position = Vector2( 403.675, 269.369 )
scale = Vector2( 0.829244, 0.829244 )
input_pickable = true
script = ExtResource( 5 )
......
[gd_scene load_steps=34 format=2]
[gd_scene load_steps=36 format=2]
[ext_resource path="res://Main rooms/Test room 1.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/189066690_228150108704696_3850052974465333899_n.png" type="Texture" id=2]
......@@ -27,6 +27,8 @@
[ext_resource path="res://Main rooms/Hallway.tscn" type="PackedScene" id=25]
[ext_resource path="res://Special views/Desk.tscn" type="PackedScene" id=26]
[ext_resource path="res://Main rooms/Living room.tscn" type="PackedScene" id=27]
[ext_resource path="res://Cutscenes/Cutscene 2.tscn" type="PackedScene" id=28]
[ext_resource path="res://Cutscenes/Cutscene 2b.tscn" type="PackedScene" id=29]
[sub_resource type="Animation" id=1]
resource_name = "Notepad open"
......@@ -65,7 +67,7 @@ script = ExtResource( 4 )
items = [ NodePath("Pants"), NodePath("Shirt"), NodePath("Sando"), NodePath("Towel"), NodePath("Laundry basket"), NodePath("Laptop"), NodePath("Pile of clothes"), NodePath("Bathroom door"), NodePath("Terrarium") ]
[node name="Sprite" parent="Bedroom/BG/CollisionShape2D" index="0"]
position = Vector2( 9.0239, 16.168 )
position = Vector2( 1.934, -0.980774 )
[node name="Desk" parent="." instance=ExtResource( 26 )]
visible = false
......@@ -96,7 +98,7 @@ items = [ NodePath("Bread"), NodePath("Egg"), NodePath("Granola bar"), NodePath(
[node name="Laundry - Notepad" parent="." instance=ExtResource( 18 )]
visible = false
script = ExtResource( 19 )
items = [ NodePath("Washing machine door"), NodePath("Drawer"), NodePath("Soap"), NodePath("Clothes"), NodePath("Return") ]
items = [ NodePath("Washing machine door"), NodePath("Drawer"), NodePath("Soap"), NodePath("Clothes"), NodePath("Return"), NodePath("Buttons") ]
[node name="Bathroom" parent="." instance=ExtResource( 20 )]
visible = false
......@@ -331,6 +333,12 @@ z_index = 2
[node name="1" parent="Cutscenes" instance=ExtResource( 15 )]
visible = false
[node name="2" parent="Cutscenes" instance=ExtResource( 28 )]
visible = false
[node name="2b" parent="Cutscenes" instance=ExtResource( 29 )]
visible = false
[connection signal="pressed" from="UI/Button" to="UI/Inventory" method="_on_Button_pressed"]
[editable path="Bedroom"]
......
......@@ -13,11 +13,11 @@ func checkWin():
print("Checked win")
if clothes_in and soap and !drawer and !door:
emit_signal("laundry_finished")
print("Should win")
#print("Should win")
return "For my next trick, I will make this pile of laundry disappear! I think that's good for now."
else:
print("Should continue")
return "Closed"
#print("Should continue")
return "I haven't put everything in yet."
func passEvent(handler):
print("Handler laundry passed")
......@@ -38,9 +38,7 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
door = false
if clothes_in:
clothes.hide()
return checkWin()
else:
return checkWin()
return "Closed"
_:
return "That doesn't really make sense."
"Drawer":
......@@ -57,9 +55,7 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
if soap:
get_parent().get_node("Soap/CollisionShape2D/Sprite2").visible = false
get_parent().get_node("Soap/CollisionShape2D/Sprite").visible = true
return checkWin()
else:
return checkWin()
return "Closed"
_:
return "That doesn't really make sense."
"Soap":
......@@ -91,5 +87,9 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
return "I don't have anywhere to put it."
_:
return "That doesn't really make sense."
"Buttons":
match selected:
"Turn on":
return checkWin()
_:
return "That doesn't really make sense."
......@@ -24,10 +24,10 @@ func mouseInteraction():
func objInteraction(selected): # when an object is used on it
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name())
if inventory.get_item_text(selected) == "To do list":
if inventory.get_item_text(selected) == "To do list" and !start: # if they've finished the cutscene and use the To do list
emit_signal("notebook_puzzle")
elif inventory.get_item_text(selected) == "Dirty clothes" or inventory.get_item_text(selected) == "Laundry detergent":
# if they try using the dirty clothes or the laundry detergent when engaging for the first time
elif inventory.get_item_text(selected) == "Dirty clothes" or inventory.get_item_text(selected) == "Laundry detergent" or inventory.get_item_text(selected) == "To do list":
# if they try using the relevant items before watching the cutscene
if start and eventHandler.get_clothes() == 4 and eventHandler.getGroceries(): # play cutscene if it hasnt yet & they have all the clothes
emit_signal("cutscene")
start = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment