mirror of
https://github.com/GarrettGunnell/God-Machine.git
synced 2025-10-19 14:43:16 +00:00
Implement basic random button
This commit is contained in:
parent
6b1820236f
commit
56c2094d04
2 changed files with 10 additions and 6 deletions
|
@ -47,7 +47,7 @@ needs_motion_vectors = false
|
||||||
needs_normal_roughness = false
|
needs_normal_roughness = false
|
||||||
script = ExtResource("1_vlji8")
|
script = ExtResource("1_vlji8")
|
||||||
pause = false
|
pause = false
|
||||||
update_speed = 0.001
|
update_speed = 0.026
|
||||||
exposure = Vector4(2, 1, 1, 1)
|
exposure = Vector4(2, 1, 1, 1)
|
||||||
metadata/_custom_type_script = "uid://drfxlavovcgta"
|
metadata/_custom_type_script = "uid://drfxlavovcgta"
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,12 @@ func _ready() -> void:
|
||||||
|
|
||||||
func on_pressed() -> void:
|
func on_pressed() -> void:
|
||||||
randomize()
|
randomize()
|
||||||
for x in range(-7, 8):
|
|
||||||
for y in range(-7, 8):
|
var cell_coord = Vector2i(randi() % 15 - 7, randi() % 15 - 7)
|
||||||
var cell_coord = Vector2i(x, y)
|
grid.set_cell(cell_coord, 1, Vector2i(1, 0), 0)
|
||||||
var random_cell_value = 1 if randf() > randf() else 0
|
|
||||||
grid.set_cell(cell_coord, 1, Vector2i(random_cell_value, 0), 0)
|
func on_alternate_pressed() -> void:
|
||||||
|
randomize()
|
||||||
|
|
||||||
|
var cell_coord = Vector2i(randi() % 15 - 7, randi() % 15 - 7)
|
||||||
|
grid.set_cell(cell_coord, 1, Vector2i(0, 0), 0)
|
Loading…
Add table
Add a link
Reference in a new issue