game.gd cleaning and partial results screen implementation

This commit is contained in:
Haze Weathers 2023-09-10 19:28:42 -04:00
parent b126484109
commit e2b3db0b93
16 changed files with 425 additions and 436 deletions

View file

@ -16,34 +16,6 @@ func _physics_process(delta):
func _on_Area2D_area_entered(area):
if area.is_in_group("player_hitbox"):
#BONUSES
Game.final_score = Game.score
Game.bonuses = [0,0,0,0]
#Collection bonus
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.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.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.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.Bonuses.Life_Bonus += 500
if Game.lives == 2:
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.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"))
Game.tally_scores()
SceneManager.change_scene(preload("res://menus/results.tscn").instance())
# Game.change_map(load("res://maps/level_select.tscn"))