From 435855cd5b2d5b086aa5ca8c26da1bdf47201c4c Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Sun, 8 Oct 2023 17:42:52 -0400 Subject: [PATCH] begin work on results screen --- menus/results.gd | 20 +- menus/results.tscn | 526 +++++++++++++++++++++++++--------------- menus/results_icon.gd | 17 +- menus/results_icon.tscn | 107 +++++++- 4 files changed, 443 insertions(+), 227 deletions(-) diff --git a/menus/results.gd b/menus/results.gd index 9cfab7a..0c64e64 100644 --- a/menus/results.gd +++ b/menus/results.gd @@ -2,12 +2,14 @@ extends Node onready var shards: Node2D = $Shards -onready var collection_bonus: Sprite = $Bonuses/CollectionBonus -onready var time_bonus: Sprite = $Bonuses/TimeBonus -onready var life_bonus: Sprite = $Bonuses/LifeBonus -onready var perfect_bonus: Sprite = $Bonuses/PerfectBonus +onready var score = $Score onready var final_score: Label = $FinalScore - +#Score bonuses +onready var collection_bonus_score = $ShardsAndBonuses/Bonuses/CollectionBonus/CollectionBonusScore +onready var time_bonus_score = $ShardsAndBonuses/Bonuses/TimeBonus/TimeBonusScore +onready var life_bonus_score = $ShardsAndBonuses/Bonuses/LifeBonus/LifeBonusScore +onready var arrow_bonus_score = $ShardsAndBonuses/Bonuses/ArrowBonus/ArrowBonusScore +onready var perfect_bonus_score = $ShardsAndBonuses/Bonuses/PerfectBonus/PerfectBonusScore func _ready() -> void: # tween for sequencing @@ -21,6 +23,14 @@ func _ready() -> void: tween.tween_interval(0.5) if Game.shards_collected[i]: tween.tween_callback(shard, "collect") + + score.text = Game.score + #Determine score bonuses + collection_bonus_score.text = str("+") + str(Game.collection_bonus) + time_bonus_score.text = str("+") + str(Game.time_bonus) + life_bonus_score.text = str("+") + str(Game.life_bonus) + arrow_bonus_score.text = str("+") + str(Game.arrows_bonus) + perfect_bonus_score.text = str("+") + str(Game.perfect_bonus) func _physics_process(delta: float) -> void: if Input.is_action_just_released("ui_accept"): diff --git a/menus/results.tscn b/menus/results.tscn index fba970a..a0ae35d 100644 --- a/menus/results.tscn +++ b/menus/results.tscn @@ -1,13 +1,12 @@ -[gd_scene load_steps=18 format=2] +[gd_scene load_steps=20 format=2] [ext_resource path="res://shaders/wibble_wobble.gdshader" type="Shader" id=1] [ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=2] -[ext_resource path="res://graphics/collectibles/shard.png" type="Texture" id=3] +[ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=3] [ext_resource path="res://graphics/hud/results.png" type="Texture" id=4] [ext_resource path="res://graphics/hud/perfect_bonus.png" type="Texture" id=5] -[ext_resource path="res://graphics/hud/life_bonus.png" type="Texture" id=6] -[ext_resource path="res://graphics/hud/collection_bonus.png" type="Texture" id=7] -[ext_resource path="res://graphics/hud/time_bonus.png" type="Texture" id=8] +[ext_resource path="res://graphics/player/arrow.png" type="Texture" id=6] +[ext_resource path="res://ui/PressStart2P-Regular.ttf" type="DynamicFontData" id=7] [ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=9] [ext_resource path="res://ui/theme.tres" type="Theme" id=10] [ext_resource path="res://menus/results.gd" type="Script" id=13] @@ -23,10 +22,19 @@ shader_param/cycle_speed = Vector2( 12, 0 ) shader_param/cycle_alternation = Vector2( 2, 0 ) shader_param/uv_transform = Transform2D( 1, 1, 0, 1, 0, 0 ) -[sub_resource type="Gradient" id=2] -interpolation_mode = 2 -offsets = PoolRealArray( 0, 0.734694, 1 ) -colors = PoolColorArray( 0.576471, 0.980392, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ) +[sub_resource type="ShaderMaterial" id=7] +shader = ExtResource( 3 ) +shader_param/border_color = Color( 0, 0, 0, 1 ) +shader_param/border_corners = false + +[sub_resource type="ShaderMaterial" id=8] +shader = ExtResource( 3 ) +shader_param/border_color = Color( 0, 0, 0, 1 ) +shader_param/border_corners = false + +[sub_resource type="DynamicFont" id=9] +outline_color = Color( 0.254902, 0.027451, 0.027451, 1 ) +font_data = ExtResource( 7 ) [sub_resource type="ShaderMaterial" id=6] shader = ExtResource( 1 ) @@ -40,11 +48,10 @@ resource_name = "New Anim" length = 2.0 loop = true -[sub_resource type="Animation" id=4] -resource_name = "results" -length = 50.0 +[sub_resource type="Animation" id=10] +length = 0.001 tracks/0/type = "value" -tracks/0/path = NodePath("Shards/Shard1/Title:visible") +tracks/0/path = NodePath("ShardsAndBonuses:position") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false @@ -52,11 +59,11 @@ tracks/0/enabled = true tracks/0/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), -"update": 1, -"values": [ false ] +"update": 0, +"values": [ Vector2( 0, 0 ) ] } tracks/1/type = "value" -tracks/1/path = NodePath("Shards/Shard2/Title:visible") +tracks/1/path = NodePath("ShardsAndBonuses/Bonuses/CollectionBonus/CollectionBonusScore:visible") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false @@ -68,7 +75,7 @@ tracks/1/keys = { "values": [ false ] } tracks/2/type = "value" -tracks/2/path = NodePath("Shards/Shard3/Title:visible") +tracks/2/path = NodePath("ShardsAndBonuses/Bonuses/TimeBonus/TimeBonusScore:visible") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/imported = false @@ -80,7 +87,7 @@ tracks/2/keys = { "values": [ false ] } tracks/3/type = "value" -tracks/3/path = NodePath("Score:visible") +tracks/3/path = NodePath("ShardsAndBonuses/Bonuses/LifeBonus/LifeBonusScore:visible") tracks/3/interp = 1 tracks/3/loop_wrap = true tracks/3/imported = false @@ -92,7 +99,7 @@ tracks/3/keys = { "values": [ false ] } tracks/4/type = "value" -tracks/4/path = NodePath("Bonuses/CollectionBonus/CollectionBonusText:visible") +tracks/4/path = NodePath("ShardsAndBonuses/Bonuses/ArrowBonus/ArrowBonusScore:visible") tracks/4/interp = 1 tracks/4/loop_wrap = true tracks/4/imported = false @@ -104,7 +111,7 @@ tracks/4/keys = { "values": [ false ] } tracks/5/type = "value" -tracks/5/path = NodePath("Bonuses/TimeBonus/TimeBonusText:visible") +tracks/5/path = NodePath("ShardsAndBonuses/Bonuses/PerfectBonus/PerfectBonusScore:visible") tracks/5/interp = 1 tracks/5/loop_wrap = true tracks/5/imported = false @@ -115,41 +122,194 @@ tracks/5/keys = { "update": 1, "values": [ false ] } + +[sub_resource type="Animation" id=4] +resource_name = "results" +length = 50.0 +step = 1.0 +tracks/0/type = "method" +tracks/0/path = NodePath("ShardsAndBonuses/Shards/ResultsIcon") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 3 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "collect" +} ] +} +tracks/1/type = "method" +tracks/1/path = NodePath("ShardsAndBonuses/Shards/ResultsIcon2") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 4 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "collect" +} ] +} +tracks/2/type = "method" +tracks/2/path = NodePath("ShardsAndBonuses/Shards/ResultsIcon3") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 5 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "collect" +} ] +} +tracks/3/type = "method" +tracks/3/path = NodePath("ShardsAndBonuses/Shards/ResultsIcon4") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 6 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "collect" +} ] +} +tracks/4/type = "method" +tracks/4/path = NodePath("ShardsAndBonuses/Shards/ResultsIcon5") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"times": PoolRealArray( 7 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "collect" +} ] +} +tracks/5/type = "value" +tracks/5/path = NodePath("ShardsAndBonuses:position") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/keys = { +"times": PoolRealArray( 9, 10, 17, 18 ), +"transitions": PoolRealArray( 1, 1, 1, 1 ), +"update": 0, +"values": [ Vector2( 0, 0 ), Vector2( -256, 0 ), Vector2( -256, 0 ), Vector2( -512, 0 ) ] +} tracks/6/type = "value" -tracks/6/path = NodePath("Bonuses/LifeBonus/LifeBonusText:visible") +tracks/6/path = NodePath("ShardsAndBonuses/Bonuses/CollectionBonus/CollectionBonusScore:visible") tracks/6/interp = 1 tracks/6/loop_wrap = true tracks/6/imported = false tracks/6/enabled = true tracks/6/keys = { -"times": PoolRealArray( 0 ), -"transitions": PoolRealArray( 1 ), +"times": PoolRealArray( 0, 11 ), +"transitions": PoolRealArray( 1, 1 ), "update": 1, -"values": [ false ] +"values": [ false, true ] } tracks/7/type = "value" -tracks/7/path = NodePath("Bonuses/PerfectBonus/PerfectBonusText:visible") +tracks/7/path = NodePath("ShardsAndBonuses/Bonuses/TimeBonus/TimeBonusScore:visible") tracks/7/interp = 1 tracks/7/loop_wrap = true tracks/7/imported = false tracks/7/enabled = true tracks/7/keys = { -"times": PoolRealArray( 0 ), -"transitions": PoolRealArray( 1 ), +"times": PoolRealArray( 0, 12 ), +"transitions": PoolRealArray( 1, 1 ), "update": 1, -"values": [ false ] +"values": [ false, true ] } tracks/8/type = "value" -tracks/8/path = NodePath("FinalScore:visible") +tracks/8/path = NodePath("ShardsAndBonuses/Bonuses/LifeBonus/LifeBonusScore:visible") tracks/8/interp = 1 tracks/8/loop_wrap = true tracks/8/imported = false tracks/8/enabled = true tracks/8/keys = { -"times": PoolRealArray( 0 ), -"transitions": PoolRealArray( 1 ), +"times": PoolRealArray( 0, 13 ), +"transitions": PoolRealArray( 1, 1 ), "update": 1, -"values": [ false ] +"values": [ false, true ] +} +tracks/9/type = "value" +tracks/9/path = NodePath("ShardsAndBonuses/Bonuses/ArrowBonus/ArrowBonusScore:visible") +tracks/9/interp = 1 +tracks/9/loop_wrap = true +tracks/9/imported = false +tracks/9/enabled = true +tracks/9/keys = { +"times": PoolRealArray( 0, 14 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ false, true ] +} +tracks/10/type = "value" +tracks/10/path = NodePath("ShardsAndBonuses/Bonuses/PerfectBonus/PerfectBonusScore:visible") +tracks/10/interp = 1 +tracks/10/loop_wrap = true +tracks/10/imported = false +tracks/10/enabled = true +tracks/10/keys = { +"times": PoolRealArray( 0, 15 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ false, true ] +} +tracks/11/type = "method" +tracks/11/path = NodePath("ShardsAndBonuses/Bonuses/CollectionBonus") +tracks/11/interp = 1 +tracks/11/loop_wrap = true +tracks/11/imported = false +tracks/11/enabled = true +tracks/11/keys = { +"times": PoolRealArray( 11 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "collect" +} ] +} +tracks/12/type = "method" +tracks/12/path = NodePath("ShardsAndBonuses/Bonuses/TimeBonus") +tracks/12/interp = 1 +tracks/12/loop_wrap = true +tracks/12/imported = false +tracks/12/enabled = true +tracks/12/keys = { +"times": PoolRealArray( 12 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "collect" +} ] +} +tracks/13/type = "method" +tracks/13/path = NodePath("ShardsAndBonuses/Bonuses/LifeBonus") +tracks/13/interp = 1 +tracks/13/loop_wrap = true +tracks/13/imported = false +tracks/13/enabled = true +tracks/13/keys = { +"times": PoolRealArray( 13 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "collect" +} ] } [node name="Results" type="Node"] @@ -163,190 +323,82 @@ __meta__ = { "_edit_lock_": true } -[node name="Shards" type="Node2D" parent="."] +[node name="ShardsAndBonuses" type="Node2D" parent="."] -[node name="Shard1" parent="Shards" instance=ExtResource( 14 )] -position = Vector2( 24, 14 ) -texture = ExtResource( 3 ) +[node name="Shards" type="Node2D" parent="ShardsAndBonuses"] -[node name="Title" type="Label" parent="Shards/Shard1"] +[node name="ResultsIcon" parent="ShardsAndBonuses/Shards" instance=ExtResource( 14 )] +position = Vector2( 24, 32 ) + +[node name="Title" type="Label" parent="ShardsAndBonuses/Shards/ResultsIcon"] material = ExtResource( 9 ) margin_left = 8.0 -margin_top = -6.0 +margin_top = -5.0 margin_right = 176.0 -margin_bottom = 8.0 +margin_bottom = 9.0 theme = ExtResource( 10 ) text = "AAAAAAAAAAAAAAAAAAAAAAAA" -[node name="CollectedParticles" type="CPUParticles2D" parent="Shards/Shard1"] -pause_mode = 2 -emitting = false -amount = 64 -one_shot = true -explosiveness = 1.0 -local_coords = false -emission_shape = 2 -emission_rect_extents = Vector2( 4, 4 ) -direction = Vector2( 0, -1 ) -spread = 180.0 -gravity = Vector2( 0, 150 ) -initial_velocity = 250.0 -initial_velocity_random = 0.9 -damping = 2.0 -angle = 720.0 -angle_random = 1.0 -scale_amount_random = 1.0 -color_ramp = SubResource( 2 ) +[node name="ResultsIcon2" parent="ShardsAndBonuses/Shards" instance=ExtResource( 14 )] +position = Vector2( 24, 64 ) +number = 1 -[node name="Shard2" parent="Shards" instance=ExtResource( 14 )] -position = Vector2( 24, 30 ) -texture = ExtResource( 3 ) - -[node name="Title" type="Label" parent="Shards/Shard2"] +[node name="Title" type="Label" parent="ShardsAndBonuses/Shards/ResultsIcon2"] material = ExtResource( 9 ) margin_left = 8.0 -margin_top = -6.0 +margin_top = -5.0 margin_right = 176.0 -margin_bottom = 8.0 +margin_bottom = 9.0 theme = ExtResource( 10 ) text = "AAAAAAAAAAAAAAAAAAAAAAAA" -[node name="CollectedParticles" type="CPUParticles2D" parent="Shards/Shard2"] -pause_mode = 2 -emitting = false -amount = 64 -one_shot = true -explosiveness = 1.0 -local_coords = false -emission_shape = 2 -emission_rect_extents = Vector2( 4, 4 ) -direction = Vector2( 0, -1 ) -spread = 180.0 -gravity = Vector2( 0, 150 ) -initial_velocity = 250.0 -initial_velocity_random = 0.9 -damping = 2.0 -angle = 720.0 -angle_random = 1.0 -scale_amount_random = 1.0 -color_ramp = SubResource( 2 ) +[node name="ResultsIcon3" parent="ShardsAndBonuses/Shards" instance=ExtResource( 14 )] +position = Vector2( 24, 96 ) +number = 2 -[node name="Shard3" parent="Shards" instance=ExtResource( 14 )] -position = Vector2( 24, 46 ) -texture = ExtResource( 3 ) - -[node name="Title" type="Label" parent="Shards/Shard3"] +[node name="Title" type="Label" parent="ShardsAndBonuses/Shards/ResultsIcon3"] material = ExtResource( 9 ) margin_left = 8.0 -margin_top = -6.0 +margin_top = -5.0 margin_right = 176.0 -margin_bottom = 8.0 +margin_bottom = 9.0 theme = ExtResource( 10 ) text = "AAAAAAAAAAAAAAAAAAAAAAAA" -[node name="CollectedParticle" type="CPUParticles2D" parent="Shards/Shard3"] -pause_mode = 2 -emitting = false -amount = 64 -one_shot = true -explosiveness = 1.0 -local_coords = false -emission_shape = 2 -emission_rect_extents = Vector2( 4, 4 ) -direction = Vector2( 0, -1 ) -spread = 180.0 -gravity = Vector2( 0, 150 ) -initial_velocity = 250.0 -initial_velocity_random = 0.9 -damping = 2.0 -angle = 720.0 -angle_random = 1.0 -scale_amount_random = 1.0 -color_ramp = SubResource( 2 ) +[node name="ResultsIcon4" parent="ShardsAndBonuses/Shards" instance=ExtResource( 14 )] +position = Vector2( 24, 128 ) +number = 3 -[node name="Shard4" parent="Shards" instance=ExtResource( 14 )] -position = Vector2( 24, 62 ) -texture = ExtResource( 3 ) - -[node name="Title" type="Label" parent="Shards/Shard4"] +[node name="Title" type="Label" parent="ShardsAndBonuses/Shards/ResultsIcon4"] material = ExtResource( 9 ) margin_left = 8.0 -margin_top = -6.0 +margin_top = -5.0 margin_right = 176.0 -margin_bottom = 8.0 +margin_bottom = 9.0 theme = ExtResource( 10 ) text = "AAAAAAAAAAAAAAAAAAAAAAAA" -[node name="CollectedParticle" type="CPUParticles2D" parent="Shards/Shard4"] -pause_mode = 2 -emitting = false -amount = 64 -one_shot = true -explosiveness = 1.0 -local_coords = false -emission_shape = 2 -emission_rect_extents = Vector2( 4, 4 ) -direction = Vector2( 0, -1 ) -spread = 180.0 -gravity = Vector2( 0, 150 ) -initial_velocity = 250.0 -initial_velocity_random = 0.9 -damping = 2.0 -angle = 720.0 -angle_random = 1.0 -scale_amount_random = 1.0 -color_ramp = SubResource( 2 ) +[node name="ResultsIcon5" parent="ShardsAndBonuses/Shards" instance=ExtResource( 14 )] +position = Vector2( 24, 160 ) +number = 4 -[node name="Shard5" parent="Shards" instance=ExtResource( 14 )] -position = Vector2( 24, 78 ) -texture = ExtResource( 3 ) - -[node name="Title" type="Label" parent="Shards/Shard5"] +[node name="Title" type="Label" parent="ShardsAndBonuses/Shards/ResultsIcon5"] material = ExtResource( 9 ) margin_left = 8.0 -margin_top = -6.0 +margin_top = -5.0 margin_right = 176.0 -margin_bottom = 8.0 +margin_bottom = 9.0 theme = ExtResource( 10 ) text = "AAAAAAAAAAAAAAAAAAAAAAAA" -[node name="CollectedParticle" type="CPUParticles2D" parent="Shards/Shard5"] -pause_mode = 2 -emitting = false -amount = 64 -one_shot = true -explosiveness = 1.0 -local_coords = false -emission_shape = 2 -emission_rect_extents = Vector2( 4, 4 ) -direction = Vector2( 0, -1 ) -spread = 180.0 -gravity = Vector2( 0, 150 ) -initial_velocity = 250.0 -initial_velocity_random = 0.9 -damping = 2.0 -angle = 720.0 -angle_random = 1.0 -scale_amount_random = 1.0 -color_ramp = SubResource( 2 ) +[node name="Bonuses" type="Node2D" parent="ShardsAndBonuses"] +position = Vector2( 256, 8 ) -[node name="Score" type="Label" parent="."] -material = ExtResource( 9 ) -margin_top = 93.0 -margin_right = 256.0 -margin_bottom = 107.0 -theme = ExtResource( 10 ) -text = "Score: 0000000" -align = 1 +[node name="CollectionBonus" parent="ShardsAndBonuses/Bonuses" instance=ExtResource( 14 )] +position = Vector2( 24, 24 ) +number = 5 -[node name="Bonuses" type="Node2D" parent="."] -position = Vector2( 0, 6 ) - -[node name="CollectionBonus" parent="Bonuses" instance=ExtResource( 14 )] -position = Vector2( 24, 112 ) -texture = ExtResource( 7 ) - -[node name="CollectionBonusText" type="Label" parent="Bonuses/CollectionBonus"] +[node name="CollectionBonusText" type="Label" parent="ShardsAndBonuses/Bonuses/CollectionBonus"] material = ExtResource( 9 ) margin_left = 8.0 margin_top = -6.0 @@ -355,11 +407,21 @@ margin_bottom = 8.0 theme = ExtResource( 10 ) text = "Collection Bonus" -[node name="TimeBonus" parent="Bonuses" instance=ExtResource( 14 )] -position = Vector2( 24, 128 ) -texture = ExtResource( 8 ) +[node name="CollectionBonusScore" type="Label" parent="ShardsAndBonuses/Bonuses/CollectionBonus"] +visible = false +material = ExtResource( 9 ) +margin_left = 8.0 +margin_top = 8.0 +margin_right = 176.0 +margin_bottom = 22.0 +theme = ExtResource( 10 ) +text = "+500" -[node name="TimeBonusText" type="Label" parent="Bonuses/TimeBonus"] +[node name="TimeBonus" parent="ShardsAndBonuses/Bonuses" instance=ExtResource( 14 )] +position = Vector2( 24, 56 ) +number = 6 + +[node name="TimeBonusText" type="Label" parent="ShardsAndBonuses/Bonuses/TimeBonus"] material = ExtResource( 9 ) margin_left = 8.0 margin_top = -6.0 @@ -368,11 +430,21 @@ margin_bottom = 8.0 theme = ExtResource( 10 ) text = "Time Bonus" -[node name="LifeBonus" parent="Bonuses" instance=ExtResource( 14 )] -position = Vector2( 24, 144 ) -texture = ExtResource( 6 ) +[node name="TimeBonusScore" type="Label" parent="ShardsAndBonuses/Bonuses/TimeBonus"] +visible = false +material = ExtResource( 9 ) +margin_left = 8.0 +margin_top = 8.0 +margin_right = 176.0 +margin_bottom = 22.0 +theme = ExtResource( 10 ) +text = "+500" -[node name="LifeBonusText" type="Label" parent="Bonuses/LifeBonus"] +[node name="LifeBonus" parent="ShardsAndBonuses/Bonuses" instance=ExtResource( 14 )] +position = Vector2( 24, 88 ) +number = 7 + +[node name="LifeBonusText" type="Label" parent="ShardsAndBonuses/Bonuses/LifeBonus"] material = ExtResource( 9 ) margin_left = 8.0 margin_top = -6.0 @@ -381,26 +453,83 @@ margin_bottom = 8.0 theme = ExtResource( 10 ) text = "Life Bonus" -[node name="PerfectBonus" parent="Bonuses" instance=ExtResource( 14 )] -position = Vector2( 24, 160 ) -texture = ExtResource( 5 ) - -[node name="PerfectBonusText" type="Label" parent="Bonuses/PerfectBonus"] +[node name="LifeBonusScore" type="Label" parent="ShardsAndBonuses/Bonuses/LifeBonus"] +visible = false material = ExtResource( 9 ) margin_left = 8.0 -margin_top = -6.0 +margin_top = 8.0 margin_right = 176.0 -margin_bottom = 8.0 +margin_bottom = 22.0 +theme = ExtResource( 10 ) +text = "+500" + +[node name="ArrowBonus" type="Sprite" parent="ShardsAndBonuses/Bonuses"] +material = SubResource( 7 ) +position = Vector2( 24, 120 ) +rotation = -1.5708 +texture = ExtResource( 6 ) + +[node name="ArrowBonusText" type="Label" parent="ShardsAndBonuses/Bonuses/ArrowBonus"] +material = ExtResource( 9 ) +margin_left = 4.0 +margin_top = 7.0 +margin_right = 172.0 +margin_bottom = 21.0 +rect_rotation = 90.0 +theme = ExtResource( 10 ) +text = "Arrow Bonus" + +[node name="ArrowBonusScore" type="Label" parent="ShardsAndBonuses/Bonuses/ArrowBonus"] +visible = false +material = ExtResource( 9 ) +margin_left = -10.0 +margin_top = 7.0 +margin_right = 158.0 +margin_bottom = 21.0 +rect_rotation = 90.0 +theme = ExtResource( 10 ) +text = "+500" + +[node name="PerfectBonus" type="Sprite" parent="ShardsAndBonuses/Bonuses"] +material = SubResource( 8 ) +position = Vector2( 24, 152 ) +texture = ExtResource( 5 ) + +[node name="PerfectBonusText" type="Label" parent="ShardsAndBonuses/Bonuses/PerfectBonus"] +material = ExtResource( 9 ) +margin_left = 7.0 +margin_top = -5.0 +margin_right = 175.0 +margin_bottom = 9.0 theme = ExtResource( 10 ) text = "Perfect Bonus" -[node name="FinalScore" type="Label" parent="."] +[node name="PerfectBonusScore" type="Label" parent="ShardsAndBonuses/Bonuses/PerfectBonus"] +visible = false material = ExtResource( 9 ) -margin_top = 178.0 -margin_right = 256.0 -margin_bottom = 192.0 +margin_left = 7.0 +margin_top = 9.0 +margin_right = 175.0 +margin_bottom = 23.0 theme = ExtResource( 10 ) -text = "Final score: 123456789" +text = "+500" + +[node name="Score" type="Label" parent="."] +material = ExtResource( 9 ) +margin_top = 8.0 +margin_right = 256.0 +margin_bottom = 22.0 +theme = ExtResource( 10 ) +text = "Score: 0000000" +align = 1 + +[node name="FinalScore" type="Label" parent="."] +margin_top = 120.0 +margin_right = 256.0 +margin_bottom = 136.0 +theme = ExtResource( 10 ) +custom_fonts/font = SubResource( 9 ) +text = "1234567890" align = 1 [node name="Results" type="Sprite" parent="."] @@ -411,4 +540,5 @@ texture = ExtResource( 4 ) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] autoplay = "New Anim" "anims/New Anim" = SubResource( 3 ) +anims/RESET = SubResource( 10 ) anims/results = SubResource( 4 ) diff --git a/menus/results_icon.gd b/menus/results_icon.gd index cedcf78..e5d1ae1 100644 --- a/menus/results_icon.gd +++ b/menus/results_icon.gd @@ -1,16 +1,9 @@ -extends Sprite +extends Node2D - -onready var filled_sprite = $FilledSprite -onready var animation_player = $AnimationPlayer - - -func _ready() -> void: - filled_sprite.texture = texture +onready var anims = $AnimationPlayer +export var number = 0 func collect() -> void: - animation_player.play("collect") - for child in get_children(): - if child is CPUParticles2D: - child.emitting = true + if Game.shards_collected[number] == true: + anims.play("collect") diff --git a/menus/results_icon.tscn b/menus/results_icon.tscn index 0ee1c5e..ef80685 100644 --- a/menus/results_icon.tscn +++ b/menus/results_icon.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=1] +[ext_resource path="res://graphics/collectibles/shard.png" type="Texture" id=2] [ext_resource path="res://menus/results_icon.gd" type="Script" id=3] [sub_resource type="ShaderMaterial" id=4] @@ -8,30 +9,112 @@ shader = ExtResource( 1 ) shader_param/border_color = Color( 0, 0, 0, 1 ) shader_param/border_corners = false -[sub_resource type="Animation" id=3] -resource_name = "collect" -step = 0.5 +[sub_resource type="ShaderMaterial" id=5] +shader = ExtResource( 1 ) +shader_param/border_color = Color( 0, 0, 0, 1 ) +shader_param/border_corners = false + +[sub_resource type="Animation" id=6] +length = 0.001 tracks/0/type = "value" -tracks/0/path = NodePath("FilledSprite:scale") +tracks/0/path = NodePath("Filled:scale") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"times": PoolRealArray( 0, 0.15, 0.3, 0.375, 1 ), -"transitions": PoolRealArray( 1, 1, 1, 1, 1 ), +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), "update": 0, -"values": [ Vector2( 0, 0 ), Vector2( 1, 1 ), Vector2( 1.3, 1.3 ), Vector2( 1, 1 ), Vector2( 1, 1 ) ] +"values": [ Vector2( 0, 0 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("CollectedParticles:emitting") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] } -[node name="ResultsIcon" type="Sprite"] +[sub_resource type="Animation" id=3] +resource_name = "collect" +tracks/0/type = "value" +tracks/0/path = NodePath("Filled:scale") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.2, 0.4, 0.5 ), +"transitions": PoolRealArray( 1, 1, 1, 1 ), +"update": 0, +"values": [ Vector2( 0, 0 ), Vector2( 1, 1 ), Vector2( 1.25, 1.25 ), Vector2( 1, 1 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("CollectedParticles:emitting") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ true ] +} + +[sub_resource type="Gradient" id=7] +interpolation_mode = 2 +offsets = PoolRealArray( 0, 0.734694, 1 ) +colors = PoolColorArray( 0.576471, 0.980392, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ) + +[sub_resource type="ShaderMaterial" id=8] +shader = ExtResource( 1 ) +shader_param/border_color = Color( 0, 0, 0, 1 ) +shader_param/border_corners = false + +[node name="ResultsIcon" type="Node2D"] self_modulate = Color( 0, 0, 0, 1 ) material = SubResource( 4 ) script = ExtResource( 3 ) -[node name="FilledSprite" type="Sprite" parent="."] -use_parent_material = true -scale = Vector2( 1e-05, 1e-05 ) +[node name="Empty" type="Sprite" parent="."] +self_modulate = Color( 0, 0, 0, 1 ) +material = SubResource( 5 ) +position = Vector2( 1, 1 ) +texture = ExtResource( 2 ) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/RESET = SubResource( 6 ) anims/collect = SubResource( 3 ) + +[node name="CollectedParticles" type="CPUParticles2D" parent="."] +pause_mode = 2 +emitting = false +amount = 64 +one_shot = true +explosiveness = 1.0 +local_coords = false +emission_shape = 2 +emission_rect_extents = Vector2( 4, 4 ) +direction = Vector2( 0, -1 ) +spread = 180.0 +gravity = Vector2( 0, 150 ) +initial_velocity = 250.0 +initial_velocity_random = 0.9 +damping = 2.0 +angle = 720.0 +angle_random = 1.0 +scale_amount_random = 1.0 +color_ramp = SubResource( 7 ) + +[node name="Filled" type="Sprite" parent="."] +material = SubResource( 8 ) +scale = Vector2( 1e-05, 1e-05 ) +texture = ExtResource( 2 ) +offset = Vector2( 1, 1 )