Added chits
This commit is contained in:
@@ -19,6 +19,7 @@ export(Dictionary) var distribution = {
|
||||
export(Array, int) var chits = []
|
||||
|
||||
func _ready():
|
||||
## Place Tiles
|
||||
var tiles = []
|
||||
for tile in distribution:
|
||||
for _i in range(distribution[tile]):
|
||||
@@ -33,3 +34,7 @@ func _ready():
|
||||
add_child(hex)
|
||||
hex.type = tiles.pop_front()
|
||||
hex.index = index
|
||||
if hex.type != "desert":
|
||||
var chit = Chit.new()
|
||||
chit.setup(chits.pop_front())
|
||||
hex.add_child(chit)
|
||||
|
||||
12
Scripts/Chit.gd
Normal file
12
Scripts/Chit.gd
Normal file
@@ -0,0 +1,12 @@
|
||||
extends Sprite
|
||||
|
||||
class_name Chit
|
||||
|
||||
const CHIT_SCALE = 0.1
|
||||
|
||||
var num = 6
|
||||
|
||||
func setup(num):
|
||||
self.num = num
|
||||
texture = load("res://Assets/%d-chit.png" % num)
|
||||
scale *= CHIT_SCALE
|
||||
Reference in New Issue
Block a user