aseprite folder

This commit is contained in:
zoe 2021-12-04 17:19:43 +01:00
parent 570ad5f640
commit a149efb7e9
5 changed files with 18 additions and 4 deletions

BIN
Aseprite/fullscreen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

View file

@ -5,6 +5,15 @@ var pixels_x = []
var active = [] var active = []
var rng var rng
func _process(delta: float) -> void:
step()
step()
step()
step()
func step():
call_deferred("grow")
func _ready(): func _ready():
randomize() randomize()
rng = RandomNumberGenerator.new() rng = RandomNumberGenerator.new()
@ -35,14 +44,18 @@ func plant_seed():
active.append(plant_seed) active.append(plant_seed)
func grow(): func grow():
if (randi() % 2) == 1: if (randi() % 4) >= 1:
new_pixel(active[active.size() - 1]) new_pixel(active[active.size() - 1])
else: else:
new_pixel(active[randi() % active.size()]) new_pixel(active[randi() % active.size()])
func new_pixel(original_pixel): func new_pixel(original_pixel):
var var_x = rng.randi_range(-1, 1) var var_x = rng.randi_range(-1, 1)
var var_y = rng.randi_range(-1, 0) var var_y
if (randi() % 3) == 0:
var_y = rng.randi_range(-1, 1)
# grow regularly
else: var_y = rng.randi_range(-1, 0)
var new_position = Vector2(original_pixel.position) var new_position = Vector2(original_pixel.position)
new_position.x = clamp(new_position.x + var_x, 0, pixels_x.size() - 1) new_position.x = clamp(new_position.x + var_x, 0, pixels_x.size() - 1)
new_position.y = clamp(new_position.y + var_y, 0, pixels_x[new_position.x].size() - 1) new_position.y = clamp(new_position.y + var_y, 0, pixels_x[new_position.x].size() - 1)

View file

@ -6,7 +6,6 @@
script = ExtResource( 2 ) script = ExtResource( 2 )
[node name="Timer" type="Timer" parent="."] [node name="Timer" type="Timer" parent="."]
wait_time = 0.001
autostart = true autostart = true
[connection signal="timeout" from="Timer" to="." method="grow"] [connection signal="timeout" from="Timer" to="." method="step"]

View file

@ -18,6 +18,8 @@ config/icon="res://icon.png"
window/size/width=256 window/size/width=256
window/size/height=144 window/size/height=144
window/size/test_width=1280
window/size/test_height=720
window/stretch/mode="2d" window/stretch/mode="2d"
window/stretch/aspect="keep" window/stretch/aspect="keep"