Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
To Do Break Down
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
breakdown
To Do Break Down
Commits
e1a18cc8
Commit
e1a18cc8
authored
Dec 07, 2021
by
Julia Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clicking on items now logs the click to save.data, will need to log location movement next
parent
b419d57e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
+37
-2
Item.gd
Item.gd
+31
-0
Balcony.tscn
Main rooms/Balcony.tscn
+1
-1
Front door.gd
Scripts/Movement scripts/Front door.gd
+5
-1
No files found.
Item.gd
View file @
e1a18cc8
...
...
@@ -32,17 +32,48 @@ func _input_event(viewport, event, shape_idx): # executes when clicked on
if event.button_index == BUTTON_LEFT and event.pressed:
#print("Clicked on " + self.get_name() + " with selected " + str(inventory.is_anything_selected()))
if inventory.is_anything_selected() and interactable: # if the player has an item selected and they use it on something interactable
storeInt(inventory.get_selected_items()[0])
objInteraction(inventory.get_selected_items()[0])
elif inventory.is_anything_selected() and retrievable: # use object on something retrievable
storeInt(inventory.get_selected_items()[0])
objInteraction(inventory.get_selected_items()[0])
elif !inventory.is_anything_selected() and retrievable: # if they click on something retrievable w/ empty hands
storeClick("Picked up")
pickup()
elif interactable: #for environment things that arent retrievable, and hands are empty
storeClick("Clicked on")
mouseInteraction()
func storeClick(method):
var save_data = File.new()
if !save_data.file_exists("user://data.save"):
save_data.open("user://data.save",File.WRITE)
save_data.store_line(to_json(method + " " + get_name()))
print("Created file")
else:
save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end()
save_data.store_line(to_json(method + " " + get_name()))
print("Writing to file")
save_data.close()
func storeInt(selected):
var save_data = File.new()
if !save_data.file_exists("user://data.save"):
save_data.open("user://data.save",File.WRITE)
save_data.store_line(to_json("Used " + inventory.get_item_text(selected) + " -> " + get_name()))
print("Created file")
else:
save_data.open("user://data.save",File.READ_WRITE)
save_data.seek_end()
save_data.store_line(to_json("Used " + inventory.get_item_text(selected) + " -> " + get_name()))
print("Writing to file")
save_data.close()
func mouseInteraction(): # just clicked on it with nothing
dialogueBox.text = flavorText
func pickup(): # when it's picked up
dialogueBox.text = flavorText
...
...
Main rooms/Balcony.tscn
View file @
e1a18cc8
...
...
@@ -65,7 +65,7 @@ __meta__ = {
"_edit_group_": true
}
retrievable = true
flavorText = "
Ew... It's so dirty. Is it even water? I'm not feeding that to my plants
."
flavorText = "
A pant plot-- I mean... a plant pot
."
[node name="CollisionShape2D" type="CollisionShape2D" parent="Pot"]
position = Vector2( -16.8367, -2.11676 )
...
...
Scripts/Movement scripts/Front door.gd
View file @
e1a18cc8
extends "res://Item.gd"
signal enter
onready var first = true
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
...
...
@@ -12,5 +12,9 @@ func passEvent(handler):
func mouseInteraction():
emit_signal("enter")
if first:
dialogueBox.text = "What is that noise? Sounds like my neighbor's trying to break down their walls."
first = false
#maybe have it repeat until they remove the noise? or would that be repetitive
pass
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment