You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
677 B
23 lines
677 B
extends BaseInventory
|
|
|
|
var rand:RandomNumberGenerator = RandomNumberGenerator.new()
|
|
|
|
|
|
func _ready():
|
|
rand.randomize()
|
|
|
|
|
|
func _on_raceCar_road_entered(road):
|
|
if is_network_master():
|
|
if player != null:
|
|
if player.is_in_group("first"):
|
|
if route.get_last_road().get_index() <= (road.get_index() +2):
|
|
type = rand.randi_range(0,roads.size() -2) # TODO: remove special, loop need fixes!
|
|
index = rand.randi_range(0, roads[type].size() -1)
|
|
route.set_road(roads[type][index], -1)
|
|
route.rpc("set_road", roads[type][index], -1)
|
|
|
|
|
|
func set_player(new_player:Player):
|
|
player = new_player
|
|
player.race_car.connect("road_entered",self,"_on_raceCar_road_entered")
|