Commit 91ad8a6d authored by Julia Santos's avatar Julia Santos

Added locations to mouse click data, gave clothes in the washing machine its own sprite

parent a542aa18
source_md5="71912893fb8c52be09783ee1236c2662"
dest_md5="cad6fd80931226e62062cb1c7a83a15a"
...@@ -134,7 +134,7 @@ func _clean(toolUsed): # adds to the number of items that have been cleaned, and ...@@ -134,7 +134,7 @@ func _clean(toolUsed): # adds to the number of items that have been cleaned, and
if cleaningMaterials == 3: # if the cleaning materials have cleaned 3 objects (sink, mirror, and floor), remove it if cleaningMaterials == 3: # if the cleaning materials have cleaned 3 objects (sink, mirror, and floor), remove it
inventory.remove_item_name("Cleaning mat") inventory.remove_item_name("Cleaning mat")
if bathroomClean == 5: # if it's done, finish the quest if bathroomClean == 5: # if it's done, finish the quest
quests.finishQuest("Clean bathroom") quests.finishQuest("Clean bathroom and take out trash")
func getClean(): # returns the number of objects that have been cleaned func getClean(): # returns the number of objects that have been cleaned
return bathroomClean return bathroomClean
...@@ -161,7 +161,7 @@ func _balcony_outer_lock(): ...@@ -161,7 +161,7 @@ func _balcony_outer_lock():
movementHandle.setRoom(3) movementHandle.setRoom(3)
movementHandle.disableMovement() movementHandle.disableMovement()
movementHandle.getRoomPosition("Balcony") movementHandle.getRoomPosition("Balcony")
if !quests.hasQuest("Clean bathroom"): if !quests.hasQuest("Clean bathroom and take out trash"):
inventory.remove_item_name("Plunger") inventory.remove_item_name("Plunger")
plungerUsed = true plungerUsed = true
...@@ -188,7 +188,7 @@ func _start_cutscene_2(): ...@@ -188,7 +188,7 @@ func _start_cutscene_2():
cutsceneHandler.get_node("2").show() cutsceneHandler.get_node("2").show()
cutsceneHandler.get_node("2/Scene control").start() cutsceneHandler.get_node("2/Scene control").start()
# adding quests and shifting to next phase # adding quests and shifting to next phase
quests.add("Clean bathroom") quests.add("Clean bathroom and take out trash")
quests.add("Figure out what's making that noise & get rid of it") quests.add("Figure out what's making that noise & get rid of it")
quests.add("Feed Banana") quests.add("Feed Banana")
quests.add("Repot plants") quests.add("Repot plants")
...@@ -401,7 +401,7 @@ func zoom_out(): # for returning from close up perspectives ...@@ -401,7 +401,7 @@ func zoom_out(): # for returning from close up perspectives
#get_parent().get_node("UI/Movement Handler").check_arrows() # show arrows depending on situation #get_parent().get_node("UI/Movement Handler").check_arrows() # show arrows depending on situation
movementHandle.enableMovement() movementHandle.enableMovement()
deselect.show() deselect.show()
movementHandle.checkRoom() #movementHandle.checkRoom()
inventory.unselect_all() inventory.unselect_all()
func _laundry_basket(): # looking at the laundry basket view func _laundry_basket(): # looking at the laundry basket view
......
...@@ -57,6 +57,7 @@ func storeClick(method): # stores the mouse click data to data.save ...@@ -57,6 +57,7 @@ func storeClick(method): # stores the mouse click data to data.save
var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]" var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]"
if !save_data.file_exists("user://data.save"): if !save_data.file_exists("user://data.save"):
save_data.open("user://data.save",File.WRITE) save_data.open("user://data.save",File.WRITE)
save_data.store_string("FILE START\n")
save_data.store_string(": " + method + " " + get_name() + " " + timestamp) save_data.store_string(": " + method + " " + get_name() + " " + timestamp)
print("Created file") print("Created file")
else: else:
...@@ -72,6 +73,7 @@ func storeInt(selected): # specifically for using one item on another, stores mo ...@@ -72,6 +73,7 @@ func storeInt(selected): # specifically for using one item on another, stores mo
var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]" var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]"
if !save_data.file_exists("user://data.save"): if !save_data.file_exists("user://data.save"):
save_data.open("user://data.save",File.WRITE) save_data.open("user://data.save",File.WRITE)
save_data.store_string("FILE START\n")
save_data.store_string(": Used " + inventory.get_item_text(selected) + " -> " + get_name()) save_data.store_string(": Used " + inventory.get_item_text(selected) + " -> " + get_name())
print("Created file") print("Created file")
else: else:
......
[gd_scene load_steps=22 format=2] [gd_scene load_steps=23 format=2]
[ext_resource path="res://assets/Placeholder BGs/laundry drawer open.png" type="Texture" id=1] [ext_resource path="res://assets/Placeholder BGs/laundry drawer open.png" type="Texture" id=1]
[ext_resource path="res://assets/Thesis Clickables/soap drawer open.png" type="Texture" id=2] [ext_resource path="res://assets/Thesis Clickables/soap drawer open.png" type="Texture" id=2]
...@@ -14,13 +14,14 @@ ...@@ -14,13 +14,14 @@
[ext_resource path="res://assets/Backgrounds/laundry open.png" type="Texture" id=12] [ext_resource path="res://assets/Backgrounds/laundry open.png" type="Texture" id=12]
[ext_resource path="res://assets/Thesis Clickables/machine door open.png" type="Texture" id=13] [ext_resource path="res://assets/Thesis Clickables/machine door open.png" type="Texture" id=13]
[ext_resource path="res://assets/Thesis Clickables/machine door closed.png" type="Texture" id=14] [ext_resource path="res://assets/Thesis Clickables/machine door closed.png" type="Texture" id=14]
[ext_resource path="res://assets/Thesis Clickables/clothes in machine.png" type="Texture" id=15]
[sub_resource type="StreamTexture" id=1] [sub_resource type="StreamTexture" id=1]
flags = 4 flags = 4
load_path = "res://.import/laundry door open.png-4b5301b83ad58821eec5d9f14596c644.stex" load_path = "res://.import/laundry door open.png-4b5301b83ad58821eec5d9f14596c644.stex"
[sub_resource type="CircleShape2D" id=2] [sub_resource type="CircleShape2D" id=2]
radius = 11.0581 radius = 12.5015
[sub_resource type="RectangleShape2D" id=3] [sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 24.0534, 14.1028 ) extents = Vector2( 24.0534, 14.1028 )
...@@ -118,9 +119,6 @@ position = Vector2( 342.886, 503.35 ) ...@@ -118,9 +119,6 @@ position = Vector2( 342.886, 503.35 )
scale = Vector2( 0.829244, 0.829244 ) scale = Vector2( 0.829244, 0.829244 )
input_pickable = true input_pickable = true
script = ExtResource( 5 ) script = ExtResource( 5 )
__meta__ = {
"_edit_group_": true
}
interactable = true interactable = true
[node name="h" type="CollisionShape2D" parent="Clothes"] [node name="h" type="CollisionShape2D" parent="Clothes"]
...@@ -151,6 +149,12 @@ polygon = PoolVector2Array( 130, -112.6, 130, -108.8, 346, -26.9, 346, -22.7, 40 ...@@ -151,6 +149,12 @@ polygon = PoolVector2Array( 130, -112.6, 130, -108.8, 346, -26.9, 346, -22.7, 40
[node name="Sprite" type="Sprite" parent="Clothes/Hitbox"] [node name="Sprite" type="Sprite" parent="Clothes/Hitbox"]
texture = ExtResource( 9 ) texture = ExtResource( 9 )
[node name="Sprite in" type="Sprite" parent="Clothes"]
visible = false
position = Vector2( 103.156, -98.0649 )
scale = Vector2( 0.122336, 0.122336 )
texture = ExtResource( 15 )
[node name="Buttons" type="StaticBody2D" parent="."] [node name="Buttons" type="StaticBody2D" parent="."]
position = Vector2( 433.485, 338.882 ) position = Vector2( 433.485, 338.882 )
scale = Vector2( 0.829244, 0.829244 ) scale = Vector2( 0.829244, 0.829244 )
......
...@@ -48,6 +48,7 @@ margin_left = -76.0 ...@@ -48,6 +48,7 @@ margin_left = -76.0
margin_top = -54.0 margin_top = -54.0
margin_right = 1016.0 margin_right = 1016.0
margin_bottom = 611.0 margin_bottom = 611.0
mouse_filter = 2
custom_styles/panel = SubResource( 1 ) custom_styles/panel = SubResource( 1 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
......
...@@ -86,9 +86,6 @@ position = Vector2( 178.938, 291.028 ) ...@@ -86,9 +86,6 @@ position = Vector2( 178.938, 291.028 )
scale = Vector2( 0.829244, 0.829244 ) scale = Vector2( 0.829244, 0.829244 )
input_pickable = true input_pickable = true
script = ExtResource( 9 ) script = ExtResource( 9 )
__meta__ = {
"_edit_group_": true
}
interactable = true interactable = true
[node name="Hitbox" type="CollisionShape2D" parent="Front door"] [node name="Hitbox" type="CollisionShape2D" parent="Front door"]
......
...@@ -197,9 +197,6 @@ scale = Vector2( 0.9, 0.9 ) ...@@ -197,9 +197,6 @@ scale = Vector2( 0.9, 0.9 )
z_index = -1 z_index = -1
input_pickable = true input_pickable = true
script = ExtResource( 10 ) script = ExtResource( 10 )
__meta__ = {
"_edit_group_": true
}
interactable = true interactable = true
[node name="Hitbox" type="CollisionShape2D" parent="Bathroom door"] [node name="Hitbox" type="CollisionShape2D" parent="Bathroom door"]
......
...@@ -66,6 +66,21 @@ func checkRoom(): ...@@ -66,6 +66,21 @@ func checkRoom():
moxiePath.set_path(rooms[current].get_name()) moxiePath.set_path(rooms[current].get_name())
moxiePath.hardMove(0) moxiePath.hardMove(0)
getRoomPosition(rooms[current].get_name()) getRoomPosition(rooms[current].get_name())
var save_data = File.new()
var curTime = OS.get_time()
var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]"
if !save_data.file_exists("user://data.save"):
save_data.open("user://data.save",File.WRITE)
save_data.store_string("FILE START\n")
save_data.store_string("\nROOM: " + rooms[current].get_name())
print("Created file")
else:
save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end()
save_data.store_string("\nROOM: " + rooms[current].get_name())
#save_data.store_string(": " + method + " " + get_name())
#print("Writing to file")
save_data.close()
func setRoom(num): func setRoom(num):
current = num current = num
......
...@@ -5,7 +5,19 @@ export(bool) var tracking ...@@ -5,7 +5,19 @@ export(bool) var tracking
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
pass # Replace with function body. var save_data = File.new()
var curTime = OS.get_time()
var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]"
if !save_data.file_exists("user://data.save"): # creates a new save file if there is none
save_data.open("user://data.save",File.WRITE)
save_data.store_string("FILE START, GAME START\n")
print("Created file")
else: # appends to existing save file if it does exist
save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end()
save_data.store_string("GAME START\n")
save_data.close()
func _unhandled_input(event): # for any input that isn't capture by UI or any other items in the scene tree (doesn't count instanced scene trees) func _unhandled_input(event): # for any input that isn't capture by UI or any other items in the scene tree (doesn't count instanced scene trees)
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:
...@@ -15,6 +27,7 @@ func _unhandled_input(event): # for any input that isn't capture by UI or any ot ...@@ -15,6 +27,7 @@ func _unhandled_input(event): # for any input that isn't capture by UI or any ot
var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]" var timestamp = "[" + str(curTime.hour) + ":" + str(curTime.minute) + ":" + str(curTime.second) + "]"
if !save_data.file_exists("user://data.save"): # creates a new save file if there is none if !save_data.file_exists("user://data.save"): # creates a new save file if there is none
save_data.open("user://data.save",File.WRITE) save_data.open("user://data.save",File.WRITE)
save_data.store_string("FILE START\n")
save_data.store_string(timestamp + " " + str(event.position)) save_data.store_string(timestamp + " " + str(event.position))
print("Created file") print("Created file")
else: # appends to existing save file if it does exist else: # appends to existing save file if it does exist
......
...@@ -90,8 +90,10 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it ...@@ -90,8 +90,10 @@ func interaction(selected, clicked): #selected = item in inventory, clicked = it
return "A pile of clothes." return "A pile of clothes."
"Put in": "Put in":
if door: if door:
clothes.scale = Vector2(0.4,0.4) #clothes.scale = Vector2(0.4,0.4)
clothes.position = Vector2(432.376,406.681) clothes.get_node("Hitbox").visible = false
clothes.get_node("Sprite in").visible = true
#clothes.position = Vector2(432.376,406.681)
clothes_in = true clothes_in = true
#x 502.081, y 420.95 #x 502.081, y 420.95
return "In you go." return "In you go."
......
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/clothes in machine.png-20900c558aa35dbe0f45f03502a734e3.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/Thesis Clickables/clothes in machine.png"
dest_files=[ "res://.import/clothes in machine.png-20900c558aa35dbe0f45f03502a734e3.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
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