Setup UI canvas, added shield and game start.
This commit is contained in:
parent
e582ed7ec3
commit
ef773a1ec5
11 changed files with 223 additions and 17 deletions
20
score_counter.gd
Normal file
20
score_counter.gd
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
extends HBoxContainer
|
||||
|
||||
var digit_coords = {
|
||||
1: Vector2(0, 0),
|
||||
2: Vector2(8, 0),
|
||||
3: Vector2(16, 0),
|
||||
4: Vector2(24, 0),
|
||||
5: Vector2(32, 0),
|
||||
6: Vector2(0, 8),
|
||||
7: Vector2(8, 8),
|
||||
8: Vector2(16, 8),
|
||||
9: Vector2(24, 8),
|
||||
0: Vector2(32, 8)
|
||||
}
|
||||
|
||||
func display_digits(n):
|
||||
var s = "%08d" % n
|
||||
for i in 8:
|
||||
get_child(i).texture.region = Rect2(digit_coords[int(s[i])],
|
||||
Vector2(8, 8))
|
||||
Loading…
Add table
Add a link
Reference in a new issue