Added Grant Blevins
This commit is contained in:
11
client/Scripts/Entities/MusicZone.gd
Normal file
11
client/Scripts/Entities/MusicZone.gd
Normal 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)
|
9
client/Scripts/Entities/NPCs/CEO.gd
Normal file
9
client/Scripts/Entities/NPCs/CEO.gd
Normal 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")
|
@ -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")
|
||||
|
||||
|
@ -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")):
|
||||
|
Reference in New Issue
Block a user