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(): ...@@ -10,7 +10,6 @@ func _ready():
func _input(event): # executes when clicked on func _input(event): # executes when clicked on
if event is InputEventMouseButton: if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed: if event.button_index == BUTTON_LEFT and event.pressed:
print("Clicked")
if tracking: if tracking:
dialogueBox.text = getDialogue() dialogueBox.text = getDialogue()
...@@ -27,9 +26,10 @@ func getDialogue(): ...@@ -27,9 +26,10 @@ func getDialogue():
return "Dialogue 4" return "Dialogue 4"
3: 3:
sceneProgress = 0 sceneProgress = 0
get_parent().hide() get_parent().queue_free() # dont need that scene anymore
tracking = false tracking = false
return "Dialogue 1" return "Dialogue 1"
func start(): func start():
tracking = true tracking = true
...@@ -43,7 +43,6 @@ __meta__ = { ...@@ -43,7 +43,6 @@ __meta__ = {
} }
[node name="Scene control" type="StaticBody2D" parent="."] [node name="Scene control" type="StaticBody2D" parent="."]
input_pickable = true
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Scene control"] [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 ...@@ -77,9 +77,11 @@ func _groceries_put_away(): # when the groceries are put away
func _eaten(): # completing first "Eat" quest func _eaten(): # completing first "Eat" quest
quests.finishQuest("Eat") quests.finishQuest("Eat")
_start_cutscene_2()
func _start_lab(): # trying the lab the first time, adds the new quests func _start_lab(): # trying the lab the first time, adds the new quests
if !quests.hasQuest("Eat") and !quests.hasQuest("Do laundry"): if !quests.hasQuest("Eat") and !quests.hasQuest("Do laundry"):
_start_cutscene_2b()
quests.add("Clean bathroom") quests.add("Clean bathroom")
quests.add("Repot plants") quests.add("Repot plants")
quests.add("Figure out what's making that noise") quests.add("Figure out what's making that noise")
...@@ -128,6 +130,15 @@ func _start_cutscene_1(): ...@@ -128,6 +130,15 @@ func _start_cutscene_1():
cutsceneHandler.get_node("1").show() cutsceneHandler.get_node("1").show()
cutsceneHandler.get_node("1/Scene control").start() 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 ----------------- # ----------------- Notebook puzzle events -----------------
func getGroceries(): func getGroceries():
return groceries return groceries
...@@ -161,6 +172,7 @@ func _laundry_finished(): # finishing notebook puzzle for laundry ...@@ -161,6 +172,7 @@ func _laundry_finished(): # finishing notebook puzzle for laundry
quests.finishQuest("Do laundry") quests.finishQuest("Do laundry")
inventory.remove_item_name("Dirty clothes") inventory.remove_item_name("Dirty clothes")
inventory.remove_item_name("Laundry detergent") inventory.remove_item_name("Laundry detergent")
_start_cutscene_2()
func _return_laundry_notepad(): # exiting laundry notebook puzzle func _return_laundry_notepad(): # exiting laundry notebook puzzle
zoom_out() zoom_out()
......
...@@ -140,7 +140,7 @@ __meta__ = { ...@@ -140,7 +140,7 @@ __meta__ = {
} }
[node name="Drawer" type="StaticBody2D" parent="."] [node name="Drawer" type="StaticBody2D" parent="."]
position = Vector2( 476.616, 296.38 ) position = Vector2( 465.504, 296.38 )
scale = Vector2( 0.829244, 0.829244 ) scale = Vector2( 0.829244, 0.829244 )
input_pickable = true input_pickable = true
script = ExtResource( 5 ) script = ExtResource( 5 )
...@@ -174,7 +174,7 @@ __meta__ = { ...@@ -174,7 +174,7 @@ __meta__ = {
} }
[node name="Soap" type="StaticBody2D" parent="."] [node name="Soap" type="StaticBody2D" parent="."]
position = Vector2( 422.724, 267.782 ) position = Vector2( 403.675, 269.369 )
scale = Vector2( 0.829244, 0.829244 ) scale = Vector2( 0.829244, 0.829244 )
input_pickable = true input_pickable = true
script = ExtResource( 5 ) 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://Main rooms/Test room 1.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/189066690_228150108704696_3850052974465333899_n.png" type="Texture" id=2] [ext_resource path="res://assets/189066690_228150108704696_3850052974465333899_n.png" type="Texture" id=2]
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
[ext_resource path="res://Main rooms/Hallway.tscn" type="PackedScene" id=25] [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://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://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] [sub_resource type="Animation" id=1]
resource_name = "Notepad open" resource_name = "Notepad open"
...@@ -65,7 +67,7 @@ script = ExtResource( 4 ) ...@@ -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") ] 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"] [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 )] [node name="Desk" parent="." instance=ExtResource( 26 )]
visible = false visible = false
...@@ -96,7 +98,7 @@ items = [ NodePath("Bread"), NodePath("Egg"), NodePath("Granola bar"), NodePath( ...@@ -96,7 +98,7 @@ items = [ NodePath("Bread"), NodePath("Egg"), NodePath("Granola bar"), NodePath(
[node name="Laundry - Notepad" parent="." instance=ExtResource( 18 )] [node name="Laundry - Notepad" parent="." instance=ExtResource( 18 )]
visible = false visible = false
script = ExtResource( 19 ) 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 )] [node name="Bathroom" parent="." instance=ExtResource( 20 )]
visible = false visible = false
...@@ -331,6 +333,12 @@ z_index = 2 ...@@ -331,6 +333,12 @@ z_index = 2
[node name="1" parent="Cutscenes" instance=ExtResource( 15 )] [node name="1" parent="Cutscenes" instance=ExtResource( 15 )]
visible = false 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"] [connection signal="pressed" from="UI/Button" to="UI/Inventory" method="_on_Button_pressed"]
[editable path="Bedroom"] [editable path="Bedroom"]
......
...@@ -13,11 +13,11 @@ func checkWin(): ...@@ -13,11 +13,11 @@ func checkWin():
print("Checked win") print("Checked win")
if clothes_in and soap and !drawer and !door: if clothes_in and soap and !drawer and !door:
emit_signal("laundry_finished") 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." return "For my next trick, I will make this pile of laundry disappear! I think that's good for now."
else: else:
print("Should continue") #print("Should continue")
return "Closed" return "I haven't put everything in yet."
func passEvent(handler): func passEvent(handler):
print("Handler laundry passed") print("Handler laundry passed")
...@@ -38,9 +38,7 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it ...@@ -38,9 +38,7 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
door = false door = false
if clothes_in: if clothes_in:
clothes.hide() clothes.hide()
return checkWin() return "Closed"
else:
return checkWin()
_: _:
return "That doesn't really make sense." return "That doesn't really make sense."
"Drawer": "Drawer":
...@@ -57,9 +55,7 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it ...@@ -57,9 +55,7 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
if soap: if soap:
get_parent().get_node("Soap/CollisionShape2D/Sprite2").visible = false get_parent().get_node("Soap/CollisionShape2D/Sprite2").visible = false
get_parent().get_node("Soap/CollisionShape2D/Sprite").visible = true get_parent().get_node("Soap/CollisionShape2D/Sprite").visible = true
return checkWin() return "Closed"
else:
return checkWin()
_: _:
return "That doesn't really make sense." return "That doesn't really make sense."
"Soap": "Soap":
...@@ -91,5 +87,9 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it ...@@ -91,5 +87,9 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
return "I don't have anywhere to put it." return "I don't have anywhere to put it."
_: _:
return "That doesn't really make sense." 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(): ...@@ -24,10 +24,10 @@ func mouseInteraction():
func objInteraction(selected): # when an object is used on it func objInteraction(selected): # when an object is used on it
var flavor = control.interaction(inventory.get_item_text(selected), self.get_name()) 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") emit_signal("notebook_puzzle")
elif inventory.get_item_text(selected) == "Dirty clothes" or inventory.get_item_text(selected) == "Laundry detergent": 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 dirty clothes or the laundry detergent when engaging for the first time # 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 if start and eventHandler.get_clothes() == 4 and eventHandler.getGroceries(): # play cutscene if it hasnt yet & they have all the clothes
emit_signal("cutscene") emit_signal("cutscene")
start = false 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