From f9ec2e855d65069cbb0a59ede647fa76846e275c Mon Sep 17 00:00:00 2001 From: MartinOpat Date: Tue, 11 Nov 2025 00:23:12 +0100 Subject: [PATCH] Switched 'intensive' functions to cpp --- game-of-life-test/gol.gd | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/game-of-life-test/gol.gd b/game-of-life-test/gol.gd index 5882f2b..c643c73 100644 --- a/game-of-life-test/gol.gd +++ b/game-of-life-test/gol.gd @@ -1,15 +1,17 @@ extends Sprite2D -var n: int = 64 +var n: int = 256 var arr := [] var data_img: Image var data_tex: ImageTexture +var gol := GoL.new() + @onready var mat: ShaderMaterial = material as ShaderMaterial # sim. consts -var T := 0.1 +var T := 0.01 var t := 0.0 # Called when the node enters the scene tree for the first time. @@ -38,7 +40,8 @@ func _process(_delta: float) -> void: t += _delta if t >= T: t = 0.0 - _game_of_life_step() + #_game_of_life_step() + arr = gol.step_once(arr, n) # cpp step _upload_arr() func _game_of_life_step() -> void: