浏览代码

Randomize life at brick spawn

DricomDragon 3 年之前
父节点
当前提交
6834a3f2c7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      godot/scripts/LifeContainer.gd

+ 1 - 1
godot/scripts/LifeContainer.gd

@@ -11,7 +11,7 @@ const rect_pad = Vector2(3, 3)
 
 
 func spawn_brick(x, y, maximum_life):
-	living_cells[Vector2(x, y)] = maximum_life
+	living_cells[Vector2(x, y)] = randi() % maximum_life + 1
 	update()