mirror of
https://git.kittycat.homes/zoe/pegchamp.git
synced 2024-08-15 03:15:39 +00:00
first commit
This commit is contained in:
commit
fafcbd1530
223 changed files with 107395 additions and 0 deletions
11
HUD/BallCounter.gd
Normal file
11
HUD/BallCounter.gd
Normal 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
21
HUD/HUD.tscn
Normal 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 )
|
Loading…
Add table
Add a link
Reference in a new issue