conways-life

Conway's game of life in Godot4
git clone git://bsandro.tech/conways-life
Log | Files | Refs | README | LICENSE

Cell.gd (422B)


      1 class_name Cell
      2 
      3 extends Sprite2D
      4 
      5 var is_alive:bool = false
      6 var is_alive_next:bool = false
      7 
      8 # Called when the node enters the scene tree for the first time.
      9 func _ready():
     10 	pass # Replace with function body.
     11 
     12 # Called every frame. 'delta' is the elapsed time since the previous frame.
     13 func _process(_delta):
     14 	pass
     15 
     16 func val():
     17 	return 1 if is_alive else 0
     18 
     19 func update():
     20 	is_alive = is_alive_next
     21 	is_alive_next = false