mirror of
https://github.com/Relintai/broken_seals_2d.git
synced 2024-11-11 20:35:10 +01:00
Spawn a few mobs randomly.
This commit is contained in:
parent
4d6c60a859
commit
9134e7812f
@ -71,8 +71,8 @@ func load_character(file_name: String) -> void:
|
||||
|
||||
spawn(world_pos.x / (cell_size_x * chunk_size_x), world_pos.y / (cell_size_y * chunk_size_x))
|
||||
|
||||
#if spawn_mobs:
|
||||
# generate()
|
||||
if spawn_mobs:
|
||||
generate()
|
||||
|
||||
func _create_chunk(x, y, chunk):
|
||||
if !chunk:
|
||||
@ -106,8 +106,16 @@ func _create_chunk(x, y, chunk):
|
||||
return ._create_chunk(x, y, chunk)
|
||||
|
||||
func generate() -> void:
|
||||
for x in range(-2, 2):
|
||||
for y in range(-2, 2):
|
||||
if Engine.is_editor_hint():
|
||||
return
|
||||
|
||||
# for x in range(-2, 2):
|
||||
# for y in range(-2, 2):
|
||||
# ESS.entity_spawner.spawn_mob(1, 50, Vector2(x * 200, y * 200))
|
||||
|
||||
for i in range(10):
|
||||
var x : float = rand_range(1, 4)
|
||||
var y : float = rand_range(1, 4)
|
||||
ESS.entity_spawner.spawn_mob(1, 50, Vector2(x * 200, y * 200))
|
||||
|
||||
func save() -> void:
|
||||
|
Loading…
Reference in New Issue
Block a user