Commit f970a011 authored by Julia Santos's avatar Julia Santos

Can now log each mouse click by its X and Y coordinate, currently disabled for...

Can now log each mouse click by its X and Y coordinate, currently disabled for convenience when testing. Talking to neighbor also initiates a conversation, however clicking away doesn't make the arrow go away yet
parent e1a18cc8
extends "res://Item.gd"
onready var sceneProgress = 0
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func mouseInteraction():
var dialogue
match sceneProgress:
0:
dialogue = "Moxie: ..... Trying to help....?"
sceneProgress += 1
1:
dialogue = "Then can you give me some space? This is area is a danger zone until I finish what I'm doing"
sceneProgress += 1
2:
dialogue = "(Geez. He won't budge. I guess I'll have to distract him somehow...)"
sceneProgress = 0
hide()
dialogueBox.text = dialogue
extends Node
#for code that we don't quite want to delete yet
#func _input(event):
#whenever something onscreen is clicked on
#if event is InputEventMouseButton:
#if event.button_index == BUTTON_LEFT and event.pressed:
# print("Clicked" + " with selected " + str(inventory.is_anything_selected()))
#inventory.unselect_all()
#onready var clickLog = File.new()
#print("Clicked on " + self.get_name())
#dialogueBox.text = "Clicked on " + self.get_name()
#clickLog.open("res://log.txt",File.WRITE_READ)
#clickLog.seek_end(0)
#clickLog.store_string("Clicked on " + self.get_name() + "\n")
#clickLog.close()
func _ready():
pass # Replace with function body.
#selected
#match ingredient:
# "Bread":
# eat.show()
# ingredient_number += 1
# sandwich += 1
# "Egg":
# eat.show()
# ingredient_number += 1
# sandwich += 1
# cookables += 1
# "Vienna sausage":
# eat.show()
# ingredient_number += 1
# sandwich += 1
# cookables += 1
#
# if ingredient_number > 0:
# granola.interactable = false
# granola.modulate = Color("#616161")
#
# if ingredient_number > 1:
# eat.hide()
# elif cookables > 1:
# cook.show()
# if cookables == 2: #2 cookables and bread
# if ingredient_number == 3:
# dialogue.text = "An egg and sausage sandwich. Requires 20 energy and gives 40 energy."
# cook.show()
# elif bread.visible and ingredient_number > 1: # bread and only 1 other ingredient
# cook.show()
# if egg.visible:
# dialogue.text = "An egg sandwich. Requires 15 energy and gives 35 energy."
# else:
# dialogue.text = "A sausage sandwich. Requires 15 energy and gives 35 energy."
# else:
# cook.hide()
#unselected
#match ingredient:
# "Bread":
# ingredient_number -= 1
# sandwich -= 1
# "Egg":
# ingredient_number -= 1
# cookables -= 1
# sandwich -= 1
# "Vienna sausage":
# ingredient_number -= 1
# cookables -= 1
# sandwich -= 1
#
# if ingredient_number == 1 and cookables == 1:
# cook.show()
# else:
# cook.hide()
#
# if !eat.visible:
# eat.show()
#
# if ingredient_number == 0:
# eat.hide()
# cook.hide()
# granola.interactable = true
# granola.modulate = Color("#ffffff")
# sandwich = 0
...@@ -12,14 +12,14 @@ export(String) var flavorText # the flavor text that appears in the dialogue box ...@@ -12,14 +12,14 @@ export(String) var flavorText # the flavor text that appears in the dialogue box
onready var control = get_parent().get_node("Dialogue control") onready var control = get_parent().get_node("Dialogue control")
#other variables #other variables
onready var texture = get_node("CollisionShape2D/Sprite").get_texture() onready var texture
# some references # some references
# https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_exports.html # https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_exports.html
# https://padamthapa.com/blog/how-to-detect-click-inside-staticbody2d-in-godot/ # https://padamthapa.com/blog/how-to-detect-click-inside-staticbody2d-in-godot/
func _ready(): func _ready():
pass texture = get_node("CollisionShape2D/Sprite").get_texture()
func passUI(inv, dia, que): #passes the inventory and dialogue box from the parent scene to the item in the instanced scene func passUI(inv, dia, que): #passes the inventory and dialogue box from the parent scene to the item in the instanced scene
inventory = inv inventory = inv
...@@ -48,12 +48,12 @@ func storeClick(method): ...@@ -48,12 +48,12 @@ func storeClick(method):
var save_data = File.new() var save_data = File.new()
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_line(to_json(method + " " + get_name())) save_data.store_string(method + " " + get_name())
print("Created file") print("Created file")
else: else:
save_data.open("user://data.save",File.READ_WRITE) save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end() save_data.seek_end()
save_data.store_line(to_json(method + " " + get_name())) save_data.store_string(method + " " + get_name())
print("Writing to file") print("Writing to file")
save_data.close() save_data.close()
...@@ -61,12 +61,12 @@ func storeInt(selected): ...@@ -61,12 +61,12 @@ func storeInt(selected):
var save_data = File.new() var save_data = File.new()
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_line(to_json("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:
save_data.open("user://data.save",File.READ_WRITE) save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end() save_data.seek_end()
save_data.store_line(to_json("Used " + inventory.get_item_text(selected) + " -> " + get_name())) save_data.store_string("Used " + inventory.get_item_text(selected) + " -> " + get_name())
print("Writing to file") print("Writing to file")
save_data.close() save_data.close()
......
[gd_scene load_steps=19 format=2] [gd_scene load_steps=23 format=2]
[ext_resource path="res://Scripts/Dialogue control/Dialogue Control - Neighbor's room.gd" type="Script" id=1] [ext_resource path="res://Scripts/Dialogue control/Dialogue Control - Neighbor's room.gd" type="Script" id=1]
[ext_resource path="res://Item.gd" type="Script" id=2] [ext_resource path="res://Item.gd" type="Script" id=2]
...@@ -6,10 +6,13 @@ ...@@ -6,10 +6,13 @@
[ext_resource path="res://assets/Thesis Clickables/Toolbox.png" type="Texture" id=4] [ext_resource path="res://assets/Thesis Clickables/Toolbox.png" type="Texture" id=4]
[ext_resource path="res://assets/Thesis Clickables/Neighbor.png" type="Texture" id=5] [ext_resource path="res://assets/Thesis Clickables/Neighbor.png" type="Texture" id=5]
[ext_resource path="res://assets/Thesis Clickables/Balcony door.png" type="Texture" id=6] [ext_resource path="res://assets/Thesis Clickables/Balcony door.png" type="Texture" id=6]
[ext_resource path="res://Scripts/Neighbor.gd" type="Script" id=7]
[ext_resource path="res://assets/Thesis Clickables/Reptile memorabilia.png" type="Texture" id=8] [ext_resource path="res://assets/Thesis Clickables/Reptile memorabilia.png" type="Texture" id=8]
[ext_resource path="res://Scripts/Movement scripts/Neighbor to hallway.gd" type="Script" id=9] [ext_resource path="res://Scripts/Movement scripts/Neighbor to hallway.gd" type="Script" id=9]
[ext_resource path="res://Scripts/Movement scripts/Neighbor to balcony.gd" type="Script" id=10] [ext_resource path="res://Scripts/Movement scripts/Neighbor to balcony.gd" type="Script" id=10]
[ext_resource path="res://assets/Thesis Clickables/Screwdriver.png" type="Texture" id=11] [ext_resource path="res://assets/Thesis Clickables/Screwdriver.png" type="Texture" id=11]
[ext_resource path="res://Dialogue arrow.gd" type="Script" id=12]
[ext_resource path="res://assets/Thesis Clickables/right arrow.png" type="Texture" id=13]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 10.2686, 34.6917 ) extents = Vector2( 10.2686, 34.6917 )
...@@ -36,6 +39,9 @@ extents = Vector2( 21.6967, 40.5453 ) ...@@ -36,6 +39,9 @@ extents = Vector2( 21.6967, 40.5453 )
flags = 4 flags = 4
load_path = "res://.import/front door.png-58881902b918df4a261fe60f02da2bc4.stex" load_path = "res://.import/front door.png-58881902b918df4a261fe60f02da2bc4.stex"
[sub_resource type="RectangleShape2D" id=10]
extents = Vector2( 8.10034, 6.2543 )
[node name="Node2D" type="Node2D"] [node name="Node2D" type="Node2D"]
position = Vector2( 628.701, 371.677 ) position = Vector2( 628.701, 371.677 )
...@@ -91,11 +97,12 @@ texture = ExtResource( 6 ) ...@@ -91,11 +97,12 @@ texture = ExtResource( 6 )
[node name="Neighbor" type="StaticBody2D" parent="."] [node name="Neighbor" type="StaticBody2D" parent="."]
position = Vector2( 6.43958, 8.75641 ) position = Vector2( 6.43958, 8.75641 )
input_pickable = true input_pickable = true
script = ExtResource( 2 ) script = ExtResource( 7 )
__meta__ = { __meta__ = {
"_edit_group_": true "_edit_group_": true
} }
interactable = true interactable = true
flavorText = "Brodie: Um... What are you doing?"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Neighbor"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Neighbor"]
position = Vector2( -0.433167, 2.2196 ) position = Vector2( -0.433167, 2.2196 )
...@@ -185,3 +192,22 @@ shape = SubResource( 7 ) ...@@ -185,3 +192,22 @@ shape = SubResource( 7 )
position = Vector2( -0.00814819, -0.484581 ) position = Vector2( -0.00814819, -0.484581 )
scale = Vector2( 0.208332, 0.403654 ) scale = Vector2( 0.208332, 0.403654 )
texture = SubResource( 8 ) texture = SubResource( 8 )
[node name="Dialogue arrow" type="StaticBody2D" parent="."]
visible = false
position = Vector2( 353.534, -272.056 )
scale = Vector2( 0.829244, 0.829244 )
z_index = 1
input_pickable = true
script = ExtResource( 12 )
interactable = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Dialogue arrow"]
position = Vector2( -3.95886, 13.9804 )
scale = Vector2( 5, 5 )
shape = SubResource( 10 )
[node name="Sprite" type="Sprite" parent="Dialogue arrow/CollisionShape2D"]
position = Vector2( 1.38672, 0.106689 )
scale = Vector2( 0.0193524, 0.0195471 )
texture = ExtResource( 13 )
[gd_scene load_steps=27 format=2] [gd_scene load_steps=29 format=2]
[ext_resource path="res://assets/Placeholder BGs/room zoom out.png" type="Texture" id=1] [ext_resource path="res://assets/Placeholder BGs/room zoom out.png" type="Texture" id=1]
[ext_resource path="res://assets/placeholder item.png" type="Texture" id=2] [ext_resource path="res://assets/placeholder item.png" type="Texture" id=2]
[ext_resource path="res://Scripts/BG.gd" type="Script" id=3]
[ext_resource path="res://Scripts/Dialogue control/Dialogue control - Test Room 1.gd" type="Script" id=4] [ext_resource path="res://Scripts/Dialogue control/Dialogue control - Test Room 1.gd" type="Script" id=4]
[ext_resource path="res://assets/Thesis Clickables/trail 1.png" type="Texture" id=5] [ext_resource path="res://assets/Thesis Clickables/trail 1.png" type="Texture" id=5]
[ext_resource path="res://assets/Thesis Clickables/trail 2.png" type="Texture" id=6] [ext_resource path="res://assets/Thesis Clickables/trail 2.png" type="Texture" id=6]
...@@ -14,47 +15,50 @@ ...@@ -14,47 +15,50 @@
[ext_resource path="res://Scripts/Clothes trail.gd" type="Script" id=13] [ext_resource path="res://Scripts/Clothes trail.gd" type="Script" id=13]
[sub_resource type="RectangleShape2D" id=1] [sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 14.2862, 14.7497 ) extents = Vector2( 512.15, 301.549 )
[sub_resource type="RectangleShape2D" id=2] [sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 14.2862, 14.7497 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 22.0635, 10.5567 ) extents = Vector2( 22.0635, 10.5567 )
[sub_resource type="StreamTexture" id=3] [sub_resource type="StreamTexture" id=4]
flags = 4 flags = 4
load_path = "res://.import/placeholder item.png-cd6e4c1231156687d87915032ec4361d.stex" load_path = "res://.import/placeholder item.png-cd6e4c1231156687d87915032ec4361d.stex"
[sub_resource type="RectangleShape2D" id=4] [sub_resource type="RectangleShape2D" id=5]
extents = Vector2( 16.0697, 9.41678 ) extents = Vector2( 16.0697, 9.41678 )
[sub_resource type="RectangleShape2D" id=5] [sub_resource type="RectangleShape2D" id=6]
extents = Vector2( 16.0423, 12.4535 ) extents = Vector2( 16.0423, 12.4535 )
[sub_resource type="StreamTexture" id=6] [sub_resource type="StreamTexture" id=7]
flags = 4 flags = 4
load_path = "res://.import/trail 3.png-9960f4c5b964f5aca36ca6c97e309a5d.stex" load_path = "res://.import/trail 3.png-9960f4c5b964f5aca36ca6c97e309a5d.stex"
[sub_resource type="RectangleShape2D" id=7] [sub_resource type="RectangleShape2D" id=8]
extents = Vector2( 16.729, 28.1565 ) extents = Vector2( 16.729, 28.1565 )
[sub_resource type="StreamTexture" id=8] [sub_resource type="StreamTexture" id=9]
flags = 4 flags = 4
load_path = "res://.import/trail 3.png-9960f4c5b964f5aca36ca6c97e309a5d.stex" load_path = "res://.import/trail 3.png-9960f4c5b964f5aca36ca6c97e309a5d.stex"
[sub_resource type="RectangleShape2D" id=9]
extents = Vector2( 16.2181, 10.3281 )
[sub_resource type="RectangleShape2D" id=10] [sub_resource type="RectangleShape2D" id=10]
extents = Vector2( 16.2181, 10.3281 )
[sub_resource type="RectangleShape2D" id=11] [sub_resource type="RectangleShape2D" id=11]
[sub_resource type="StreamTexture" id=12] [sub_resource type="RectangleShape2D" id=12]
[sub_resource type="StreamTexture" id=13]
flags = 4 flags = 4
load_path = "res://.import/trail 3.png-9960f4c5b964f5aca36ca6c97e309a5d.stex" load_path = "res://.import/trail 3.png-9960f4c5b964f5aca36ca6c97e309a5d.stex"
[sub_resource type="RectangleShape2D" id=13] [sub_resource type="RectangleShape2D" id=14]
extents = Vector2( 13.7803, 7.3572 ) extents = Vector2( 13.7803, 7.3572 )
[sub_resource type="StreamTexture" id=14] [sub_resource type="StreamTexture" id=15]
flags = 4 flags = 4
load_path = "res://.import/trail 4.png-981c4881d0d8d742f95645909a2023bf.stex" load_path = "res://.import/trail 4.png-981c4881d0d8d742f95645909a2023bf.stex"
...@@ -70,9 +74,18 @@ __meta__ = { ...@@ -70,9 +74,18 @@ __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="BG" type="Sprite" parent="."] [node name="BG" type="StaticBody2D" parent="."]
position = Vector2( 190.702, 295.083 ) position = Vector2( 190.702, 295.083 )
scale = Vector2( 0.997353, 0.98961 ) scale = Vector2( 0.997353, 0.98961 )
z_index = -1
script = ExtResource( 3 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="BG"]
z_index = -1
shape = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="BG/CollisionShape2D"]
z_index = -1
texture = ExtResource( 1 ) texture = ExtResource( 1 )
[node name="Laundry basket" type="StaticBody2D" parent="."] [node name="Laundry basket" type="StaticBody2D" parent="."]
...@@ -87,7 +100,7 @@ interactable = true ...@@ -87,7 +100,7 @@ interactable = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Laundry basket"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Laundry basket"]
position = Vector2( -0.433167, 2.2196 ) position = Vector2( -0.433167, 2.2196 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 1 ) shape = SubResource( 2 )
[node name="Sprite" type="Sprite" parent="Laundry basket/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Laundry basket/CollisionShape2D"]
visible = false visible = false
...@@ -108,12 +121,12 @@ flavorText = "Hello, my little yellow daughter." ...@@ -108,12 +121,12 @@ flavorText = "Hello, my little yellow daughter."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Terrarium"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Terrarium"]
position = Vector2( -0.433167, 2.2196 ) position = Vector2( -0.433167, 2.2196 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 2 ) shape = SubResource( 3 )
[node name="Sprite" type="Sprite" parent="Terrarium/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Terrarium/CollisionShape2D"]
position = Vector2( -0.158142, -0.0184937 ) position = Vector2( -0.158142, -0.0184937 )
scale = Vector2( 0.222636, 0.101337 ) scale = Vector2( 0.222636, 0.101337 )
texture = SubResource( 3 ) texture = SubResource( 4 )
[node name="Pile of clothes" type="StaticBody2D" parent="."] [node name="Pile of clothes" type="StaticBody2D" parent="."]
position = Vector2( 6.41483, 285.765 ) position = Vector2( 6.41483, 285.765 )
...@@ -128,7 +141,7 @@ flavorText = "Augh my back. That's a lot of clothes." ...@@ -128,7 +141,7 @@ flavorText = "Augh my back. That's a lot of clothes."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Pile of clothes"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Pile of clothes"]
position = Vector2( 0.842377, -0.977234 ) position = Vector2( 0.842377, -0.977234 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 4 ) shape = SubResource( 5 )
[node name="Sprite" type="Sprite" parent="Pile of clothes/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Pile of clothes/CollisionShape2D"]
position = Vector2( -0.2771, -3.84143 ) position = Vector2( -0.2771, -3.84143 )
...@@ -149,13 +162,13 @@ interactable = true ...@@ -149,13 +162,13 @@ interactable = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Laptop"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Laptop"]
position = Vector2( -16.4264, -2.27527 ) position = Vector2( -16.4264, -2.27527 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 5 ) shape = SubResource( 6 )
[node name="Sprite" type="Sprite" parent="Laptop/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Laptop/CollisionShape2D"]
visible = false visible = false
position = Vector2( -0.277301, -0.137165 ) position = Vector2( -0.277301, -0.137165 )
scale = Vector2( 0.0197574, 0.0197574 ) scale = Vector2( 0.0197574, 0.0197574 )
texture = SubResource( 6 ) texture = SubResource( 7 )
[node name="Bathroom door" type="StaticBody2D" parent="."] [node name="Bathroom door" type="StaticBody2D" parent="."]
position = Vector2( 588.187, 226.932 ) position = Vector2( 588.187, 226.932 )
...@@ -170,7 +183,7 @@ interactable = true ...@@ -170,7 +183,7 @@ interactable = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Bathroom door"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Bathroom door"]
position = Vector2( -16.4264, -2.27527 ) position = Vector2( -16.4264, -2.27527 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 7 ) shape = SubResource( 8 )
__meta__ = { __meta__ = {
"_edit_group_": true "_edit_group_": true
} }
...@@ -179,7 +192,7 @@ __meta__ = { ...@@ -179,7 +192,7 @@ __meta__ = {
visible = false visible = false
position = Vector2( -0.277301, -0.137165 ) position = Vector2( -0.277301, -0.137165 )
scale = Vector2( 0.0197574, 0.0197574 ) scale = Vector2( 0.0197574, 0.0197574 )
texture = SubResource( 8 ) texture = SubResource( 9 )
[node name="Pants" type="StaticBody2D" parent="."] [node name="Pants" type="StaticBody2D" parent="."]
position = Vector2( 94.5713, 491.212 ) position = Vector2( 94.5713, 491.212 )
...@@ -196,7 +209,7 @@ flavorText = "A deconstructed pile of clothes." ...@@ -196,7 +209,7 @@ flavorText = "A deconstructed pile of clothes."
position = Vector2( -2.31012, 0.749359 ) position = Vector2( -2.31012, 0.749359 )
rotation = 3.57443 rotation = 3.57443
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 9 ) shape = SubResource( 10 )
[node name="Sprite" type="Sprite" parent="Pants/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Pants/CollisionShape2D"]
position = Vector2( 0.911179, -3.52747 ) position = Vector2( 0.911179, -3.52747 )
...@@ -216,7 +229,7 @@ flavorText = "A deconstructed pile of clothes." ...@@ -216,7 +229,7 @@ flavorText = "A deconstructed pile of clothes."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Shirt"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Shirt"]
position = Vector2( -1.78223, 0.549072 ) position = Vector2( -1.78223, 0.549072 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 10 ) shape = SubResource( 11 )
[node name="Sprite" type="Sprite" parent="Shirt/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Shirt/CollisionShape2D"]
position = Vector2( -0.277301, -0.137165 ) position = Vector2( -0.277301, -0.137165 )
...@@ -238,12 +251,12 @@ flavorText = "A deconstructed pile of clothes." ...@@ -238,12 +251,12 @@ flavorText = "A deconstructed pile of clothes."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sando"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Sando"]
position = Vector2( -3.5491, 1.06189 ) position = Vector2( -3.5491, 1.06189 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 11 ) shape = SubResource( 12 )
[node name="Sprite" type="Sprite" parent="Sando/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Sando/CollisionShape2D"]
position = Vector2( -0.277301, -0.137165 ) position = Vector2( -0.277301, -0.137165 )
scale = Vector2( 0.0197574, 0.0197574 ) scale = Vector2( 0.0197574, 0.0197574 )
texture = SubResource( 12 ) texture = SubResource( 13 )
[node name="Towel" type="StaticBody2D" parent="."] [node name="Towel" type="StaticBody2D" parent="."]
position = Vector2( -67.9803, 464.817 ) position = Vector2( -67.9803, 464.817 )
...@@ -259,9 +272,9 @@ flavorText = "A deconstructed pile of clothes." ...@@ -259,9 +272,9 @@ flavorText = "A deconstructed pile of clothes."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Towel"] [node name="CollisionShape2D" type="CollisionShape2D" parent="Towel"]
position = Vector2( -3.5491, 1.06189 ) position = Vector2( -3.5491, 1.06189 )
scale = Vector2( 5, 5 ) scale = Vector2( 5, 5 )
shape = SubResource( 13 ) shape = SubResource( 14 )
[node name="Sprite" type="Sprite" parent="Towel/CollisionShape2D"] [node name="Sprite" type="Sprite" parent="Towel/CollisionShape2D"]
position = Vector2( -0.218535, -1.57275 ) position = Vector2( -0.218535, -1.57275 )
scale = Vector2( 0.03, 0.03 ) scale = Vector2( 0.03, 0.03 )
texture = SubResource( 14 ) texture = SubResource( 15 )
...@@ -61,7 +61,7 @@ bg_color = Color( 0.145098, 0.145098, 0.164706, 1 ) ...@@ -61,7 +61,7 @@ bg_color = Color( 0.145098, 0.145098, 0.164706, 1 )
[node name="Bedroom" parent="." instance=ExtResource( 1 )] [node name="Bedroom" parent="." instance=ExtResource( 1 )]
script = ExtResource( 4 ) 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"), NodePath("BG") ]
[node name="Desk" parent="." instance=ExtResource( 26 )] [node name="Desk" parent="." instance=ExtResource( 26 )]
visible = false visible = false
...@@ -122,7 +122,7 @@ items = [ NodePath("Other plants"), NodePath("Nana"), NodePath("Pot"), NodePath( ...@@ -122,7 +122,7 @@ items = [ NodePath("Other plants"), NodePath("Nana"), NodePath("Pot"), NodePath(
[node name="Neighbor\'s room" parent="." instance=ExtResource( 22 )] [node name="Neighbor\'s room" parent="." instance=ExtResource( 22 )]
visible = false visible = false
script = ExtResource( 4 ) script = ExtResource( 4 )
items = [ NodePath("Ladder"), NodePath("Neighbor to balcony"), NodePath("Neighbor"), NodePath("Reptile memorabilia"), NodePath("Toolbox"), NodePath("Screwdriver"), NodePath("Neighbor to hallway") ] items = [ NodePath("Ladder"), NodePath("Neighbor to balcony"), NodePath("Neighbor"), NodePath("Reptile memorabilia"), NodePath("Toolbox"), NodePath("Screwdriver"), NodePath("Neighbor to hallway"), NodePath("Dialogue arrow") ]
[node name="Neighbor\'s balcony" parent="." instance=ExtResource( 23 )] [node name="Neighbor\'s balcony" parent="." instance=ExtResource( 23 )]
visible = false visible = false
......
extends Sprite extends StaticBody2D
onready var inventory = get_parent().get_node("ItemList") onready var inventory
export(bool) var tracking
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# 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():
...@@ -12,14 +8,22 @@ func _ready(): ...@@ -12,14 +8,22 @@ func _ready():
func _input(event): func _input(event):
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("Unselected") if tracking:
inventory.unselect_all() var save_data = File.new()
if !save_data.file_exists("user://data.save"):
save_data.open("user://data.save",File.WRITE)
save_data.store_string(str(event.position) + ": ")
print("Created file")
else:
save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end()
save_data.store_string("\n"+ str(event.position) + ": ")
print("Writing coordinates to file")
save_data.close()
#print(event.position)
func passUI(inv, dia):
func passUI(inv, dia, que):
inventory = inv inventory = inv
print("Found " + inventory.get_name()) print("Found " + inventory.get_name())
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
extends "res://Item.gd"
onready var dialogueArrow = get_parent().get_node("Dialogue arrow")
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func mouseInteraction():
.mouseInteraction()
dialogueArrow.show()
print("Starting scene")
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