being work on results screen
This commit is contained in:
parent
0693bd91d3
commit
d215a8728a
16 changed files with 803 additions and 38 deletions
|
@ -16,30 +16,34 @@ func _physics_process(delta):
|
|||
|
||||
func _on_Area2D_area_entered(area):
|
||||
if area.is_in_group("player_hitbox"):
|
||||
if Game.score > 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"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue