From d215a8728ad7f09d08533d131b569e0fb20a8f3c Mon Sep 17 00:00:00 2001 From: pennyrigate Date: Fri, 8 Sep 2023 20:47:33 -0400 Subject: [PATCH] being work on results screen --- autoloads/game.gd | 13 +- graphics/hud/collection_bonus.png | Bin 0 -> 225 bytes graphics/hud/collection_bonus.png.import | 35 ++ graphics/hud/life_bonus.png | Bin 0 -> 199 bytes graphics/hud/life_bonus.png.import | 35 ++ graphics/hud/perfect_bonus.png | Bin 0 -> 193 bytes graphics/hud/perfect_bonus.png.import | 35 ++ graphics/hud/results.png | Bin 0 -> 287 bytes graphics/hud/results.png.import | 35 ++ graphics/hud/time_bonus.png | Bin 0 -> 224 bytes graphics/hud/time_bonus.png.import | 35 ++ menus/results.gd | 16 + menus/results.tscn | 518 +++++++++++++++++++++-- menus/shard_results.tscn | 94 ++++ objects/environment/exit/exit.gd | 22 +- ui/arrow_figure_8.tres | 3 +- 16 files changed, 803 insertions(+), 38 deletions(-) create mode 100644 graphics/hud/collection_bonus.png create mode 100644 graphics/hud/collection_bonus.png.import create mode 100644 graphics/hud/life_bonus.png create mode 100644 graphics/hud/life_bonus.png.import create mode 100644 graphics/hud/perfect_bonus.png create mode 100644 graphics/hud/perfect_bonus.png.import create mode 100644 graphics/hud/results.png create mode 100644 graphics/hud/results.png.import create mode 100644 graphics/hud/time_bonus.png create mode 100644 graphics/hud/time_bonus.png.import create mode 100644 menus/results.gd create mode 100644 menus/shard_results.tscn diff --git a/autoloads/game.gd b/autoloads/game.gd index d7a876a..5ab7b1e 100644 --- a/autoloads/game.gd +++ b/autoloads/game.gd @@ -7,6 +7,13 @@ enum Difficulty { PUNGENT, # faster enemies, 3 lives } +enum Bonuses { + Collection_Bonus, + Time_Bonus, + Life_Bonus, + Perfect_Bonus +} + const DIFFICULTY_NAMES = ["Sweet","Salty","Spicy","Pungent"] var resolution = Vector2(256,192) @@ -18,7 +25,9 @@ var stars = [false,false,false,false,false] var shards = 0 var arrows = 0 var score = 0 +var final_score = 0 var high_score = 0 +var bonuses = [0,0,0,0] var lives = 2 var deaths = 0 var time = 0.0 @@ -114,10 +123,10 @@ func save(): # save score and time depending on completion 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) 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) # set shards diff --git a/graphics/hud/collection_bonus.png b/graphics/hud/collection_bonus.png new file mode 100644 index 0000000000000000000000000000000000000000..343767df15bdd1c962137730ef38e0bce71b33da GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uGBwbBK{D2f=age(c!@6@aFM%AEbVpxD28NCO z+!lvI6-$0X`wF|8vs58awr>=>Y|FjavIb>PmwAg8%>j&)}f7@(Ym9S>O>_%)r2R z7=#&*=dVZs3YvJjIEF}syPi79%V5C4>?r^Dy9|%Y&3<;yAK`9!Mr>J;M{kD21^(P$ kbM1!Iwzbc0oGsnNZ_mrf!KAXV6sVuU)78&qol`;+0DY)BQ2+n{ literal 0 HcmV?d00001 diff --git a/graphics/hud/life_bonus.png.import b/graphics/hud/life_bonus.png.import new file mode 100644 index 0000000..5c3c8c0 --- /dev/null +++ b/graphics/hud/life_bonus.png.import @@ -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 diff --git a/graphics/hud/perfect_bonus.png b/graphics/hud/perfect_bonus.png new file mode 100644 index 0000000000000000000000000000000000000000..1a5dc88fd93bddee4a75ad0a7f00de77ce33ddb6 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^+#t-s1|(OmDOUqhjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!7xu3#}JL++)25q-*ELIIOxtJ1;8k8S2d2os2daEzvrj-f} jha9gptefC+-~a=IeVHon{1jFupbZS3u6{1-oD!M<^ZGol literal 0 HcmV?d00001 diff --git a/graphics/hud/perfect_bonus.png.import b/graphics/hud/perfect_bonus.png.import new file mode 100644 index 0000000..d71a669 --- /dev/null +++ b/graphics/hud/perfect_bonus.png.import @@ -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 diff --git a/graphics/hud/results.png b/graphics/hud/results.png new file mode 100644 index 0000000000000000000000000000000000000000..0df4cae9526da6a5ee9beef8c8a619853e3dfed2 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^>_FVc!3-qT5)$SBDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheoB=)|u3wFvde!uRJnd;wB|wU~B*-uL|9^(-r+9&C88{0(B8wRq_zr_G z$kx=u*FJ#*^Zk=sxvo;U$4HA z?4~5u{Z6c1Zp%K{|hs+oLnoe z$ix}cvCMpG`jpG+aUoBaEpEw Game.high_score: Game.high_score = Game.score #BONUSES + Game.final_score = Game.score + Game.bonuses = [0,0,0,0] #Collection bonus - if Game.keys == 50: Game.score += 500 - if Game.shards == 5: Game.score += 500 + if Game.keys == 50: Game.Bonuses.Collection_Bonus += 500 + if Game.shards == 5: Game.Bonuses.Collection_Bonus += 500 if Game.keys == 50 && Game.shards == 5: - Game.score += 250 + Game.Bonuses.Collection_Bonus += 250 Game.shards_collected[5] = true #Time bonus if Game.keys == 50 && Game.shards == 5: 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 else: 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 #Life bonus - if Game.lives == 1: Game.score += 500 + if Game.lives == 1: Game.Bonuses.Life_Bonus += 500 if Game.lives == 2: - Game.score += 1500 + Game.Bonuses.Life_Bonus += 1500 Game.shards_collected[7] = true #Perfect bonus 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.change_map(load("res://maps/level_select.tscn")) diff --git a/ui/arrow_figure_8.tres b/ui/arrow_figure_8.tres index 2843937..082e8f8 100644 --- a/ui/arrow_figure_8.tres +++ b/ui/arrow_figure_8.tres @@ -5,5 +5,6 @@ [resource] shader = ExtResource( 1 ) 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/delay = Vector2( 0, 0 )