allowed more rain!
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Reflection;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
public partial class SettingsController : VBoxContainer
|
public partial class SettingsController : VBoxContainer
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
script = ExtResource("1_k1i8e")
|
script = ExtResource("1_k1i8e")
|
||||||
BrushSize = 1
|
BrushSize = 1
|
||||||
TextureResolution = 0.25
|
TextureResolution = 0.25
|
||||||
RainAmount = 0.0
|
RainAmount = 5.0
|
||||||
|
|
||||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||||
|
|
||||||
@@ -75,6 +75,6 @@ custom_minimum_size = Vector2(150, 0)
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 8
|
size_flags_horizontal = 8
|
||||||
size_flags_vertical = 1
|
size_flags_vertical = 1
|
||||||
max_value = 1.0
|
max_value = 5.0
|
||||||
step = 0.01
|
step = 0.01
|
||||||
value = 1.0
|
value = 1.0
|
||||||
|
|||||||
@@ -45,8 +45,11 @@ public class Level {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void MakeItRain(float rainAmount) {
|
private void MakeItRain(float rainAmount) {
|
||||||
if (GD.Randf() < rainAmount) {
|
int rainDrops = (int)Math.Round(rainAmount);
|
||||||
WritePixel<Water>((int)(GD.Randi() % SizeX), 0, 1);
|
|
||||||
|
for (int i = 0; i <= rainDrops; i++) {
|
||||||
|
if (GD.Randf() < rainAmount)
|
||||||
|
WritePixel<Water>((int)(GD.Randi() % SizeX), 0, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user