being work on results screen

This commit is contained in:
pennyrigate 2023-09-08 20:47:33 -04:00
parent 0693bd91d3
commit d215a8728a
16 changed files with 803 additions and 38 deletions

View file

@ -7,6 +7,13 @@ enum Difficulty {
PUNGENT, # faster enemies, 3 lives PUNGENT, # faster enemies, 3 lives
} }
enum Bonuses {
Collection_Bonus,
Time_Bonus,
Life_Bonus,
Perfect_Bonus
}
const DIFFICULTY_NAMES = ["Sweet","Salty","Spicy","Pungent"] const DIFFICULTY_NAMES = ["Sweet","Salty","Spicy","Pungent"]
var resolution = Vector2(256,192) var resolution = Vector2(256,192)
@ -18,7 +25,9 @@ var stars = [false,false,false,false,false]
var shards = 0 var shards = 0
var arrows = 0 var arrows = 0
var score = 0 var score = 0
var final_score = 0
var high_score = 0 var high_score = 0
var bonuses = [0,0,0,0]
var lives = 2 var lives = 2
var deaths = 0 var deaths = 0
var time = 0.0 var time = 0.0
@ -114,10 +123,10 @@ func save():
# save score and time depending on completion # save score and time depending on completion
if shards >= 5 && keys >= 50: if shards >= 5 && keys >= 50:
save_data.score_100 = max(save_data.score_100, score) save_data.score_100 = max(save_data.score_100, final_score)
save_data.time_100 = min(save_data.time_100, time) save_data.time_100 = min(save_data.time_100, time)
else: else:
save_data.score_any = max(save_data.score_100, score) save_data.score_any = max(save_data.score_100, final_score)
save_data.time_any = min(save_data.time_any, time) save_data.time_any = min(save_data.time_any, time)
# set shards # set shards

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/collection_bonus.png-c0498f7550478bc8b1614afa3fdb3e89.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/hud/collection_bonus.png"
dest_files=[ "res://.import/collection_bonus.png-c0498f7550478bc8b1614afa3fdb3e89.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
graphics/hud/life_bonus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/life_bonus.png-0f9d1521de3f08e08ca6e0b90e3ef8d2.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/hud/life_bonus.png"
dest_files=[ "res://.import/life_bonus.png-0f9d1521de3f08e08ca6e0b90e3ef8d2.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/perfect_bonus.png-df090bb05894ccbdd3eae2afd31298d4.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/hud/perfect_bonus.png"
dest_files=[ "res://.import/perfect_bonus.png-df090bb05894ccbdd3eae2afd31298d4.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
graphics/hud/results.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/results.png-c3c2389f681d388610852a8c684f356d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/hud/results.png"
dest_files=[ "res://.import/results.png-c3c2389f681d388610852a8c684f356d.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
graphics/hud/time_bonus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/time_bonus.png-663cd5c7331098252c03675e887c4123.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/hud/time_bonus.png"
dest_files=[ "res://.import/time_bonus.png-663cd5c7331098252c03675e887c4123.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

16
menus/results.gd Normal file
View file

@ -0,0 +1,16 @@
extends Node2D
# 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

@ -1,26 +1,148 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=25 format=2]
[ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=1] [ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=1]
[ext_resource path="res://objects/player/player_death_particles.tscn" type="PackedScene" id=2] [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://graphics/collectibles/shard.png" type="Texture" id=3]
[ext_resource path="res://graphics/player/sg_idle_color.png" type="Texture" id=4] [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://ui/2ndpuberty_outline.tres" type="Material" id=9]
[ext_resource path="res://ui/theme.tres" type="Theme" id=10]
[ext_resource path="res://ui/arrow_figure_8.tres" type="Material" id=11]
[ext_resource path="res://menus/shard_results.tscn" type="PackedScene" id=12]
[ext_resource path="res://menus/results.gd" type="Script" id=13]
[sub_resource type="ShaderMaterial" id=1] [sub_resource type="ShaderMaterial" id=5]
shader = ExtResource( 2 )
shader_param/color_1 = Color( 1, 0.513726, 0, 1 )
shader_param/color_2 = Color( 0.701961, 0.305882, 0.901961, 1 )
shader_param/checker_size = Vector2( 16, 16 )
shader_param/pan_speed = Vector2( 12, 0 )
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="ShaderMaterial" id=6]
shader = ExtResource( 1 ) shader = ExtResource( 1 )
shader_param/border_color = Color( 0, 0, 0, 1 ) shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = false shader_param/border_corners = false
[sub_resource type="Gradient" id=2] [sub_resource type="ShaderMaterial" id=7]
interpolation_mode = 2 shader = ExtResource( 1 )
offsets = PoolRealArray( 0, 0.734694, 1 ) shader_param/border_color = Color( 0, 0, 0, 1 )
colors = PoolColorArray( 0.576471, 0.980392, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ) shader_param/border_corners = false
[sub_resource type="ShaderMaterial" id=8]
shader = ExtResource( 1 )
shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = false
[sub_resource type="Animation" id=9]
resource_name = "Collect"
step = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite: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 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 1, 1 ), Vector2( 1.3, 1.3 ), Vector2( 1, 1 ), Vector2( 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("CollectedParticle: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="ShaderMaterial" id=10]
shader = ExtResource( 1 )
shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = false
[sub_resource type="Animation" id=11]
resource_name = "Collect"
step = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite: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 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 1, 1 ), Vector2( 1.3, 1.3 ), Vector2( 1, 1 ), Vector2( 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("CollectedParticle: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="ShaderMaterial" id=12]
shader = ExtResource( 1 )
shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = false
[sub_resource type="Animation" id=13]
resource_name = "Collect"
step = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite: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 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 1, 1 ), Vector2( 1.3, 1.3 ), Vector2( 1, 1 ), Vector2( 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("CollectedParticle: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="Animation" id=3] [sub_resource type="Animation" id=3]
resource_name = "New Anim" resource_name = "New Anim"
length = 2.0 length = 2.0
loop = true loop = true
[sub_resource type="Animation" id=4]
resource_name = "results"
length = 50.0
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/path = NodePath("DeathSplatter:emitting") tracks/0/path = NodePath("ShardSprites/ShardTitle1:visible")
tracks/0/interp = 1 tracks/0/interp = 1
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/imported = false tracks/0/imported = false
@ -29,30 +151,374 @@ tracks/0/keys = {
"times": PoolRealArray( 0 ), "times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ), "transitions": PoolRealArray( 1 ),
"update": 1, "update": 1,
"values": [ true ] "values": [ false ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ShardSprites/ShardTitle2:visible")
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 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("ShardSprites/ShardTitle3:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("ShardSprites/ShardTitle4:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("ShardSprites/ShardTitle5:visible")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Score:visible")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/6/type = "value"
tracks/6/path = NodePath("BonusSprites/CollectionBonusText: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 ),
"update": 1,
"values": [ false ]
}
tracks/7/type = "value"
tracks/7/path = NodePath("BonusSprites/TimeBonusText: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 ),
"update": 1,
"values": [ false ]
}
tracks/8/type = "value"
tracks/8/path = NodePath("BonusSprites/LifeBonusText: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 ),
"update": 1,
"values": [ false ]
}
tracks/9/type = "value"
tracks/9/path = NodePath("BonusSprites/PerfectBonusText:visible")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/10/type = "value"
tracks/10/path = NodePath("Final Score:visible")
tracks/10/interp = 1
tracks/10/loop_wrap = true
tracks/10/imported = false
tracks/10/enabled = true
tracks/10/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
} }
[node name="Results" type="Node2D"] [node name="Results" type="Node2D"]
script = ExtResource( 13 )
[node name="Sprite" type="Sprite" parent="."] [node name="ColorRect" type="ColorRect" parent="."]
material = SubResource( 1 ) material = SubResource( 5 )
position = Vector2( 47, 39 ) margin_right = 256.0
margin_bottom = 192.0
__meta__ = {
"_edit_lock_": true
}
[node name="ShardSprites" type="Node2D" parent="."]
position = Vector2( 0, -10 )
[node name="Empty1" type="Sprite" parent="ShardSprites"]
modulate = Color( 0, 0, 0, 1 )
material = SubResource( 6 )
position = Vector2( 24, 24 )
texture = ExtResource( 3 ) texture = ExtResource( 3 )
[node name="DeathSplatter" parent="." instance=ExtResource( 2 )] [node name="Empty2" type="Sprite" parent="ShardSprites"]
position = Vector2( 95, 64 ) modulate = Color( 0, 0, 0, 1 )
emitting = true material = SubResource( 6 )
amount = 64 position = Vector2( 24, 40 )
lifetime = 1.0 texture = ExtResource( 3 )
one_shot = false
explosiveness = 1.0 [node name="Empty3" type="Sprite" parent="ShardSprites"]
texture = ExtResource( 4 ) modulate = Color( 0, 0, 0, 1 )
gravity = Vector2( 0, 150 ) material = SubResource( 6 )
initial_velocity = 250.0 position = Vector2( 24, 56 )
scale_amount = 1.0 texture = ExtResource( 3 )
scale_amount_curve = null
color_ramp = SubResource( 2 ) [node name="Empty4" type="Sprite" parent="ShardSprites"]
modulate = Color( 0, 0, 0, 1 )
material = SubResource( 6 )
position = Vector2( 24, 72 )
texture = ExtResource( 3 )
[node name="Empty5" type="Sprite" parent="ShardSprites"]
modulate = Color( 0, 0, 0, 1 )
material = SubResource( 6 )
position = Vector2( 24, 88 )
texture = ExtResource( 3 )
[node name="Shard" parent="ShardSprites" instance=ExtResource( 12 )]
position = Vector2( 23, 23 )
[node name="Shard2" parent="ShardSprites" instance=ExtResource( 12 )]
position = Vector2( 23, 39 )
[node name="Shard3" parent="ShardSprites" instance=ExtResource( 12 )]
position = Vector2( 23, 55 )
[node name="Shard4" parent="ShardSprites" instance=ExtResource( 12 )]
position = Vector2( 23, 71 )
[node name="Shard5" parent="ShardSprites" instance=ExtResource( 12 )]
position = Vector2( 23, 87 )
[node name="ShardTitle1" type="Label" parent="ShardSprites"]
visible = false
material = ExtResource( 9 )
margin_left = 32.0
margin_top = 18.0
margin_right = 200.0
margin_bottom = 32.0
theme = ExtResource( 10 )
text = "AAAAAAAAAAAAAAAAAAAAAAAA"
[node name="ShardTitle2" type="Label" parent="ShardSprites"]
visible = false
material = ExtResource( 9 )
margin_left = 32.0
margin_top = 34.0
margin_right = 200.0
margin_bottom = 48.0
theme = ExtResource( 10 )
text = "AAAAAAAAAAAAAAAAAAAAAAAA"
[node name="ShardTitle3" type="Label" parent="ShardSprites"]
visible = false
material = ExtResource( 9 )
margin_left = 32.0
margin_top = 50.0
margin_right = 200.0
margin_bottom = 64.0
theme = ExtResource( 10 )
text = "AAAAAAAAAAAAAAAAAAAAAAAA"
[node name="ShardTitle4" type="Label" parent="ShardSprites"]
visible = false
material = ExtResource( 9 )
margin_left = 32.0
margin_top = 66.0
margin_right = 200.0
margin_bottom = 80.0
theme = ExtResource( 10 )
text = "AAAAAAAAAAAAAAAAAAAAAAAA"
[node name="ShardTitle5" type="Label" parent="ShardSprites"]
visible = false
material = ExtResource( 9 )
margin_left = 32.0
margin_top = 82.0
margin_right = 200.0
margin_bottom = 96.0
theme = ExtResource( 10 )
text = "AAAAAAAAAAAAAAAAAAAAAAAA"
[node name="Score" type="Label" parent="."]
visible = false
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="BonusSprites" type="Node2D" parent="."]
position = Vector2( 0, 6 )
[node name="CollectionBonusEmpty" type="Sprite" parent="BonusSprites"]
modulate = Color( 0, 0, 0, 1 )
material = SubResource( 7 )
position = Vector2( 24, 112 )
texture = ExtResource( 7 )
[node name="CollectionBonus" parent="BonusSprites" instance=ExtResource( 12 )]
position = Vector2( 24, 112 )
[node name="Sprite" parent="BonusSprites/CollectionBonus" index="0"]
position = Vector2( 0, 0 )
texture = ExtResource( 7 )
[node name="CollectionBonusText" type="Label" parent="BonusSprites"]
visible = false
material = ExtResource( 9 )
margin_left = 32.0
margin_top = 106.0
margin_right = 200.0
margin_bottom = 120.0
theme = ExtResource( 10 )
text = "Collection Bonus"
[node name="TimeBonusEmpty" type="Sprite" parent="BonusSprites"]
modulate = Color( 0, 0, 0, 1 )
material = SubResource( 8 )
position = Vector2( 24, 128 )
texture = ExtResource( 8 )
[node name="TimeBonus" parent="BonusSprites" instance=ExtResource( 12 )]
position = Vector2( 24, 128 )
[node name="Sprite" parent="BonusSprites/TimeBonus" index="0"]
position = Vector2( 0, 0 )
texture = ExtResource( 8 )
[node name="AnimationPlayer" parent="BonusSprites/TimeBonus" index="1"]
anims/Collect = SubResource( 9 )
[node name="TimeBonusText" type="Label" parent="BonusSprites"]
visible = false
material = ExtResource( 9 )
margin_left = 32.0
margin_top = 122.0
margin_right = 200.0
margin_bottom = 136.0
theme = ExtResource( 10 )
text = "Time Bonus"
[node name="LifeBonusEmpty" type="Sprite" parent="BonusSprites"]
modulate = Color( 0, 0, 0, 1 )
material = SubResource( 10 )
position = Vector2( 24, 144 )
texture = ExtResource( 6 )
[node name="LifeBonus" parent="BonusSprites" instance=ExtResource( 12 )]
position = Vector2( 24, 144 )
[node name="Sprite" parent="BonusSprites/LifeBonus" index="0"]
position = Vector2( 0, 0 )
texture = ExtResource( 6 )
[node name="AnimationPlayer" parent="BonusSprites/LifeBonus" index="1"]
anims/Collect = SubResource( 11 )
[node name="LifeBonusText" type="Label" parent="BonusSprites"]
visible = false
material = ExtResource( 9 )
margin_left = 32.0
margin_top = 138.0
margin_right = 200.0
margin_bottom = 152.0
theme = ExtResource( 10 )
text = "Life Bonus"
[node name="PerfectBonusEmpty" type="Sprite" parent="BonusSprites"]
modulate = Color( 0, 0, 0, 1 )
material = SubResource( 12 )
position = Vector2( 24, 160 )
texture = ExtResource( 5 )
[node name="PerfectBonus" parent="BonusSprites" instance=ExtResource( 12 )]
position = Vector2( 24, 160 )
[node name="Sprite" parent="BonusSprites/PerfectBonus" index="0"]
position = Vector2( 0, 0 )
texture = ExtResource( 5 )
[node name="AnimationPlayer" parent="BonusSprites/PerfectBonus" index="1"]
anims/Collect = SubResource( 13 )
[node name="PerfectBonusText" type="Label" parent="BonusSprites"]
visible = false
material = ExtResource( 9 )
margin_left = 32.0
margin_top = 154.0
margin_right = 200.0
margin_bottom = 168.0
theme = ExtResource( 10 )
text = "Perfect Bonus"
[node name="Final Score" type="Label" parent="."]
visible = false
material = ExtResource( 9 )
margin_top = 178.0
margin_right = 256.0
margin_bottom = 192.0
theme = ExtResource( 10 )
text = "Final score: 123456789"
align = 1
[node name="AnimationPlayer" type="AnimationPlayer" parent="."] [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "New Anim" autoplay = "New Anim"
"anims/New Anim" = SubResource( 3 ) "anims/New Anim" = SubResource( 3 )
anims/results = SubResource( 4 )
[node name="Results" type="Sprite" parent="."]
material = ExtResource( 11 )
position = Vector2( 232, 80 )
scale = Vector2( 1, 0.679105 )
texture = ExtResource( 4 )
[editable path="BonusSprites/CollectionBonus"]
[editable path="BonusSprites/TimeBonus"]
[editable path="BonusSprites/LifeBonus"]
[editable path="BonusSprites/PerfectBonus"]

94
menus/shard_results.tscn Normal file
View file

@ -0,0 +1,94 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://shaders/1px_border.gdshader" type="Shader" id=1]
[ext_resource path="res://objects/player/player_death_particles.tscn" type="PackedScene" id=2]
[ext_resource path="res://graphics/collectibles/shard.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=3]
resource_name = "Collect"
step = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite: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 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 1, 1 ), Vector2( 1.3, 1.3 ), Vector2( 1, 1 ), Vector2( 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("CollectedParticle: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 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[sub_resource type="Animation" id=4]
resource_name = "Miss"
tracks/0/type = "value"
tracks/0/path = NodePath(".:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
[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 )
[node name="Shard" type="Node2D"]
visible = false
[node name="Sprite" type="Sprite" parent="."]
material = SubResource( 1 )
position = Vector2( 1, 1 )
texture = ExtResource( 3 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "Miss"
anims/Collect = SubResource( 3 )
anims/Miss = SubResource( 4 )
[node name="CollectedParticle" parent="." instance=ExtResource( 2 )]
amount = 64
lifetime = 1.0
explosiveness = 1.0
texture = null
gravity = Vector2( 0, 150 )
initial_velocity = 250.0
scale_amount = 1.0
scale_amount_curve = null
color_ramp = SubResource( 2 )

View file

@ -16,30 +16,34 @@ func _physics_process(delta):
func _on_Area2D_area_entered(area): func _on_Area2D_area_entered(area):
if area.is_in_group("player_hitbox"): if area.is_in_group("player_hitbox"):
if Game.score > Game.high_score: Game.high_score = Game.score
#BONUSES #BONUSES
Game.final_score = Game.score
Game.bonuses = [0,0,0,0]
#Collection bonus #Collection bonus
if Game.keys == 50: Game.score += 500 if Game.keys == 50: Game.Bonuses.Collection_Bonus += 500
if Game.shards == 5: Game.score += 500 if Game.shards == 5: Game.Bonuses.Collection_Bonus += 500
if Game.keys == 50 && Game.shards == 5: if Game.keys == 50 && Game.shards == 5:
Game.score += 250 Game.Bonuses.Collection_Bonus += 250
Game.shards_collected[5] = true Game.shards_collected[5] = true
#Time bonus #Time bonus
if Game.keys == 50 && Game.shards == 5: if Game.keys == 50 && Game.shards == 5:
if Game.time < map.target_time_100: if Game.time < map.target_time_100:
Game.score += max(2500 - 2500 * int(Game.time / map.target_time_100), 0) Game.Bonuses.Time_Bonus += max(2500 - 2500 * int(Game.time / map.target_time_100), 0)
Game.shards_collected[6] = true Game.shards_collected[6] = true
else: else:
if Game.time < map.target_time_any: if Game.time < map.target_time_any:
Game.score += max(2500 - 2500 * int(Game.time / map.target_time_any), 0) Game.Bonuses.Time_Bonus += max(2500 - 2500 * int(Game.time / map.target_time_any), 0)
Game.shards_collected[6] = true Game.shards_collected[6] = true
#Life bonus #Life bonus
if Game.lives == 1: Game.score += 500 if Game.lives == 1: Game.Bonuses.Life_Bonus += 500
if Game.lives == 2: if Game.lives == 2:
Game.score += 1500 Game.Bonuses.Life_Bonus += 1500
Game.shards_collected[7] = true Game.shards_collected[7] = true
#Perfect bonus #Perfect bonus
if Game.lives == 2 && Game.keys == 50 && Game.shards == 5 && Game.time < map.target_time_100: if Game.lives == 2 && Game.keys == 50 && Game.shards == 5 && Game.time < map.target_time_100:
Game.score += 1000 Game.Bonuses.Perfect_Bonus += 1000
for bonus in Game.bonuses:
Game.final_score += bonus
if Game.final_score > Game.high_final_score: Game.high_final_score = Game.final_score
Game.save() Game.save()
Game.change_map(load("res://maps/level_select.tscn")) Game.change_map(load("res://maps/level_select.tscn"))

View file

@ -5,5 +5,6 @@
[resource] [resource]
shader = ExtResource( 1 ) shader = ExtResource( 1 )
shader_param/speed = Vector2( 4, 8 ) shader_param/speed = Vector2( 4, 8 )
shader_param/ammount = Vector2( 1, 1 ) shader_param/ammount = Vector2( 9, 8 )
shader_param/offset = Vector2( 0, 0 ) shader_param/offset = Vector2( 0, 0 )
shader_param/delay = Vector2( 0, 0 )