Made some changes :)

This commit is contained in:
pennyrigate 2022-12-08 23:28:49 -05:00
parent 038935709f
commit 8f6a068eba
76 changed files with 889 additions and 36 deletions

7
objects/hud/blocktext.gd Normal file
View file

@ -0,0 +1,7 @@
extends Node2D
func _ready():
$AnimationPlayer.play("block")
func _on_AnimationPlayer_animation_finished(anim_name):
queue_free()

View file

@ -0,0 +1,51 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://scripts/1px_border.gdshader" type="Shader" id=1]
[ext_resource path="res://objects/hud/blocktext.gd" type="Script" id=2]
[ext_resource path="res://graphics/hud/block_text.png" type="Texture" id=3]
[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 1 )
shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = false
[sub_resource type="Animation" id=2]
resource_name = "block"
length = 0.3
step = 0.15
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 0, -8 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.15, 0.3 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
}
[node name="BlockText" type="Node2D"]
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
material = SubResource( 1 )
texture = ExtResource( 3 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/block = SubResource( 2 )
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]

24
objects/hud/hud.gd Normal file
View file

@ -0,0 +1,24 @@
extends Control
onready var gold_counter = $GoldCounter
onready var shard_counter = $ShardCounter
onready var red_star = $RedStar
onready var yellow_star = $YellowStar
onready var green_star = $GreenStar
onready var blue_star = $BlueStar
onready var magenta_star = $MagentaStar
onready var score_counter = $ScoreCounter
func _physics_process(delta):
#Gold Counter
gold_counter.text = "%03d" % Game.golds
#Shard Counter
shard_counter.text = "%02d" % Game.shards
#Star Counter
red_star.visible = Game.stars[0]
yellow_star.visible = Game.stars[1]
green_star.visible = Game.stars[2]
blue_star.visible = Game.stars[3]
magenta_star.visible = Game.stars[4]
#Score Counter
score_counter.text = "%06d" % Game.score

113
objects/hud/hud.tscn Normal file
View file

@ -0,0 +1,113 @@
[gd_scene load_steps=16 format=2]
[ext_resource path="res://scripts/recolor.tres" type="Shader" id=1]
[ext_resource path="res://graphics/collectibles/pal_star_yellow.png" type="Texture" id=2]
[ext_resource path="res://graphics/hud/hud.png" type="Texture" id=3]
[ext_resource path="res://graphics/collectibles/star.png" type="Texture" id=4]
[ext_resource path="res://graphics/collectibles/pal_star_red.png" type="Texture" id=5]
[ext_resource path="res://objects/hud/hud.gd" type="Script" id=6]
[ext_resource path="res://graphics/collectibles/pal_star_green.png" type="Texture" id=7]
[ext_resource path="res://graphics/collectibles/pal_star_blue.png" type="Texture" id=8]
[ext_resource path="res://graphics/collectibles/pal_star_magenta.png" type="Texture" id=9]
[ext_resource path="res://scripts/theme.tres" type="Theme" id=10]
[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 1 )
shader_param/palette = ExtResource( 5 )
[sub_resource type="ShaderMaterial" id=2]
shader = ExtResource( 1 )
shader_param/palette = ExtResource( 2 )
[sub_resource type="ShaderMaterial" id=3]
shader = ExtResource( 1 )
shader_param/palette = ExtResource( 7 )
[sub_resource type="ShaderMaterial" id=4]
shader = ExtResource( 1 )
shader_param/palette = ExtResource( 8 )
[sub_resource type="ShaderMaterial" id=5]
shader = ExtResource( 1 )
shader_param/palette = ExtResource( 9 )
[node name="HUD" type="Control"]
margin_top = 1.0
margin_bottom = 1.0
script = ExtResource( 6 )
[node name="Back" type="Sprite" parent="."]
position = Vector2( 128, 8 )
texture = ExtResource( 3 )
[node name="GoldCounter" type="Label" parent="."]
margin_left = 14.0
margin_top = 1.0
margin_right = 54.0
margin_bottom = 21.0
theme = ExtResource( 10 )
text = "000"
[node name="ShardCounter" type="Label" parent="."]
margin_left = 53.0
margin_top = 1.0
margin_right = 93.0
margin_bottom = 21.0
theme = ExtResource( 10 )
text = "00"
[node name="RedStar" type="Sprite" parent="."]
visible = false
material = SubResource( 1 )
position = Vector2( 79, 8 )
texture = ExtResource( 4 )
region_enabled = true
region_rect = Rect2( 0, 0, 11, 11 )
[node name="YellowStar" type="Sprite" parent="."]
visible = false
material = SubResource( 2 )
position = Vector2( 92, 8 )
texture = ExtResource( 4 )
region_enabled = true
region_rect = Rect2( 0, 0, 11, 11 )
[node name="GreenStar" type="Sprite" parent="."]
visible = false
material = SubResource( 3 )
position = Vector2( 105, 8 )
texture = ExtResource( 4 )
region_enabled = true
region_rect = Rect2( 0, 0, 11, 11 )
[node name="BlueStar" type="Sprite" parent="."]
visible = false
material = SubResource( 4 )
position = Vector2( 118, 8 )
texture = ExtResource( 4 )
region_enabled = true
region_rect = Rect2( 0, 0, 11, 11 )
[node name="MagentaStar" type="Sprite" parent="."]
visible = false
material = SubResource( 5 )
position = Vector2( 131, 8 )
texture = ExtResource( 4 )
region_enabled = true
region_rect = Rect2( 0, 0, 11, 11 )
[node name="ScoreText" type="Label" parent="."]
margin_left = 142.0
margin_top = 1.0
margin_right = 226.0
margin_bottom = 21.0
theme = ExtResource( 10 )
text = "SCORE:"
[node name="ScoreCounter" type="Label" parent="."]
margin_left = 180.0
margin_top = 1.0
margin_right = 264.0
margin_bottom = 21.0
theme = ExtResource( 10 )
text = "000000"