grid with randomly assigned token types out of 4 choices

This commit is contained in:
Jack Case
2025-08-18 20:44:32 -04:00
parent cb2caa44cd
commit 9526275e3d
5 changed files with 44 additions and 5 deletions

20
token.gd Normal file
View File

@@ -0,0 +1,20 @@
extends Node2D
enum token_type {TYPE_1, TYPE_2, TYPE_3, TYPE_4}
var type: token_type = token_type.TYPE_1
var color_polygon
func _ready():
color_polygon = $Color
type = randi_range(0, 3)
match type:
token_type.TYPE_1:
color_polygon.color = Color.RED
token_type.TYPE_2:
color_polygon.color = Color.GREEN
token_type.TYPE_3:
color_polygon.color = Color.BLUE
token_type.TYPE_4:
color_polygon.color = Color.YELLOW