Save System Mk.III (and start of new difficulty system)

This commit is contained in:
Haze Weathers 2023-06-29 22:07:54 -04:00
parent 746b9813e2
commit 4958c420d8
8 changed files with 203 additions and 82 deletions

View file

@ -32,6 +32,7 @@ export var target_time_any = 0
# Called when the node enters the scene tree for the first time.
func _ready():
easy_mode_text.text = "difficulty: %s, X to change" % ["sweet", "salty", "spicy", "pungent"][Game.difficulty]
Fade.fade_in(0.000000000000001)
change_current_level(Game.current_level)
Audio.ac_music.stop()
@ -53,20 +54,8 @@ func _physics_process(delta):
Game.change_map(level.scene)
#Toggle lives mode
if Input.is_action_just_pressed("ui_cancel"):
Game.use_lives = !Game.use_lives
Save.set_options()
if Game.use_lives:
lives_mode_text.text = "lives are on press z to change this"
else:
lives_mode_text.text = "lives are off press z to change this"
#Toggle easy mode
if Input.is_action_just_pressed("sword"):
Game.is_easy_mode = !Game.is_easy_mode
Save.set_options()
if Game.is_easy_mode:
easy_mode_text.text = "easy is on press c to change this"
else:
easy_mode_text.text = "easy is off press c to change this"
Game.difficulty = (Game.difficulty + 1) % 4
easy_mode_text.text = "difficulty: %s, X to change" % ["sweet", "salty", "spicy", "pungent"][Game.difficulty]
func change_current_shard(amount):
if current_shard + amount != -1 && current_shard + amount != 8: #Check if in range
@ -92,7 +81,7 @@ func change_current_level(amount):
shard_arrow.position.x = 76
#Load new data
var save_id = LevelData.levels[current_level].save_id
var save_data = Save.get_level_data(save_id)
var save_data = Save.current_file.levels[save_id]
# set any% scores
high_score_any.text = "Any%%\n%05d\n%s" % [
save_data.score_any,
@ -105,4 +94,4 @@ func change_current_level(amount):
]
# set collected shards
for i in 8:
shards[i].visible = save_data.shards[i]
shards[i].visible = save_data.shards_collected[i]

View file

@ -124,10 +124,11 @@ margin_top = 3.0
margin_right = 256.0
margin_bottom = 13.0
theme = ExtResource( 1 )
text = "easy is off press c to change this"
text = "difficulty"
align = 1
[node name="LivesModeText" type="Label" parent="."]
visible = false
material = ExtResource( 10 )
margin_left = 2.0
margin_top = 180.0