Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends Node2D
- onready var turn_queue: TurnQueue = $TurnQueue
- onready var player_actions = $CanvasLayer/PlayerActions
- var active := false
- # Called when the node enters the scene tree for the first time.
- func _ready():
- print("test1")
- player_actions.hide()
- var battlers = turn_queue.get_children()
- for battler in battlers:
- battler.initialize()
- turn_queue.initialize()
- print("test2")
- play_intro()
- play_turn()
- func play_intro():
- print("test3")
- for battler in turn_queue.get_children():
- battler.appear()
- print("test4")
- func play_turn():
- var battler: Battler = get_active_battler()
- var targets: Array
- var action: BattleAction
- while not battler.can_move():
- turn_queue.skip_turn()
- battler = get_active_battler()
- battler.selected = true
- # Insert block here where the enemies are obtained based off if the current
- # battler is playable or not, and call an end battle function if there are
- # no enemies
- battler.selected = false
- turn_queue.play_turn(action, targets)
- if active:
- play_turn()
- func get_active_battler() -> Battler:
- return turn_queue.active_battler
Add Comment
Please, Sign In to add comment