grid with randomly assigned token types out of 4 choices
This commit is contained in:
20
token.gd
Normal file
20
token.gd
Normal 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
|
||||
Reference in New Issue
Block a user