소스 검색

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()