added hud for score

This commit is contained in:
SyntaX 2019-11-23 13:23:00 +01:00
parent 6e4a509867
commit a7914d2a6d
3 changed files with 31 additions and 5 deletions

View File

@ -1,8 +1,10 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://Player/Player.gd" type="Script" id=1]
[ext_resource path="res://Player/Footsteps.gd" type="Script" id=2]
[ext_resource path="res://Resources/Audio/Step.wav" type="AudioStream" id=3]
[ext_resource path="res://Player/UI/HUD.tscn" type="PackedScene" id=4]
[ext_resource path="res://Player/UI/HUD.gd" type="Script" id=5]
[sub_resource type="CylinderShape" id=1]
@ -59,10 +61,6 @@ shape = SubResource( 1 )
autoplay = "Walk"
anims/Walk = SubResource( 2 )
[node name="HUD" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 40.0
[node name="Footsteps" type="Spatial" parent="."]
script = ExtResource( 2 )
@ -70,3 +68,13 @@ script = ExtResource( 2 )
stream = ExtResource( 3 )
unit_db = -25.0
pitch_scale = 1.5
[node name="HUD" parent="." instance=ExtResource( 4 )]
script = ExtResource( 5 )
[node name="LabelScore" type="Label" parent="HUD"]
margin_left = 15.0
margin_top = 15.0
margin_right = 115.0
margin_bottom = 30.0
text = "Score: %score%"

13
WikiJam/Player/UI/HUD.gd Normal file
View File

@ -0,0 +1,13 @@
extends Control
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

View File

@ -0,0 +1,5 @@
[gd_scene format=2]
[node name="HUD" type="Control"]
margin_right = 40.0
margin_bottom = 40.0