瀏覽代碼

Colorize liners

DricomDragon 4 年之前
父節點
當前提交
b653e840d1
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Game.gd

+ 2 - 0
Game.gd

@@ -19,6 +19,7 @@ var levelIndex = -1
 var playerScene = preload("res://Player.tscn")
 var playerActionsLeft = ["p1_left", "p2_left", "p3_left"]
 var playerActionsRight = ["p1_right", "p2_right", "p3_right"]
+export (Array, Color) var playerColors = [Color.red, Color.blue, Color.green, Color.yellow, Color.white, Color.cyan, Color.magenta, Color.orange]
 
 func _ready():
 	for _k in range(levelNames.size()):
@@ -37,6 +38,7 @@ func _ready():
 		player.turn_left_action = playerActionsLeft[k]
 		player.turn_right_action = playerActionsRight[k]
 		player.position = Vector2()
+		player.modulate = playerColors[k]
 		add_child(player)
 
 		start_timer.connect("timeout", player, "_on_round_start")