level clear
This commit is contained in:
parent
23ce8d32f8
commit
45db4b4f64
11 changed files with 60 additions and 18 deletions
|
@ -24,9 +24,21 @@ func _physics_process(delta):
|
|||
elif player.position.y > boss.position.y && player.get_index() < boss.get_index():
|
||||
move_child(player, boss.get_index() + 1)
|
||||
print("move down")
|
||||
if Global.debug:
|
||||
if Global.dstats[Global.dparty[0][0]][0] <= 0 && Global.live == 1:
|
||||
_winner()
|
||||
else:
|
||||
if Global.cstats[Global.party[0][0]][0] <= 0 && Global.live == 1:
|
||||
_winner()
|
||||
|
||||
func _input(event):
|
||||
if Global.cdialog.size() != 0 && Global.live == 1:
|
||||
get_tree().root.remove_child(talk)
|
||||
Global.cdialog = []
|
||||
|
||||
func _winner():
|
||||
Global.cdialog = [[tr("DIALOG_CERES_L20_3"), true, 0, 0], [tr("DIALOG_CERES_L20_4"), false, 3], [tr("DIALOG_CERES_L20_5"), true, 0, 0]]
|
||||
Global.live = 3
|
||||
#talk.queue_free()
|
||||
talk = load("res://levels/ui/talk.tscn").instantiate()
|
||||
get_tree().root.add_child.call(talk)
|
||||
|
|
|
@ -29,4 +29,14 @@ func _input(event):
|
|||
if Global.cdialog.size() != 0 && Global.live == 1:
|
||||
get_tree().root.remove_child(talk)
|
||||
Global.cdialog = []
|
||||
if Global.cboss[1] <= 0 && Global.live == 1:
|
||||
_winner()
|
||||
|
||||
|
||||
|
||||
func _winner():
|
||||
Global.cdialog = [[tr("DIALOG_DANMAKUTEST_3"), true, 0, 0], [tr("DIALOG_DANMAKUTEST_4"), false, 9], [tr("DIALOG_DANMAKUTEST_5"), true, 0, 0]]
|
||||
Global.live = 3
|
||||
#talk.queue_free()
|
||||
talk = load("res://levels/ui/talk.tscn").instantiate()
|
||||
get_tree().root.add_child.call(talk)
|
||||
|
|
|
@ -58,13 +58,15 @@ func _input(event):
|
|||
get_tree().change_scene_to_file("res://title.tscn")
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
if Global.cutscenes[Global.ccutscene][3]:
|
||||
var ccutscene = Global.ccutscene
|
||||
Global.ccutscene = null
|
||||
get_tree().root.remove_child(bhud)
|
||||
get_tree().root.remove_child(level)
|
||||
bgsound.stop()
|
||||
if Global.debug:
|
||||
get_tree().change_scene_to_file("res://levels/ui/scene.tscn")
|
||||
else:
|
||||
get_tree().change_scene_to_file(Global.cutscenes[Global.ccutscene][1])
|
||||
get_tree().change_scene_to_file(Global.cutscenes[ccutscene][1])
|
||||
else:
|
||||
Global.ccutscene += 1
|
||||
get_tree().root.remove_child(level)
|
||||
|
|
|
@ -53,7 +53,7 @@ func _ready():
|
|||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
var velocity = Vector2.ZERO
|
||||
if Global.live == 6:
|
||||
if Global.live > 4 && Global.live < 9:
|
||||
_exit()
|
||||
#velocity = (Vector2.RIGHT.rotated(rotation) * -100 * Global.xm * delta)-Vector2.UP.rotated(rotation) * -100 * Global.ym * delta
|
||||
|
||||
|
@ -150,8 +150,14 @@ func _exit():
|
|||
# get_tree().root.remove_child(bhud)
|
||||
#get_tree().root.remove_child(player)
|
||||
get_tree().root.remove_child(level)
|
||||
Global.live = 0
|
||||
if Global.debug:
|
||||
get_tree().change_scene_to_file("res://levels/ui/scene.tscn")
|
||||
else:
|
||||
get_tree().change_scene_to_file("res://title.tscn")
|
||||
if Global.live == 7:
|
||||
get_tree().change_scene_to_file("res://backgounds/result.tscn")
|
||||
elif Global.live == 8:
|
||||
get_tree().change_scene_to_file("res://levels/ui/Cutscenes.tscn")
|
||||
elif Global.live == 6:
|
||||
if Global.debug:
|
||||
Global.live = 0
|
||||
get_tree().change_scene_to_file("res://levels/ui/scene.tscn")
|
||||
else:
|
||||
Global.live = 0
|
||||
get_tree().change_scene_to_file("res://title.tscn")
|
||||
|
|
|
@ -42,7 +42,15 @@ func _input(event):
|
|||
isboss = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][2]
|
||||
else:
|
||||
isboss = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][2]
|
||||
if isboss:
|
||||
Global.bossready = true
|
||||
Global.live = 1
|
||||
if Global.live == 0:
|
||||
if isboss:
|
||||
Global.bossready = true
|
||||
Global.live = 1
|
||||
queue_free()
|
||||
elif Global.live == 3:
|
||||
if Global.ccutscene == null:
|
||||
Global.live = 7
|
||||
else:
|
||||
Global.live = 8
|
||||
queue_free()
|
||||
press = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue