Added Grant Blevins

This commit is contained in:
2020-05-16 09:20:41 -04:00
parent 02197de5ab
commit 86637e395f
23 changed files with 569 additions and 40 deletions

View File

@ -0,0 +1,11 @@
extends Area2D
export var music : AudioStream
func _ready():
connect("body_entered", self, "_on_body_entered")
func _on_body_entered(body):
if body.has_method("user_input"):
if $"/root/MusicManager".stream != music:
$"/root/MusicManager".play_stream(music)

View File

@ -0,0 +1,9 @@
extends "res://Scripts/Component/Interactable.gd"
func _ready():
connect("interacted", self, "_on_interact")
$Speaker.speaker_name = "CEO Grant Blevins"
#$Speaker.start_dialog("intro_science")
func _on_interact():
$Speaker.start_dialog("intro_meet_ceo")

View File

@ -1,7 +1,10 @@
extends "res://Scripts/Component/StorySpeaker.gd"
extends "res://Scripts/Component/Interactable.gd"
func _ready():
start_dialog("intro_science")
connect("interacted", self, "_on_interact")
$Speaker.speaker_name = "Dr.Thadd"
$Speaker.start_dialog("intro_science")
func _on_interact():
start_dialog("intro_science_followup")
$Speaker.start_dialog("intro_science_followup")

View File

@ -12,6 +12,20 @@ export var jumpVelocity : float = -150
var moveMotion : float = 0 # Player Input ( <- & -> )
var motion : Vector2 = Vector2(0,0) # Player's current velocity
var gui
var interactables = []
func add_interactable(interactable):
interactables.append(interactable)
func remove_interactable(interactable):
var loc = interactables.find(interactable)
if loc >= 0:
interactables.remove(loc)
func _process(delta):
if Input.is_action_just_pressed("ui_accept") and len(interactables) > 0:
interactables[0].interact()
func _physics_process(delta):
@ -20,7 +34,10 @@ func _physics_process(delta):
if is_on_floor():
motion.y = 0
user_input()
if not gui:
gui = get_node("/root/World/GUI")
elif not gui.is_in_dialog():
user_input()
# Apply velocity limits
moveMotion = clamp(moveMotion, -maxMoveVelocity, maxMoveVelocity)
@ -32,6 +49,10 @@ func _physics_process(delta):
func user_input():
if is_on_floor() and Input.is_action_just_pressed("ui_up") and Input.is_action_pressed("ui_down"):
position.y = position.y + 2
return
if(Input.is_action_pressed("ui_left")):
moveMotion -= moveAcceleration
if(Input.is_action_pressed("ui_right")):