generated from krampus/template-godot4
spawn tile check fix
This commit is contained in:
parent
70c49d768c
commit
d4a72156f8
@ -165,12 +165,12 @@ func initialize() -> void:
|
||||
ground.coords = coord
|
||||
ground.position = tile_map.map_to_local(coord)
|
||||
tiles[coord] = ground
|
||||
#var extra_spawn_coord := Vector2i(randi_range(1, max_x - 1), randi_range(1, max_y - 1))
|
||||
#var extra_spawn = [UP_SPAWN, RIGHT_SPAWN, DOWN_SPAWN, LEFT_SPAWN].pick_random().instantiate()
|
||||
#board_state.add_child(extra_spawn)
|
||||
#extra_spawn.coords = extra_spawn_coord
|
||||
#extra_spawn.position = tile_map.map_to_local(extra_spawn_coord)
|
||||
#tiles[extra_spawn_coord] = extra_spawn
|
||||
var extra_spawn_coord := Vector2i(randi_range(1, max_x - 1), randi_range(1, max_y - 1))
|
||||
var extra_spawn = [UP_SPAWN, RIGHT_SPAWN, DOWN_SPAWN, LEFT_SPAWN].pick_random().instantiate()
|
||||
board_state.add_child(extra_spawn)
|
||||
extra_spawn.coords = extra_spawn_coord
|
||||
extra_spawn.position = tile_map.map_to_local(extra_spawn_coord)
|
||||
tiles[extra_spawn_coord] = extra_spawn
|
||||
|
||||
|
||||
static func get_next_direction(direction: Direction, count: int = 1) -> Direction:
|
||||
|
||||
@ -18,7 +18,7 @@ var paused: bool = true
|
||||
func _ready() -> void:
|
||||
match spawn_size:
|
||||
Size.SMALL:
|
||||
spawn_left = 1
|
||||
spawn_left = 10
|
||||
|
||||
|
||||
func pause() -> void:
|
||||
@ -49,3 +49,4 @@ func _physics_process(delta: float) -> void:
|
||||
citizen.position = position
|
||||
citizen.set_offset(Vector2(randf_range(-40, 40), randf_range(-40, 40)))
|
||||
citizen.direction = direction
|
||||
citizen.handle_tile_area_exited(null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user