proto herbe + forêt

herbe
Valentin Stark 3 years ago
parent abe2611f29
commit de366eb096
  1. 6
      world/World3d.gd
  2. 21
      world/game.tscn
  3. BIN
      world/materials/colors.png

@ -29,9 +29,9 @@ func add_trees():
var poisson_disc_sampling: PoissonDiscSampling = PoissonDiscSampling.new() var poisson_disc_sampling: PoissonDiscSampling = PoissonDiscSampling.new()
for center in Global.terrain.get_centers(): for center in Global.terrain.get_centers():
if not center.get_data("water") and not center.get_data("coast") and not center.get_data("mountain"): if not center.get_data("water"):
var num = rng.randi_range(0,10) var num = rng.randi_range(0,100)
if num == 1: if center.get_data("forest") or num == 1:
var points2d = poisson_disc_sampling.generate_points(3, center.polygon(), 2) var points2d = poisson_disc_sampling.generate_points(3, center.polygon(), 2)
for point in points2d: for point in points2d:
var tree = treescene.instance() var tree = treescene.instance()

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Loading…
Cancel
Save