campfires tiles now emit light
This commit is contained in:
parent
63689f8e60
commit
e85d786136
|
@ -38,6 +38,12 @@ func _ready():
|
|||
VisualServer.set_default_clear_color(Color(0.0,0.0,0.0,1.0))
|
||||
randomize()
|
||||
$Darkness.visible = true
|
||||
|
||||
for tile in $TileMap.add_light_campfire():
|
||||
var light = preload("res://Campfire_Light.tscn").instance()
|
||||
light.position = tile
|
||||
add_child(light)
|
||||
|
||||
for i in 8:
|
||||
add_relics()
|
||||
$Player.relic_left(relic_left)
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -15,3 +15,11 @@ func random_valid_safe_position(player, tile_name):
|
|||
position_to_player = position.distance_to(player)
|
||||
if position_to_player > 4*32 and position_to_player < 30*32:
|
||||
return(position)
|
||||
|
||||
func add_light_campfire():
|
||||
var clear_tiles = get_used_cells()
|
||||
var light_tiles = []
|
||||
for tile in clear_tiles:
|
||||
if get_cellv(tile) == tile_set.find_tile_by_name("campfire"):
|
||||
light_tiles.append(tile*self.cell_size + cell_size/2)
|
||||
return(light_tiles)
|
||||
|
|
Loading…
Reference in New Issue