From a149efb7e97906de95e0c7a6acb64f585e3b5c51 Mon Sep 17 00:00:00 2001 From: zoe Date: Sat, 4 Dec 2021 17:19:43 +0100 Subject: [PATCH] aseprite folder --- Aseprite/fullscreen.png | Bin 0 -> 88 bytes Aseprite/palette_pastelapple-1x.png | Bin 0 -> 187 bytes World/Plant.gd | 17 +++++++++++++++-- World/Plant.tscn | 3 +-- project.godot | 2 ++ 5 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 Aseprite/fullscreen.png create mode 100644 Aseprite/palette_pastelapple-1x.png diff --git a/Aseprite/fullscreen.png b/Aseprite/fullscreen.png new file mode 100644 index 0000000000000000000000000000000000000000..5e4988e6b2bfa35a4512b02b86013e071bb13b02 GIT binary patch literal 88 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|ggjjwLo9le j6C_v{Cy4YgaWF8j2rw|#`&RS;Wf?qO{an^LB{Ts5=Rgvz literal 0 HcmV?d00001 diff --git a/Aseprite/palette_pastelapple-1x.png b/Aseprite/palette_pastelapple-1x.png new file mode 100644 index 0000000000000000000000000000000000000000..877c9bc84214dd3174936c9927891d720c350e0a GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^VnEEu!3-qd?p&t@q?`hLLR?KdBHfn7gdGf@_&9Ul z+m@Gq)_?l*;QRYY-}mKwZclg?;&Rr^eY2L&EEVrY8NVn&M>TH6d79?!2I_e_QhrK& z8bYj2zr#KOP2()^h%9Dc;5!1sj8nDwq=AC+o-U3d95a&>5>k@V5>u0(KX~%!*~6!g g#RWu!!~|Ix*qIn!@cqb51S)0lboFyt=akR{0CFWh7ytkO literal 0 HcmV?d00001 diff --git a/World/Plant.gd b/World/Plant.gd index c425635..1986721 100644 --- a/World/Plant.gd +++ b/World/Plant.gd @@ -5,6 +5,15 @@ var pixels_x = [] var active = [] var rng +func _process(delta: float) -> void: + step() + step() + step() + step() + +func step(): + call_deferred("grow") + func _ready(): randomize() rng = RandomNumberGenerator.new() @@ -35,14 +44,18 @@ func plant_seed(): active.append(plant_seed) func grow(): - if (randi() % 2) == 1: + if (randi() % 4) >= 1: new_pixel(active[active.size() - 1]) else: new_pixel(active[randi() % active.size()]) func new_pixel(original_pixel): 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) 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) diff --git a/World/Plant.tscn b/World/Plant.tscn index 44b52a3..99fe46c 100644 --- a/World/Plant.tscn +++ b/World/Plant.tscn @@ -6,7 +6,6 @@ script = ExtResource( 2 ) [node name="Timer" type="Timer" parent="."] -wait_time = 0.001 autostart = true -[connection signal="timeout" from="Timer" to="." method="grow"] +[connection signal="timeout" from="Timer" to="." method="step"] diff --git a/project.godot b/project.godot index 7251fe3..7eea425 100644 --- a/project.godot +++ b/project.godot @@ -18,6 +18,8 @@ config/icon="res://icon.png" window/size/width=256 window/size/height=144 +window/size/test_width=1280 +window/size/test_height=720 window/stretch/mode="2d" window/stretch/aspect="keep"