Godot version of Conway's game of life
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

171 lines
5.3 KiB

[gd_scene load_steps=5 format=3 uid="uid://d3twfk56sjf2m"]
[ext_resource type="Script" path="res://world.gd" id="1_wavft"]
[ext_resource type="Texture2D" uid="uid://c2vm5pfsamed4" path="res://icon.svg" id="2_8r6bn"]
[ext_resource type="PackedScene" uid="uid://cy6vsgu8o0rad" path="res://scenes/fps_counter/fps_counter.tscn" id="3_ves6s"]
[ext_resource type="Texture2D" uid="uid://b8gggrriib8n" path="res://assets/refresh.png" id="4_fcljs"]
[node name="World" type="Node2D"]
position = Vector2(-152, 0)
script = ExtResource("1_wavft")
cell_texture = ExtResource("2_8r6bn")
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(464, 200)
[node name="GenerationTimer" type="Timer" parent="."]
wait_time = 0.05
one_shot = true
[node name="UI" type="CanvasLayer" parent="."]
[node name="Background" type="Control" parent="UI"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="ColorRect" type="ColorRect" parent="UI/Background"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 0.12549)
[node name="Debug" type="MarginContainer" parent="UI"]
visible = false
offset_right = 106.0
offset_bottom = 116.0
[node name="VBoxContainer" type="VBoxContainer" parent="UI/Debug"]
layout_mode = 2
[node name="FPSCounter" parent="UI/Debug/VBoxContainer" instance=ExtResource("3_ves6s")]
layout_mode = 2
text = "FPS: 0"
[node name="WorldSeed" type="Label" parent="UI/Debug/VBoxContainer"]
layout_mode = 2
text = "World Seed: 0"
[node name="GenerationCounter" type="Label" parent="UI/Debug/VBoxContainer"]
layout_mode = 2
text = "Generation: 1"
[node name="LivingCellsCounter" type="Label" parent="UI/Debug/VBoxContainer"]
layout_mode = 2
text = "Living Cells: 0"
[node name="WorldGeneration" type="MarginContainer" parent="UI"]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -173.0
offset_top = -78.0
offset_right = 173.0
offset_bottom = 78.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 4
size_flags_vertical = 4
theme_override_constants/margin_left = 10
theme_override_constants/margin_top = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_bottom = 10
[node name="VBoxContainer" type="VBoxContainer" parent="UI/WorldGeneration"]
layout_mode = 2
[node name="Seed" type="HBoxContainer" parent="UI/WorldGeneration/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 6
[node name="Label" type="Label" parent="UI/WorldGeneration/VBoxContainer/Seed"]
custom_minimum_size = Vector2(120, 0)
layout_mode = 2
text = "Seed"
[node name="Input" type="LineEdit" parent="UI/WorldGeneration/VBoxContainer/Seed"]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
placeholder_text = "Empty for Random"
[node name="Generate" type="Button" parent="UI/WorldGeneration/VBoxContainer/Seed"]
self_modulate = Color(0.501961, 0.501961, 0.501961, 1)
layout_mode = 2
icon = ExtResource("4_fcljs")
[node name="WorldSize" type="HBoxContainer" parent="UI/WorldGeneration/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 6
[node name="Label" type="Label" parent="UI/WorldGeneration/VBoxContainer/WorldSize"]
custom_minimum_size = Vector2(120, 0)
layout_mode = 2
text = "World Size"
[node name="Label_x" type="Label" parent="UI/WorldGeneration/VBoxContainer/WorldSize"]
layout_mode = 2
text = "X:"
[node name="Input_x" type="LineEdit" parent="UI/WorldGeneration/VBoxContainer/WorldSize"]
custom_minimum_size = Vector2(20, 0)
layout_mode = 2
text = "32"
max_length = 4
[node name="Label_y" type="Label" parent="UI/WorldGeneration/VBoxContainer/WorldSize"]
layout_mode = 2
text = "Y:"
[node name="Input_y" type="LineEdit" parent="UI/WorldGeneration/VBoxContainer/WorldSize"]
custom_minimum_size = Vector2(20, 0)
layout_mode = 2
text = "32"
max_length = 4
[node name="CellSize" type="HBoxContainer" parent="UI/WorldGeneration/VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 6
[node name="Label" type="Label" parent="UI/WorldGeneration/VBoxContainer/CellSize"]
custom_minimum_size = Vector2(120, 0)
layout_mode = 2
text = "Cell Size"
[node name="Label_x" type="Label" parent="UI/WorldGeneration/VBoxContainer/CellSize"]
layout_mode = 2
text = "X:"
[node name="Input_x" type="LineEdit" parent="UI/WorldGeneration/VBoxContainer/CellSize"]
custom_minimum_size = Vector2(20, 0)
layout_mode = 2
text = "16"
max_length = 4
[node name="Label_y" type="Label" parent="UI/WorldGeneration/VBoxContainer/CellSize"]
layout_mode = 2
text = "Y:"
[node name="Input_y" type="LineEdit" parent="UI/WorldGeneration/VBoxContainer/CellSize"]
custom_minimum_size = Vector2(20, 0)
layout_mode = 2
text = "16"
max_length = 4
[node name="Submit" type="HBoxContainer" parent="UI/WorldGeneration/VBoxContainer"]
layout_mode = 2
[node name="Button" type="Button" parent="UI/WorldGeneration/VBoxContainer/Submit"]
layout_mode = 2
text = "Start"
[connection signal="timeout" from="GenerationTimer" to="." method="_on_generation_timer_timeout"]
[connection signal="pressed" from="UI/WorldGeneration/VBoxContainer/Seed/Generate" to="." method="_on_world_seed_generate_pressed"]
[connection signal="pressed" from="UI/WorldGeneration/VBoxContainer/Submit/Button" to="." method="_on_generation_submit_pressed"]