Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dedztbh committed Apr 21, 2024
1 parent 93df0e9 commit ac89018
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
2 changes: 1 addition & 1 deletion game/FPSCounter.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ func _ready():

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
text = str(int(Engine.get_frames_per_second()))
text = str(int(Engine.get_frames_per_second())) + " FPS"

12 changes: 12 additions & 0 deletions game/License.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends Label


# Called when the node enters the scene tree for the first time.
func _ready():
text = Engine.get_license_text()


func _unhandled_input(event):
if event is InputEventKey:
if event.pressed and event.keycode == KEY_L:
visible = !visible
6 changes: 3 additions & 3 deletions game/board.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ extends GridContainer

signal next_iteration

var life_driver : LifeDriver
var cells : Array
var cells = []
var life_driver = LifeDriver.new()

# Called when the node enters the scene tree for the first time.
func _ready():
Expand All @@ -14,7 +14,7 @@ func _ready():
new_cell.custom_minimum_size = Vector2(10, 10)
add_child(new_cell)
cells[-1].append(new_cell)
life_driver = LifeDriver.new()

life_driver.update_cell.connect(_update_cell)
life_driver.update_done.connect(_update_done)
next_iteration.connect(life_driver.next_iteration)
Expand Down
24 changes: 16 additions & 8 deletions game/main.tscn
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
[gd_scene load_steps=4 format=3 uid="uid://dss4vqph6ixgk"]
[gd_scene load_steps=5 format=3 uid="uid://dss4vqph6ixgk"]

[ext_resource type="PackedScene" uid="uid://djahqxlcbinjp" path="res://board.tscn" id="1_i8xh8"]
[ext_resource type="Script" path="res://FPSCounter.gd" id="2_avnxl"]
[ext_resource type="Script" path="res://License.gd" id="2_qsvb4"]
[ext_resource type="Script" path="res://Camera2D.gd" id="2_wwmnb"]

[node name="Main" type="Node"]

[node name="CanvasLayer" type="CanvasLayer" parent="."]

[node name="FPSCounter" type="Label" parent="CanvasLayer"]
offset_left = 12.0
offset_top = 8.0
offset_right = 52.0
offset_bottom = 31.0
script = ExtResource("2_avnxl")

[node name="License" type="Label" parent="CanvasLayer"]
offset_right = 40.0
offset_bottom = 23.0
script = ExtResource("2_qsvb4")

[node name="Camera2D" type="Camera2D" parent="."]
offset = Vector2(500, 300)
script = ExtResource("2_wwmnb")
speed = 500
zoom_speed = 0.5
min_zoom = 1.0

[node name="FPSCounter" type="Label" parent="Camera2D"]
offset_left = -41.0
offset_top = -24.0
offset_right = -1.0
offset_bottom = -1.0
script = ExtResource("2_avnxl")

[node name="Board" parent="." instance=ExtResource("1_i8xh8")]
columns = 100

0 comments on commit ac89018

Please sign in to comment.