fix rng
|
@ -1,3 +1,3 @@
|
|||
source_md5="e56323172c35ab6fbd3e177f6e1c97af"
|
||||
dest_md5="dca55ff091eaf824465103f8cc26a901"
|
||||
source_md5="93e7f572b0038afa24d43c51b3a16333"
|
||||
dest_md5="fc7ae29ca7b2f63847191521b213e81f"
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
source_md5="d2c223adbb6b13c83613990e6f18bd10"
|
||||
dest_md5="ca793b2f3d46e3424730440450e8dc84"
|
||||
source_md5="d8d99212e22df5afe49c354a17538b6c"
|
||||
dest_md5="43d5d19fe865943da55ee0d1d1acb042"
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
source_md5="b6f17490b23f497582bddbda05c8d33a"
|
||||
dest_md5="caf6e62ea534f18c8cac891b659e85d8"
|
||||
|
BIN
.import/mouse-export.png-eb9d8f974e073ed3fcac9a6fcb0ed59d.stex
Normal file
3
.import/mouse.png-696f4cca1b0bcc26fbe121cf2289b53b.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="6982b8d2888401bab19e0eb6bc3362ce"
|
||||
dest_md5="0d8f3625f069c03eb3d72769d0d7211f"
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
source_md5="c632c103f99ec61a551cb31ec0143c4f"
|
||||
dest_md5="91acb9457da06ce66a7ab0f91bb93138"
|
||||
source_md5="4de23f4ba366cab25aba36e4770f375a"
|
||||
dest_md5="f1460f412c4dd7b91479c8a41e7c2c47"
|
||||
|
||||
|
|
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 293 B |
|
@ -20,7 +20,7 @@ compress/hdr_mode=0
|
|||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
|
|
Before Width: | Height: | Size: 126 B After Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 162 B After Width: | Height: | Size: 162 B |
18
World/Flower.gd
Normal file
|
@ -0,0 +1,18 @@
|
|||
extends AnimatedSprite
|
||||
|
||||
var can_be_removed = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
frame = 0
|
||||
play("blossom")
|
||||
$Tween.interpolate_property(self, "rotation_degrees", 0, 360, 1, Tween.TRANS_BOUNCE, Tween.EASE_OUT)
|
||||
$Tween.start()
|
||||
|
||||
func remove():
|
||||
can_be_removed = true
|
||||
play("remove")
|
||||
|
||||
func _on_Flower_animation_finished() -> void:
|
||||
if can_be_removed:
|
||||
queue_free()
|
105
World/Flower.tscn
Normal file
|
@ -0,0 +1,105 @@
|
|||
[gd_scene load_steps=22 format=2]
|
||||
|
||||
[ext_resource path="res://Aseprite/flower.png" type="Texture" id=1]
|
||||
[ext_resource path="res://World/Flower.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=12]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 72, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=13]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 63, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=14]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 45, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=15]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 54, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=16]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 36, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=17]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 27, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=18]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 18, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=19]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 9, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=20]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 9, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 18, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 27, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 36, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 45, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=8]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 54, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=9]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 63, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=10]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 72, 0, 9, 9 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ],
|
||||
"loop": false,
|
||||
"name": "remove",
|
||||
"speed": 15.0
|
||||
}, {
|
||||
"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ) ],
|
||||
"loop": false,
|
||||
"name": "blossom",
|
||||
"speed": 15.0
|
||||
} ]
|
||||
|
||||
[node name="Flower" type="AnimatedSprite"]
|
||||
frames = SubResource( 1 )
|
||||
animation = "blossom"
|
||||
frame = 8
|
||||
playing = true
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 60.0
|
||||
autostart = true
|
||||
|
||||
[node name="Tween" type="Tween" parent="."]
|
||||
|
||||
[connection signal="animation_finished" from="." to="." method="_on_Flower_animation_finished"]
|
||||
[connection signal="timeout" from="Timer" to="." method="remove"]
|
|
@ -14,7 +14,7 @@
|
|||
bg_color = Color( 0.14902, 0.0431373, 0.129412, 1 )
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=2]
|
||||
bg_color = Color( 0.94902, 0.988235, 0.878431, 1 )
|
||||
bg_color = Color( 0.517647, 0.745098, 0.929412, 1 )
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_right = 2.0
|
||||
|
||||
|
@ -22,7 +22,7 @@ expand_margin_right = 2.0
|
|||
|
||||
[node name="Plant" parent="." instance=ExtResource( 1 )]
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
[node name="Options" type="Panel" parent="."]
|
||||
margin_left = 236.0
|
||||
margin_top = 2.0
|
||||
margin_right = 254.0
|
||||
|
@ -33,7 +33,7 @@ __meta__ = {
|
|||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FullscreenButton" type="TextureButton" parent="Panel"]
|
||||
[node name="FullscreenButton" type="TextureButton" parent="Options"]
|
||||
margin_left = 1.0
|
||||
margin_top = 123.0
|
||||
margin_right = 17.0
|
||||
|
@ -45,7 +45,7 @@ __meta__ = {
|
|||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MusicVolume" type="VSlider" parent="Panel"]
|
||||
[node name="MusicVolume" type="VSlider" parent="Options"]
|
||||
margin_left = 1.0
|
||||
margin_top = 1.0
|
||||
margin_right = 17.0
|
||||
|
@ -63,8 +63,8 @@ __meta__ = {
|
|||
}
|
||||
bus_channel = "Music"
|
||||
|
||||
[node name="Panel2" type="Panel" parent="."]
|
||||
margin_left = 130.0
|
||||
[node name="RightPanel" type="Panel" parent="."]
|
||||
margin_left = 128.0
|
||||
margin_top = 2.0
|
||||
margin_right = 234.0
|
||||
margin_bottom = 142.0
|
||||
|
@ -74,9 +74,9 @@ __meta__ = {
|
|||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
[node name="Pot" type="Sprite" parent="."]
|
||||
position = Vector2( 64, 136 )
|
||||
texture = ExtResource( 9 )
|
||||
|
||||
[connection signal="pressed" from="Panel/FullscreenButton" to="Panel/FullscreenButton" method="_on_FullscreenButton_pressed"]
|
||||
[connection signal="value_changed" from="Panel/MusicVolume" to="Panel/MusicVolume" method="_on_MusicVolume_value_changed"]
|
||||
[connection signal="pressed" from="Options/FullscreenButton" to="Options/FullscreenButton" method="_on_FullscreenButton_pressed"]
|
||||
[connection signal="value_changed" from="Options/MusicVolume" to="Options/MusicVolume" method="_on_MusicVolume_value_changed"]
|
||||
|
|
|
@ -4,21 +4,27 @@ export var size = Vector2()
|
|||
var pixels_x = []
|
||||
var active = []
|
||||
var rng
|
||||
var branches = 4
|
||||
|
||||
func _process(_delta):
|
||||
# step()
|
||||
step()
|
||||
pass
|
||||
|
||||
func step():
|
||||
call_deferred("grow")
|
||||
if randi() % 400 == 0:
|
||||
blossom()
|
||||
|
||||
func _ready():
|
||||
randomize()
|
||||
rng = RandomNumberGenerator.new()
|
||||
rng.randomize()
|
||||
size.x = ProjectSettings.get_setting("display/window/size/width") / 2
|
||||
size.y = ProjectSettings.get_setting("display/window/size/height")
|
||||
call_deferred("spawn_pixels")
|
||||
call_deferred("plant_seed")
|
||||
branches = rng.randi_range(2, 24)
|
||||
print(branches)
|
||||
|
||||
func spawn_pixels():
|
||||
for n in size.x:
|
||||
|
@ -42,7 +48,7 @@ func plant_seed():
|
|||
active.append(plant_seed)
|
||||
|
||||
func grow():
|
||||
if (randi() % 4) >= 1:
|
||||
if (randi() % branches) >= 1:
|
||||
new_pixel(active[active.size() - 1])
|
||||
else:
|
||||
new_pixel(active[randi() % active.size()])
|
||||
|
@ -63,3 +69,10 @@ func new_pixel(original_pixel):
|
|||
active.append(new_pixel)
|
||||
new_pixel.age_up()
|
||||
|
||||
|
||||
func blossom():
|
||||
var Flower = preload("res://World/Flower.tscn")
|
||||
var flower = Flower.instance()
|
||||
var main = get_tree().current_scene
|
||||
flower.global_position = active[randi() % active.size()].position
|
||||
main.add_child(flower)
|
||||
|
|
BIN
mouse-export.png
Normal file
After Width: | Height: | Size: 525 B |
35
mouse-export.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/mouse-export.png-eb9d8f974e073ed3fcac9a6fcb0ed59d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://mouse-export.png"
|
||||
dest_files=[ "res://.import/mouse-export.png-eb9d8f974e073ed3fcac9a6fcb0ed59d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
|
@ -51,11 +51,19 @@ texture={
|
|||
"svg/scale": 1.0
|
||||
}
|
||||
|
||||
[input]
|
||||
|
||||
click={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
[rendering]
|
||||
|
||||
environment/default_clear_color=Color( 0.94902, 0.988235, 0.878431, 1 )
|
||||
environment/default_clear_color=Color( 0.517647, 0.745098, 0.929412, 1 )
|
||||
environment/default_environment="res://default_env.tres"
|
||||
|
|