perspective
This commit is contained in:
parent
fd21d0ed2d
commit
e2b20fc945
2 changed files with 19 additions and 2 deletions
|
@ -1,9 +1,11 @@
|
|||
extends Node2D
|
||||
var talk = load("res://levels/ui/talk.tscn").instantiate()
|
||||
var boss
|
||||
var player
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
boss = $Natasha
|
||||
player = $Player
|
||||
boss.add_to_group("boss")
|
||||
Global.cdialog = [["What are you doing here?", true, 0, 0], ["Your father need help to debug this game", false, 9], ["Ok, i'll help too", true, 0, 0]]
|
||||
Global.live = 0
|
||||
|
@ -12,8 +14,15 @@ func _ready():
|
|||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
if player.position.y < boss.position.y && player.get_index() > boss.get_index():
|
||||
move_child(player, boss.get_index() - 1)
|
||||
print("move up")
|
||||
elif player.position.y > boss.position.y && player.get_index() < boss.get_index():
|
||||
move_child(player, boss.get_index() + 1)
|
||||
print("move down")
|
||||
#pass
|
||||
|
||||
func _input(event):
|
||||
if Global.cdialog.size() == 0:
|
||||
get_tree().root.remove_child(talk)
|
||||
|
||||
|
|
|
@ -1,12 +1,20 @@
|
|||
extends Node2D
|
||||
var boss
|
||||
var player
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
boss = $Lily
|
||||
player = $Player
|
||||
boss.add_to_group("boss")
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
if player.position.y < boss.position.y && player.get_index() > boss.get_index():
|
||||
move_child(player, boss.get_index() - 1)
|
||||
print("move up")
|
||||
elif player.position.y > boss.position.y && player.get_index() < boss.get_index():
|
||||
move_child(player, boss.get_index() + 1)
|
||||
print("move down")
|
||||
#pass
|
||||
|
|
Loading…
Reference in a new issue