diff --git a/Scripts/Board.gd b/Scripts/Board.gd index 490361a..1d055a3 100644 --- a/Scripts/Board.gd +++ b/Scripts/Board.gd @@ -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) diff --git a/Scripts/Chit.gd b/Scripts/Chit.gd new file mode 100644 index 0000000..865af8d --- /dev/null +++ b/Scripts/Chit.gd @@ -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 diff --git a/devlog.md b/devlog.md index 504e10d..4e72bfd 100644 --- a/devlog.md +++ b/devlog.md @@ -1,5 +1,10 @@ # Hexland Devlog +## TODO +- Order indicies by chit placement (center spiral out) +- Docks +- Placement on corners + ## Dane - 08/23/22 @ 2:45 pm A couple of years ago Cole and I make a simple little drag and drop Catan set we called "foreplay". We made it in LOVE, which at the time seemed like a great move until I grew up a little and realized that Godot was infinitely more usable than LOVE. diff --git a/project.godot b/project.godot index e4d148c..7826dd1 100644 --- a/project.godot +++ b/project.godot @@ -14,6 +14,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://Scripts/Board.gd" }, { +"base": "Sprite", +"class": "Chit", +"language": "GDScript", +"path": "res://Scripts/Chit.gd" +}, { "base": "Node2D", "class": "Hex", "language": "GDScript", @@ -21,6 +26,7 @@ _global_script_classes=[ { } ] _global_script_class_icons={ "Board": "", +"Chit": "", "Hex": "" }