first commit

This commit is contained in:
zoe-bat 2021-09-08 10:27:14 +02:00
commit fafcbd1530
223 changed files with 107395 additions and 0 deletions

11
HUD/BallCounter.gd Normal file
View file

@ -0,0 +1,11 @@
extends Sprite
func _ready():
var _balls_connection = GameStats.connect("balls_changed", self, "set_balls")
set_balls()
func set_balls():
if GameStats.balls_left >= 1:
var old_region_size = get_region_rect().size.y
var new_region = Rect2(0, 0, old_region_size * GameStats.balls_left - old_region_size, old_region_size)
set_region_rect(new_region)

21
HUD/HUD.tscn Normal file
View file

@ -0,0 +1,21 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Ball/sprite.png" type="Texture" id=1]
[ext_resource path="res://HUD/BallCounter.gd" type="Script" id=2]
[node name="HUD" type="CanvasLayer"]
[node name="Control" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 40.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="BallCounter" type="Sprite" parent="Control"]
z_index = 100
texture = ExtResource( 1 )
centered = false
region_enabled = true
region_rect = Rect2( 0, 0, 16, 16 )
script = ExtResource( 2 )