Different challenge solution

I made a Global.gd to remember how it was made and declared color_change() in Torch.gd file.

PlayerDetection.gd:

func _process(delta):
    torch.change_color(player_is_in_FOV())

Torch.gd:

func change_color(player_in_fov):
    if player_in_fov:
	light2d.color = RED
    else:
	light2d.color = WHITE
1 Like

Very nice!

Privacy & Terms