game1: don't go to next screen until dialogue is fully read and fix ely expressions on campfire2
This commit is contained in:
parent
853b1d01eb
commit
ffd1361dd8
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@
|
||||
[node name="root" type="Node2D"]
|
||||
|
||||
[node name="CampfireBackground" parent="." instance=ExtResource( 2 )]
|
||||
frame = 14
|
||||
frame = 2
|
||||
|
||||
[node name="Herbert" parent="." instance=ExtResource( 1 )]
|
||||
visible = false
|
||||
|
@ -17,6 +17,6 @@ autoplay = true
|
||||
[node name="Ely" type="AnimatedSprite" parent="."]
|
||||
frames = ExtResource( 2 )
|
||||
animation = "idle"
|
||||
frame = 74
|
||||
frame = 53
|
||||
playing = true
|
||||
centered = false
|
||||
|
@ -1,6 +1,6 @@
|
||||
extends Node2D
|
||||
|
||||
onready var ely = $CampfireBackground
|
||||
onready var ely = $CampfireBackground/Ely
|
||||
onready var herbert = $Herbert
|
||||
onready var dialogue_box = $UI/Dialogue
|
||||
onready var the_choice = $TheChoice
|
||||
|
@ -1,5 +1,7 @@
|
||||
extends Node
|
||||
|
||||
signal can_leave
|
||||
|
||||
var playing = false
|
||||
|
||||
onready var player_fab = preload('res://scenes/game1/Player.tscn')
|
||||
@ -23,6 +25,7 @@ export var skipToLevel = ''
|
||||
var current_level = -1
|
||||
var spawn_pos = Vector2()
|
||||
var exit_points = []
|
||||
var can_leave = false
|
||||
|
||||
func _ready():
|
||||
assert(dialogue != null)
|
||||
@ -43,8 +46,13 @@ func _ready():
|
||||
|
||||
$Opening2/Player.sleep = false
|
||||
yield(dialogue_box.start_dialogue(dialogue), 'end')
|
||||
can_leave = true
|
||||
emit_signal("can_leave")
|
||||
|
||||
func start_game():
|
||||
$Opening2/Player.sleep = true
|
||||
if !can_leave:
|
||||
yield(self, 'can_leave')
|
||||
# Hide opening
|
||||
$Opening2.queue_free()
|
||||
next_level()
|
||||
|
@ -1,11 +1,15 @@
|
||||
extends Node2D
|
||||
|
||||
signal can_leave
|
||||
var can_leave = false
|
||||
|
||||
onready var dialogue_box = $UI/Dialog
|
||||
|
||||
#0
|
||||
onready var oil_tanker = $OilTanker
|
||||
onready var crab_0 = $OilTanker/Crab
|
||||
export (String, FILE, "*.json") var dialogue_1
|
||||
var leaving_0 = false
|
||||
|
||||
#1
|
||||
onready var oil_tanker_inside_1 = $InsideOilTanker
|
||||
@ -41,6 +45,8 @@ func _ready():
|
||||
next_trigger_2.connect("body_entered", self, 'end_step_2')
|
||||
|
||||
yield(dialogue_box.start_dialogue(dialogue_1), 'end')
|
||||
can_leave = true
|
||||
emit_signal('can_leave')
|
||||
|
||||
# oil_tanker.frame = 12
|
||||
# end_step_0()
|
||||
@ -51,26 +57,47 @@ func dialogue_2(body : Node):
|
||||
print('end_step_1')
|
||||
if body.name == "Player":
|
||||
yield(dialogue_box.start_dialogue(dialogue_2), 'end')
|
||||
can_leave = true
|
||||
emit_signal('can_leave')
|
||||
|
||||
func end_step_0():
|
||||
print('end_step_0')
|
||||
if crab_0.frame > 1:
|
||||
leaving_0 = true
|
||||
|
||||
if !can_leave:
|
||||
yield(self, 'can_leave')
|
||||
can_leave = false
|
||||
|
||||
oil_tanker.queue_free()
|
||||
player_1.sleep = false
|
||||
|
||||
func end_step_1(body : Node):
|
||||
print('end_step_1')
|
||||
if body.name == "Player":
|
||||
player_1.sleep = true
|
||||
|
||||
if !can_leave:
|
||||
yield(self, 'can_leave')
|
||||
can_leave = false
|
||||
|
||||
oil_tanker_inside_1.queue_free()
|
||||
|
||||
player_2.sleep = false
|
||||
camera_2.current = true
|
||||
yield(dialogue_box.start_dialogue(dialogue_3), 'end')
|
||||
can_leave = true
|
||||
emit_signal('can_leave')
|
||||
|
||||
func end_step_2(body : Node):
|
||||
print('end_step_2')
|
||||
if body.name == "Player":
|
||||
player_2.sleep = true
|
||||
|
||||
if !can_leave:
|
||||
yield(self, 'can_leave')
|
||||
can_leave = false
|
||||
|
||||
yield(dialogue_box.start_dialogue(dialogue_4), 'end')
|
||||
oil_tanker_inside_2.queue_free()
|
||||
herbert_must_go_3.play('default')
|
||||
@ -81,7 +108,7 @@ func end_step_2(body : Node):
|
||||
get_tree().change_scene("res://scenes/campfire2.tscn")
|
||||
|
||||
func _input(event):
|
||||
if oil_tanker != null:
|
||||
if oil_tanker != null && !leaving_0:
|
||||
if event.is_action_pressed('right'):
|
||||
if !crab_0.is_playing():
|
||||
crab_0.play('default')
|
||||
|
Loading…
Reference in New Issue
Block a user