blob: 43856d5abb22015f9e8c7d47125479a0aa58c328 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
class_name Player
extends Resource
signal score_changed
var id := 1
var towers: Dictionary :
set(value):
towers = value
var score: int :
set(value):
score = value
score_changed.emit()
var units: Array[Unit]
func get_color():
if id == 1:
return Color("#fff")
var rng = RandomNumberGenerator.new()
rng.seed = id
@warning_ignore("integer_division")
return Color(rng.randf(), rng.randf(), rng.randf())
func get_rpc_properties() -> Dictionary:
return {
"id": null,
"score": null,
}
|