~kmdodrill/growing-apart

2779f194452672c32677076f37f1887f966e3385 — Kenneth Dodrill 4 months ago 4965e25
Basically game is done
M .gitignore => .gitignore +2 -0
@@ 9,6 9,8 @@ assets/*
!assets/dialogue
!assets/art
assets/art/*.import
!assets/art/main-frames
assets/art/main-frames/*.import
!assets/art/ui
assets/art/ui/*.import
!assets/ui

M README.md => README.md +11 -0
@@ 4,8 4,19 @@ a short interactive story mostly set in a texting client.

[get the game](https://stormkmd.itch.io/growing-apart)

## macOS info

if you're trying to play this on a Mac, you need to run this command:

```bash
xattr -dr com.apple.quarantine /path/to/dungeonyx.app
```

this is because I do not own a Mac to use for exporting and I can't pay to be an official developer which allows signing macOS applications.

credits:

this game was made using the Godot game engine, licensed as MIT.

this game uses the [dropship pixel font](https://nabrappy.itch.io/dropship-pixel-font).


R assets/art/background.png => assets/art/main-frames/background1.png +0 -0
A assets/art/main-frames/background10.png => assets/art/main-frames/background10.png +0 -0
A assets/art/main-frames/background2.png => assets/art/main-frames/background2.png +0 -0
A assets/art/main-frames/background3.png => assets/art/main-frames/background3.png +0 -0
A assets/art/main-frames/background4.png => assets/art/main-frames/background4.png +0 -0
A assets/art/main-frames/background5.png => assets/art/main-frames/background5.png +0 -0
A assets/art/main-frames/background6.png => assets/art/main-frames/background6.png +0 -0
A assets/art/main-frames/background7.png => assets/art/main-frames/background7.png +0 -0
A assets/art/main-frames/background8.png => assets/art/main-frames/background8.png +0 -0
A assets/art/main-frames/background9.png => assets/art/main-frames/background9.png +0 -0
M assets/dialogue/0.json => assets/dialogue/0.json +49 -17
@@ 8,13 8,13 @@
    {
	"type": "send",
	"text": "hey! :)",
	"wait_time": "1"
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "what are you up to?",
	"wait_time": "1",
	"typing_time": "1"
	"wait_time": "2",
	"typing_time": "2"
    },
    {
	"type": "option",


@@ 31,37 31,43 @@
    {
	"type": "get",
	"text": "oh. did you check the mail?",
	"wait_time": "1",
	"typing_time": "1"
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "yeah. we got a package?",
	"wait_time": "1"
	"wait_time": "3"
    },
    {
	"type": "get",
	"text": "that's the plant!",
	"wait_time": "1",
	"typing_time": "1"
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "option",
	"options": {
	    "cool!": {
		"text": "cool, I'll set it up!"
	    },
	    "whatever": {
		"text": "ah, okay."
	    },
	    "cool!": {
		"text": "cool, I'll set it up!"
	    }

	}
    },
    "cool!",
    {
	"type": "get",
	"text": "yay!! tysm!",
	"wait_time": "1",
	"typing_time": "1"
	"text": "yay, tysm!",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "no problem!",
	"wait_time": "2"
    },
    {
	"type": "end"


@@ 70,13 76,39 @@
    {
	"type": "get",
	"text": "could you plant it for me?",
	"wait_time": "1",
	"typing_time": "2"
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "guess so.",
	"wait_time": "1"
	"wait_time": "2"
    },
    {
	"type": "end"
    },
    "lots",
    {
	"type": "get",
	"text": "thank you! did you check the mail?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "i did! I'm setting up the plant now.",
	"wait_time": "3"
    },
    {
	"type": "get",
	"text": "great job, hun! thank u :)",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "no prob :)",
	"wait_time": "2"
    },
    {
	"type": "end"

A assets/dialogue/1.json => assets/dialogue/1.json +123 -0
@@ 0,0 1,123 @@
[
    {
	"type": "get",
	"text": "hey babe! how's the plant doing? :)",
	"wait_time": "0",
	"typing_time": "0"
    },
    {
	"type": "option",
	"options": {
	    "fine": {
		"text": "doing alright. how are you?"
	    },
	    "great!": {
		"text": "looks great! how are you?"
	    }
	}
    },
    "fine",
    {
	"type": "get",
	"text": "i'm doing good :)",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "get",
	"text": "are you still going to Mark's today?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "option",
	"options": {
	    "yes": {
		"text": "yep"
	    },
	    "no": {
		"text": "nah, I'm not feeling it anymore."
	    }
	}
    },
    "yes",
    {
	"type": "get",
	"text": "okay! we'll maybe hang out tomorrow then?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "yeah, maybe!",
	"wait_time": "2"
    },
    {
	"type": "end"
    },
    "no",
    {
	"type": "get",
	"text": "oh, okay. maybe we can hang out tonight?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "sure :)",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "yay! I'll see you tonight then :)",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "end"
    },
    "great!",
    {
	"type": "get",
	"text": "i'm doing great! :)",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "get",
	"text": "are we still hanging out today?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "option",
	"options": {
	    "nah": {
		"text": "nah, think I'll go to bed early"
	    },
	    "sure!": {
		"text": "sure thing! :)"
	    }
	}
    },
    "nah",
    {
	"type": "get",
	"text": "oh, okay.",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "end"
    },
    "sure!",
    {
	"type": "get",
	"text": "oh yay! I'll see you tonight then ;)",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "end"
    }
]

A assets/dialogue/2.json => assets/dialogue/2.json +88 -0
@@ 0,0 1,88 @@
[
    {
	"type": "get",
	"text": "hey there :)",
	"wait_time": "0",
	"typing_time": "0"
    },
    {
	"type": "option",
	"options": {
	    "hey": {
		"text": "hey, what's up?"
	    },
	    "hey!": {
		"text": "hey! what's up? :)"
	    }
	}
    },
    "hey",
    {
	"type": "get",
	"text": "just checking in. how's the plant doing?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "it's doing well.",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "alrighty. have you done anything today?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "took a shower. watched tv",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "well, next weekend is the party at mom and dad's. let me know if you're going.",
	"wait_time": "3",
	"typing_time": "4"
    },
    {
	"type": "send",
	"text": "will do.",
	"wait_time": "2"
    },
    {
	"type": "end"
    },
    "hey!",
    {
	"type": "get",
	"text": "just checking in :) how's our plant doing?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "doing good! growing strong",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "great!",
	"wait_time": "2",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "next weekend is the party at mom and dad's. can you let me know if you are going soon?",
	"wait_time": "2",
	"typing_time": "4"
    },
    {
	"type": "send",
	"text": "yeah, I can do that :)",
	"wait_time": "4"
    },
    {
	"type": "end"
    }
]

A assets/dialogue/3.json => assets/dialogue/3.json +134 -0
@@ 0,0 1,134 @@
[
    {
	"type": "get",
	"text": "good morning! how'd you sleep?",
	"wait_time": "0",
	"typing_time": "0"
    },
    {
	"type": "option",
	"options": {
	    "bad": {
		"text": "not too well. :/"
	    },
	    "good": {
		"text": "pretty good!"
	    }
	}
    },
    "bad",
    {
	"type": "get",
	"text": "sorry to hear that :/",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "get",
	"text": "hey, can you cook dinner tonight?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "I'll try. might be too tired",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "okay. well maybe tonight we can...you know? ;)",
	"wait_time": "3",
	"typing_time": "4"
    },
    {
	"type": "option",
	"options": {
	    "tired": {
		"text": "I said I'm tired"
	    },
	    "no": {
		"text": "I don't think so, not tonight. sorry."
	    }
	}
    },
    "tired",
    {
	"type": "end"
    },
    "no",
    {
	"type": "get",
	"text": "okay. maybe tomorrow?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "maybe",
	"wait_time": "2"
    },
    {
	"type": "end"
    },
    "good",
    {
	"type": "get",
	"text": "oh good!",
	"wait_time": "2",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "can you cook dinner tonight?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "yeah, sure.",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "tysm!!",
	"wait_time": "2",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "also, I was thinking maybe tonight we could...you know? ;)",
	"wait_time": "2",
	"typing_time": "4"
    },
    {
	"type": "option",
	"options": {
	    "no": {
		"text": "uhh, I don't think so, not tonight. sorry"
	    },
	    "maybe": {
		"text": "yeah, we can maybe try again tonight"
	    }
	}
    },
    "maybe",
    {
	"type": "get",
	"text": "okay, sounds like a plan",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "end"
    },
    "no",
    {
	"type": "get",
	"text": "ok",
	"wait_time": "3",
	"typing_time": "2"
    },
    {
	"type": "end"
    }
]

A assets/dialogue/4.json => assets/dialogue/4.json +112 -0
@@ 0,0 1,112 @@
[
    {
	"type": "get",
	"text": "hey, you never answered me about the party.",
	"wait_time": "0",
	"typing_time": "0"
    },
    {
	"type": "send",
	"text": "oh, sorry. yeah I think I'll skip out",
	"wait_time": "3"
    },
    {
	"type": "get",
	"text": "okay.",
	"wait_time": "3",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "do you think we can try again tonight?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "option",
	"options": {
	    "no": {
		"text": "um, I don't think so. not tonight"
	    },
	    "nah": {
		"text": "nah, not tonight. maybe another night."
	    }
	}
    },
    "no",
    {
	"type": "get",
	"text": "ok",
	"wait_time": "3",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "I'm down tomorrow",
	"wait_time": "4",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "?",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "oops! that was for someone at work.",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "get",
	"text": "I'll be home late tomorrow. remember I have the office party?",
	"wait_time": "2",
	"typing_time": "4"
    },
    {
	"type": "send",
	"text": "ok",
	"wait_time": "3"
    },
    {
	"type": "end"
    },
    "nah",
    {
	"type": "get",
	"text": "okay.",
	"wait_time": "3",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "still not sure.",
	"wait_time": "4",
	"typing_time": "2"
    },
    {
	"type": "send",
	"text": "?",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "sorry. that was meant for someone else.",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "get",
	"text": "I have the office party tomorrow, so I'll be home late.",
	"wait_time": "2",
	"typing_time": "4"
    },
    {
	"type": "send",
	"text": "okay",
	"wait_time": "3"
    },
    {
	"type": "end"
    }
]

A assets/dialogue/5.json => assets/dialogue/5.json +54 -0
@@ 0,0 1,54 @@
[
    {
	"type": "get",
	"text": "Yoyre the sweetst candything in all of theuniverse",
	"wait_time": "0",
	"typing_time": "0"
    },
    {
	"type": "send",
	"text": "kath, are you drunk?",
	"wait_time": "3"
    },
    {
	"type": "get",
	"text": "Would you arrest me if I wass?",
	"wait_time": "2",
	"typing_time": "4"
    },
    {
	"type": "send",
	"text": "yeah, you're drunk.",
	"wait_time": "2"
    },
    {
	"type": "send",
	"text": "I'll come get you",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "No its okayu jason willl driv",
	"wait_time": "2",
	"typing_time": "4"
    },
    {
	"type": "send",
	"text": "are you sure?",
	"wait_time": "3"
    },
    {
	"type": "get",
	"text": "UH yeah",
	"wait_time": "3",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "okay. see you tonight then.",
	"wait_time": "2"
    },
    {
	"type": "end"
    }
]

A assets/dialogue/6.json => assets/dialogue/6.json +33 -0
@@ 0,0 1,33 @@
[
    {
	"type": "get",
	"text": "hey",
	"wait_time": "0",
	"typing_time": "0"
    },
    {
	"type": "send",
	"text": "There you are! I've been trying to call you all day!",
	"wait_time": "3"
    },
    {
	"type": "get",
	"text": "yeah, I just got really drunk. I'll be home soon.",
	"wait_time": "3",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "well where the hell were you?",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "we can talk when I get home.",
	"wait_time": "4",
	"typing_time": "4"
    },
    {
	"type": "end"
    }
]

A assets/dialogue/7.json => assets/dialogue/7.json +186 -0
@@ 0,0 1,186 @@
[
    {
	"type": "get",
	"text": "hey",
	"wait_time": "0",
	"typing_time": "0"
    },
    {
	"type": "send",
	"text": "hi",
	"wait_time": "3"
    },
    {
	"type": "get",
	"text": "how are things?",
	"wait_time": "2",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "it's been awhile.",
	"wait_time": "1",
	"typing_time": "2"
    },
    {
	"type": "option",
	"options": {
	    "bad": {
		"text": "I've been fine."
	    },
	    "good": {
		"text": "I've been pretty good."
	    }
	}
    },
    "bad",
    {
	"type": "get",
	"text": "well, that's good.",
	"wait_time": "3",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "are you still taking care of the plant?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "it sort of takes care of itself at this point.",
	"wait_time": "4"
    },
    {
	"type": "get",
	"text": "oh, gotcha.",
	"wait_time": "2",
	"typing_time": "1"
    },
    {
	"type": "get",
	"text": "umm, I heard you were moving soon?",
	"wait_time": "3",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "yeah, tomorrow.",
	"wait_time": "4"
    },
    {
	"type": "get",
	"text": "that's exciting!",
	"wait_time": "1",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "do you think we could meet up before you leave?",
	"wait_time": "2",
	"typing_time": "4"
    },
    {
	"type": "send",
	"text": "I'm not sure that's a good idea.",
	"wait_time": "4"
    },
    {
	"type": "get",
	"text": "okay. I understand.",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "bye, kath.",
	"wait_time": "3"
    },
    {
	"type": "get",
	"text": "bye.",
	"wait_time": "3",
	"typing_time": "4"
    },
    {
	"type": "end"
    },
    "good",
    {
	"type": "get",
	"text": "oh, good!",
	"wait_time": "3",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "I'm doing good too.",
	"wait_time": "2",
	"typing_time": "2"
    },
    {
	"type": "get",
	"text": "I heard you were moving soon?",
	"wait_time": "3",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "yep, I'm moving tomorrow actually.",
	"wait_time": "3"
    },
    {
	"type": "get",
	"text": "exciting! do you think we could meet up before you go?",
	"wait_time": "2",
	"typing_time": "3"
    },
    {
	"type": "option",
	"options": {
	    "no": {
		"text": "no, I don't think that's a good idea."
	    },
	    "yes": {
		"text": "umm, sure. maybe around 12?"
	    }
	}
    },
    "yes",
    {
	"type": "get",
	"text": "works for me!",
	"wait_time": "1",
	"typing_time": "3"
    },
    {
	"type": "send",
	"text": "great. see you then.",
	"wait_time": "2"
    },
    {
	"type": "end"
    },
    "no",
    {
	"type": "get",
	"text": "I understand.",
	"wait_time": "2",
	"typing_time": "4"
    },
    {
	"type": "send",
	"text": "bye, kath.",
	"wait_time": "2"
    },
    {
	"type": "get",
	"text": "bye.",
	"wait_time": "2",
	"typing_time":"3"
    },
    {
	"type": "end"
    }
]


M assets/ui/label-text-ui.tres => assets/ui/label-text-ui.tres +2 -2
@@ 1,8 1,8 @@
[gd_resource type="StyleBoxFlat" format=2]

[resource]
content_margin_left = 3.0
content_margin_right = 2.0
content_margin_left = 2.0
content_margin_right = 4.0
bg_color = Color( 0.105882, 0.0901961, 0.160784, 1 )
border_width_left = 1
border_width_top = 1

M assets/ui/text-ui.tres => assets/ui/text-ui.tres +27 -1
@@ 1,15 1,41 @@
[gd_resource type="Theme" load_steps=5 format=2]
[gd_resource type="Theme" load_steps=10 format=2]

[ext_resource path="res://assets/ui/font/dropship.tres" type="DynamicFont" id=1]
[ext_resource path="res://assets/art/ui/scroll.png" type="Texture" id=2]
[ext_resource path="res://assets/ui/label-text-ui.tres" type="StyleBox" id=3]

[sub_resource type="StyleBoxEmpty" id=2]
content_margin_right = 3.0

[sub_resource type="StyleBoxEmpty" id=3]
content_margin_right = 3.0

[sub_resource type="StyleBoxEmpty" id=4]
content_margin_right = 3.0

[sub_resource type="StyleBoxEmpty" id=5]
content_margin_right = 3.0

[sub_resource type="StyleBoxEmpty" id=6]
content_margin_right = 3.0

[sub_resource type="StyleBoxTexture" id=1]
texture = ExtResource( 2 )
region_rect = Rect2( 0, 0, 2, 2 )

[resource]
default_font = ExtResource( 1 )
Button/colors/font_color = Color( 0.88, 0.88, 0.88, 1 )
Button/colors/font_color_disabled = Color( 0.9, 0.9, 0.9, 0.2 )
Button/colors/font_color_hover = Color( 0.94, 0.94, 0.94, 1 )
Button/colors/font_color_pressed = Color( 1, 1, 1, 1 )
Button/constants/hseparation = 4
Button/fonts/font = null
Button/styles/disabled = SubResource( 2 )
Button/styles/focus = SubResource( 3 )
Button/styles/hover = SubResource( 4 )
Button/styles/normal = SubResource( 5 )
Button/styles/pressed = SubResource( 6 )
Label/colors/font_color = Color( 0.921569, 0.921569, 0.921569, 1 )
Label/colors/font_color_shadow = Color( 0, 0, 0, 0 )
Label/colors/font_outline_modulate = Color( 1, 1, 1, 1 )

M default_bus_layout.tres => default_bus_layout.tres +1 -1
@@ 5,7 5,7 @@ bus/1/name = "music"
bus/1/solo = false
bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = 0.0
bus/1/volume_db = -1.91699
bus/1/send = "Master"
bus/2/name = "sfx"
bus/2/solo = false

M project.godot => project.godot +2 -3
@@ 64,9 64,8 @@ DialogueSystem="*res://src/Singletons/DialogueSystem.tscn"
window/size/width=64
window/size/height=128
window/size/resizable=false
window/size/fullscreen=true
window/size/test_width=500
window/size/test_height=1000
window/size/test_width=600
window/size/test_height=1200
window/dpi/allow_hidpi=true
mouse_cursor/custom_image="res://assets/art/ui/cursor.png"
window/stretch/mode="2d"

M src/Game.gd => src/Game.gd +30 -3
@@ 2,7 2,12 @@ extends Node2D

class_name Game

onready var sfx_player: SFXPlayer = $SFXPlayer
onready var main_menu = $MainMenuLayer/MainMenuContainer
onready var background: AnimatedSprite = $Background
onready var fader = $Fader/AnimationPlayer
onready var end_screen = $EndLayer/AnimationPlayer
onready var phone = $PhoneLayer/Phone

func _ready():
    get_tree().paused = true


@@ 14,7 19,29 @@ func start():
    DialogueSystem.start_dialogue()

func advance_scene():
    # go to the next animation frame.
    # load the next dialogue file and start it.
    fader.play("fade_in")
    yield(fader, "animation_finished")
    background.frame += 1
    fader.play("fade_out")
    yield(fader, "animation_finished")
    yield(get_tree().create_timer(3), "timeout")

    pass
    if background.frame == 7:
        phone.update_contact(
            "res://assets/art/default-avatar.png",
            "Katherine"
        )

    if background.frame == 8:
        play_ending()
        return

    DialogueSystem.load_dialogue("res://assets/dialogue/" + String(background.frame) + ".json")
    DialogueSystem.start_dialogue()

func play_ending():
    background.frame += 1
    sfx_player.take_plant()
    yield(get_tree().create_timer(3), "timeout")
    fader.play("fade_in")
    end_screen.play("fade_in")

M src/Game.tscn => src/Game.tscn +169 -9
@@ 1,29 1,189 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=21 format=2]

[ext_resource path="res://assets/art/background.png" type="Texture" id=1]
[ext_resource path="res://assets/art/main-frames/background6.png" type="Texture" id=1]
[ext_resource path="res://src/UI/Layers/PhoneLayer.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/Utilities/SFXPlayer.gd" type="Script" id=3]
[ext_resource path="res://assets/art/main-frames/background4.png" type="Texture" id=4]
[ext_resource path="res://src/Game.gd" type="Script" id=5]
[ext_resource path="res://src/UI/Layers/MainMenuLayer.tscn" type="PackedScene" id=6]
[ext_resource path="res://assets/art/main-frames/background3.png" type="Texture" id=7]
[ext_resource path="res://assets/art/main-frames/background5.png" type="Texture" id=8]
[ext_resource path="res://assets/art/main-frames/background9.png" type="Texture" id=9]
[ext_resource path="res://assets/art/main-frames/background10.png" type="Texture" id=10]
[ext_resource path="res://assets/art/main-frames/background1.png" type="Texture" id=11]
[ext_resource path="res://assets/art/main-frames/background2.png" type="Texture" id=12]
[ext_resource path="res://assets/art/main-frames/background7.png" type="Texture" id=13]
[ext_resource path="res://assets/art/main-frames/background8.png" type="Texture" id=14]
[ext_resource path="res://src/UI/Buttons/QuitButton.tscn" type="PackedScene" id=15]
[ext_resource path="res://assets/music/music.ogg" type="AudioStream" id=16]

[sub_resource type="SpriteFrames" id=1]
animations = [ {
"frames": [ ExtResource( 11 ), ExtResource( 12 ), ExtResource( 7 ), ExtResource( 4 ), ExtResource( 8 ), ExtResource( 1 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 9 ), ExtResource( 10 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]

[sub_resource type="Animation" id=3]
resource_name = "fade_in"
length = 4.0
tracks/0/type = "value"
tracks/0/path = NodePath("ColorRect:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ColorRect:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}

[sub_resource type="Animation" id=2]
resource_name = "fade_out"
tracks/0/type = "value"
tracks/0/path = NodePath("ColorRect:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ColorRect:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ true, false ]
}

[sub_resource type="Animation" id=4]
resource_name = "fade_in"
tracks/0/type = "value"
tracks/0/path = NodePath("EndScreenContainer:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("EndScreenContainer:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
}

[node name="Game" type="Node2D"]
script = ExtResource( 5 )

[node name="Background" type="TextureRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Background" type="AnimatedSprite" parent="."]
position = Vector2( 32, 64 )
frames = SubResource( 1 )

[node name="PhoneLayer" parent="." instance=ExtResource( 2 )]

[node name="MainMenuLayer" parent="." instance=ExtResource( 6 )]

[node name="MusicPlayer" type="AudioStreamPlayer" parent="."]
pause_mode = 2
stream = ExtResource( 16 )
autoplay = true
bus = "music"

[node name="SFXPlayer" type="AudioStreamPlayer" parent="."]
bus = "sfx"
script = ExtResource( 3 )

[node name="Fader" type="CanvasLayer" parent="."]

[node name="ColorRect" type="ColorRect" parent="Fader"]
visible = false
modulate = Color( 1, 1, 1, 0 )
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0, 0, 0, 1 )
__meta__ = {
"_edit_use_anchors_": false
}

[node name="AnimationPlayer" type="AnimationPlayer" parent="Fader"]
anims/fade_in = SubResource( 3 )
anims/fade_out = SubResource( 2 )

[node name="EndLayer" type="CanvasLayer" parent="."]

[node name="EndScreenContainer" type="MarginContainer" parent="EndLayer"]
visible = false
modulate = Color( 1, 1, 1, 0 )
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 4.0
margin_right = -4.0
margin_bottom = -4.0
__meta__ = {
"_edit_use_anchors_": false
}

[node name="HBoxContainer" type="HBoxContainer" parent="EndLayer/EndScreenContainer"]
margin_right = 56.0
margin_bottom = 120.0
alignment = 1

[node name="VBoxContainer" type="VBoxContainer" parent="EndLayer/EndScreenContainer/HBoxContainer"]
margin_right = 56.0
margin_bottom = 120.0
size_flags_horizontal = 3
alignment = 1

[node name="Label" type="Label" parent="EndLayer/EndScreenContainer/HBoxContainer/VBoxContainer"]
margin_top = 34.0
margin_right = 56.0
margin_bottom = 70.0
text = "You move on, as most people do. The plant keeps growing."
autowrap = true

[node name="QuitButton" parent="EndLayer/EndScreenContainer/HBoxContainer/VBoxContainer" instance=ExtResource( 15 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 78.0
margin_right = 56.0
margin_bottom = 86.0
align = 1

[node name="AnimationPlayer" type="AnimationPlayer" parent="EndLayer"]
anims/fade_in = SubResource( 4 )

M src/Phone.gd => src/Phone.gd +18 -3
@@ 5,11 5,15 @@ class_name Phone
signal done_typing
signal option_chosen(index)

onready var game: Game = get_tree().root.get_node("Game")
onready var scroll_container: ScrollContainer = $ScrollContainer
onready var message_box = $ScrollContainer/VBoxContainer
onready var sfx_player: SFXPlayer = get_tree().root.get_node("Game/SFXPlayer")
onready var vibrate: AudioStreamPlayer = $Vibrate
onready var text_container: PackedScene = preload("res://src/UI/TextContainer.tscn")
onready var options_container: PackedScene = preload("res://src/UI/OptionsContainer.tscn")
onready var avatar: TextureRect = $Avatar
onready var contact: Label = $Name

func _ready():
    DialogueSystem.connect("get_notification", self, "get_notification")


@@ 20,12 24,12 @@ func _ready():
        child.queue_free()

func get_notification():
    sfx_player.play_notification()
    vibrate.play()
    yield(get_tree().create_timer(.5), "timeout")
    show()

func end_conversation():
    yield(get_tree().create_timer(5), "timeout")
    yield(get_tree().create_timer(4), "timeout")
    hide()
    for child in message_box.get_children():
        child.queue_free()


@@ 35,10 39,11 @@ func get_text_msg(text: String):
    text_msg.margin_right += 3
    text_msg.text = text
    add_item(text_msg)
    sfx_player.play_notification()

func show_typing_indicator(wait_time: float):
    var indicator = text_container.instance()
    indicator.text = "Kath is typing..."
    indicator.text = contact.text + " is typing..."
    add_item(indicator)
    yield(get_tree().create_timer(wait_time), "timeout")
    indicator.queue_free()


@@ 50,6 55,7 @@ func send_text_msg(text: String):
    text_msg.text = text
    text_msg.alignment = Label.ALIGN_RIGHT
    add_item(text_msg)
    sfx_player.send_text()

func show_options(options: Dictionary):
    var options_box = options_container.instance()


@@ 71,4 77,13 @@ func return_chosen_index(index: String):
func add_item(item):
    message_box.add_child(item)
    yield(get_tree(), "idle_frame")
    yield(get_tree(), "idle_frame")
    scroll_container.scroll_vertical = scroll_container.get_v_scrollbar().max_value

func _on_Phone_hide():
    game.advance_scene()

func update_contact(avatar_image_path: String, contact_name: String):
    var new_avatar = ResourceLoader.load(avatar_image_path)
    avatar.texture = new_avatar
    contact.text = contact_name

M src/Singletons/DialogueSystem.gd => src/Singletons/DialogueSystem.gd +2 -11
@@ 26,35 26,26 @@ func unload_dialogue() -> void:
    emit_signal("end_conversation")

func start_dialogue() -> void:
    print("starting dialogue...")
    emit_signal("get_notification")

    var i = 0
    while i < dialogue.size():
        print("current index is: " + String(i))
        match dialogue[i]["type"]:
            "get":
                print("got a message")
                var wait_time = float(dialogue[i]["wait_time"])
                yield(get_tree().create_timer(wait_time), "timeout")
                yield(get_tree().create_timer(float(dialogue[i]["wait_time"])), "timeout")

                if float(dialogue[i]["typing_time"]) > 0:
                    phone.show_typing_indicator(wait_time)
                    phone.show_typing_indicator(float(dialogue[i]["typing_time"]))
                    yield(phone, "done_typing")

                phone.get_text_msg(dialogue[i]["text"])
            "send":
                print("sending a message")
                yield(get_tree().create_timer(float(dialogue[i]["wait_time"])), "timeout")
                phone.send_text_msg(dialogue[i]["text"])
            "option":
                print("got some options..")
                yield(get_tree().create_timer(1), "timeout")
                phone.show_options(dialogue[i]["options"])
                print("waiting for the phone to emit option chosen..")
                yield(phone, "option_chosen")
                print(dialogue_index)
                print(dialogue.find(dialogue_index, i))
                i = dialogue.find(dialogue_index, i)
            "end":
                unload_dialogue()

M src/UI/Layers/PhoneLayer.tscn => src/UI/Layers/PhoneLayer.tscn +11 -3
@@ 1,13 1,15 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=6 format=2]

[ext_resource path="res://assets/art/phone.png" type="Texture" id=1]
[ext_resource path="res://assets/art/avatar.png" type="Texture" id=2]
[ext_resource path="res://assets/ui/text-ui.tres" type="Theme" id=3]
[ext_resource path="res://assets/sfx/vibrate.wav" type="AudioStream" id=4]
[ext_resource path="res://src/Phone.gd" type="Script" id=5]

[node name="PhoneLayer" type="CanvasLayer"]

[node name="Phone" type="TextureRect" parent="."]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 1 )


@@ 24,7 26,7 @@ __meta__ = {
"_edit_use_anchors_": false
}

[node name="Label" type="Label" parent="Phone"]
[node name="Name" type="Label" parent="Phone"]
anchor_left = 0.344
anchor_top = 0.125
anchor_right = 0.609


@@ 51,10 53,16 @@ __meta__ = {

[node name="VBoxContainer" type="VBoxContainer" parent="Phone/ScrollContainer"]
margin_right = 48.0
margin_bottom = 99.0
margin_bottom = 99.0001
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 2
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Vibrate" type="AudioStreamPlayer" parent="Phone"]
stream = ExtResource( 4 )
bus = "sfx"

[connection signal="hide" from="Phone" to="Phone" method="_on_Phone_hide"]

M src/Utilities/SFXPlayer.gd => src/Utilities/SFXPlayer.gd +10 -0
@@ 3,7 3,17 @@ extends AudioStreamPlayer
class_name SFXPlayer

onready var notification = ResourceLoader.load("res://assets/sfx/notification.wav")
onready var send = ResourceLoader.load("res://assets/sfx/send.wav")
onready var take = ResourceLoader.load("res://assets/sfx/pickup.wav")

func play_notification():
    stream = notification
    play()

func send_text():
    stream = send
    play()

func take_plant():
    stream = take
    play()