|
@@ -1,13 +1,24 @@
|
|
|
extends Node2D
|
|
|
|
|
|
onready var cam = $MainCamera
|
|
|
+onready var level = $Grid
|
|
|
var players = []
|
|
|
var dist_max = 900
|
|
|
var zoom_rate = 0.001
|
|
|
|
|
|
+var playerScene = preload("res://Player.tscn")
|
|
|
+
|
|
|
func _ready():
|
|
|
- players.append($Player1)
|
|
|
- players.append($Player2)
|
|
|
+ var player
|
|
|
+
|
|
|
+ # Player 1
|
|
|
+ player = playerScene.instance()
|
|
|
+ player.grid = level
|
|
|
+ player.turn_left_action = "player_1_turn_left"
|
|
|
+ player.turn_right_action = "player_1_turn_right"
|
|
|
+ player.position = Vector2(4 * 64 + 32, 8 * 64 + 32)
|
|
|
+ players.append(player) # TODO : use groups
|
|
|
+ add_child(player)
|
|
|
|
|
|
func _process(d):
|
|
|
center_camera()
|