implement marathon start screen

This commit is contained in:
Haze Weathers 2023-12-30 21:02:39 -05:00
parent 048d63a353
commit db0a61e162
7 changed files with 267 additions and 53 deletions

View file

@ -44,7 +44,7 @@ var current_level: int = 0
var difficulty: int = Difficulty.SPICY setget _set_difficulty
var enemy_speed_factor: float = 1.0 # multiplier of enemy speed
var is_easy_mode: bool = false # whether to do easy-specific behaviors
var use_lives: bool = false
var use_lives: bool = true
var can_pause: bool = true
var can_restart: bool = true
var current_palette: String = "default"
@ -53,6 +53,7 @@ var still_playing: bool = false
var marathon_mode: bool = true
var marathon_score: int = 0
var marathon_lives: int = 2
var marathon_shards: int = 0
var next_level: PackedScene
func _ready():
@ -74,19 +75,19 @@ func _set_difficulty(value: int) -> void:
Difficulty.SWEET:
is_easy_mode = true
enemy_speed_factor = 0.75
use_lives = false
# use_lives = false
Difficulty.SALTY:
is_easy_mode = false
enemy_speed_factor = 1.0
use_lives = false
# use_lives = false
Difficulty.SPICY:
is_easy_mode = false
enemy_speed_factor = 1.0
use_lives = true
# use_lives = true
Difficulty.PUNGENT:
is_easy_mode = false
enemy_speed_factor = 1.25
use_lives = true
# use_lives = true
#Instances a node
func instance_node(node:PackedScene,x:float,y:float,parent):
@ -138,6 +139,7 @@ func tally_scores() -> void:
# final score
final_score = score + arrows_bonus + collection_bonus + time_bonus + life_bonus + perfect_bonus
marathon_score += final_score
marathon_shards += _get_shards()
Game.save()
@ -166,7 +168,8 @@ func clear_collectibles() -> void:
stars_collected.fill(false)
shards_collected.fill(false)
arrows = 0
lives = marathon_lives if marathon_mode else 2
if not marathon_mode:
lives = 0
deaths = 0
# score
score = 0