mirror of
https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public.git
synced 2025-10-22 15:38:14 +00:00
Merge branch 'main' of https://github.com/JHDev2006/Super-Mario-Bros.-Remastered-Public
This commit is contained in:
@@ -16,6 +16,7 @@ func _ready() -> void:
|
||||
texture_changed.connect(update)
|
||||
|
||||
func update() -> void:
|
||||
print(name)
|
||||
var source = tile_map.tile_set.get_source(atlas_id)
|
||||
if source != null:
|
||||
source.texture = texture
|
||||
|
@@ -81,8 +81,6 @@ func write_save(campaign: String = Global.current_campaign, force := false) -> v
|
||||
save_json = SAVE_TEMPLATE.duplicate(true)
|
||||
match Global.current_game_mode:
|
||||
Global.GameMode.CAMPAIGN:
|
||||
if Global.world_num < 0:
|
||||
Global.world_num = 1
|
||||
if Global.high_score < Global.score:
|
||||
Global.high_score = Global.score
|
||||
save_json["World"] = Global.world_num
|
||||
@@ -117,7 +115,10 @@ func write_save_to_file(json := {}, path := "") -> void:
|
||||
file.close()
|
||||
|
||||
func apply_save(json := {}) -> void:
|
||||
|
||||
Global.world_num = json.get_or_add("World", 1)
|
||||
if Global.world_num < 1:
|
||||
Global.world_num = 1
|
||||
Global.level_num = json.get_or_add("Level", 1)
|
||||
Global.lives = json["Lives"]
|
||||
Global.coins = json["Coins"]
|
||||
|
@@ -47,6 +47,8 @@ func handle_main_hud() -> void:
|
||||
world_num = ["A", "B", "C", "D"][int(world_num) % 10]
|
||||
elif int(world_num) < 1:
|
||||
world_num = " "
|
||||
else:
|
||||
print(Global.world_num)
|
||||
%LevelNum.text = world_num + "-" + str(Global.level_num)
|
||||
%Crown.visible = Global.second_quest
|
||||
%Time.text = " " + str(Global.time).pad_zeros(3)
|
||||
|
@@ -240,7 +240,7 @@ func new_game_selected() -> void:
|
||||
func continue_game() -> void:
|
||||
SaveManager.apply_save(SaveManager.load_save(Global.current_campaign))
|
||||
Global.current_game_mode = Global.GameMode.CAMPAIGN
|
||||
if Global.game_beaten:
|
||||
if Global.game_beaten or Global.debug_mode:
|
||||
$CanvasLayer/StoryMode/ContinueBeatenGame/WorldSelect.open()
|
||||
else:
|
||||
$CanvasLayer/StoryMode/ContinueUnbeatenGame/CharacterSelect.open()
|
||||
|
Reference in New Issue
Block a user