From d06acf25221f406eed3f4a0048d2cb32a5d23171 Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Tue, 5 Mar 2024 18:20:32 -0500 Subject: [PATCH] the start of marathon mode --- autoloads/game.gd | 63 +++++--- autoloads/level_data.gd | 2 + autoloads/scene_manager.tscn | 4 +- maps/boss/boss1_arena.gd | 11 +- maps/boss/boss2_arena.gd | 11 +- maps/boss/boss3_arena.gd | 16 ++ maps/boss/boss3_arena.tscn | 1 + menus/main_menu.gd | 17 ++ menus/main_menu.tscn | 2 + menus/marathon_results.gd | 19 +++ menus/marathon_results.tscn | 77 +++++++++ menus/marathon_select_lives.gd | 89 +++++++++++ menus/marathon_start.gd | 49 ++++++ menus/marathon_start.tscn | 250 ++++++++++++++++++++++++++++++ menus/results.gd | 9 ++ objects/hud/hud.gd | 7 +- project.godot | 6 + ui/2ndpuberty_scholar_outline.png | Bin 6674 -> 6956 bytes 18 files changed, 607 insertions(+), 26 deletions(-) create mode 100644 menus/marathon_results.gd create mode 100644 menus/marathon_results.tscn create mode 100644 menus/marathon_select_lives.gd create mode 100644 menus/marathon_start.gd create mode 100644 menus/marathon_start.tscn diff --git a/autoloads/game.gd b/autoloads/game.gd index ac55637..cfee035 100644 --- a/autoloads/game.gd +++ b/autoloads/game.gd @@ -49,6 +49,13 @@ var can_pause: bool = true var can_restart: bool = true var current_palette: String = "default" var still_playing: bool = false +var last_mm_button = null +#== marathon mode ==# +var marathon_mode: bool = false +var marathon_score: int = 0 +var marathon_lives: int = 0 +var marathon_shards: int = 0 +var marathon_deaths: int = 0 func _ready(): @@ -133,7 +140,11 @@ func tally_scores() -> void: perfect_bonus += 1000 # final score final_score = score + arrows_bonus + collection_bonus + time_bonus + life_bonus + perfect_bonus - Game.save() + if marathon_mode: + marathon_shards += shards_collected.count(true) + marathon_score += final_score + else: + Game.save() #Go to new map @@ -144,11 +155,12 @@ func change_map(map: PackedScene) -> void: yield(Fade, "fade_finished") can_pause = true # save deaths - var save_id = LevelData.levels[current_level].save_id - var save_data: Save.LevelSaveData = Save.current_file.levels[save_id] - save_data.deaths += deaths - Save.current_file.play_time += time - Save.current_file.save_to_file() + if not marathon_mode: + var save_id = LevelData.levels[current_level].save_id + var save_data: Save.LevelSaveData = Save.current_file.levels[save_id] + save_data.deaths += deaths + Save.current_file.play_time += time + Save.current_file.save_to_file() # clear clear_collectibles() StainLayer.reset() @@ -162,7 +174,8 @@ func clear_collectibles() -> void: stars_collected.fill(false) shards_collected.fill(false) arrows = 0 - lives = 2 + if not marathon_mode: + lives = 2 deaths = 0 # score score = 0 @@ -174,6 +187,8 @@ func clear_collectibles() -> void: #Save func save(): + if marathon_mode: + return # get level's save data object var save_id = LevelData.levels[current_level].save_id var save_data: Save.LevelSaveData = Save.current_file.levels[save_id] @@ -206,6 +221,8 @@ func save(): # smaller save function for bosses func save_boss() -> void: + if marathon_mode: + return var save_id = LevelData.levels[current_level].save_id var save_data: Save.LevelSaveData = Save.current_file.levels[save_id] @@ -231,13 +248,13 @@ func timeify(input): # convert seconds into M:SS.MS func format_time(seconds: float) -> String: if is_inf(seconds) or is_nan(seconds): # infinite - return "-:--.--" - elif seconds >= 600.0: # 10 minutes or greater - return "9:99.99" + return "--:--.--" + elif seconds >= 6000.0: # 10 minutes or greater + return "99:99.99" else: var minutes = floor(seconds / 60.0) var centiseconds = fmod(floor(seconds * 100.0), 100.0) - return "%01d:%02d.%02d" % [minutes, fmod(seconds, 60.0), centiseconds] + return "%02d:%02d.%02d" % [minutes, fmod(seconds, 60.0), centiseconds] #Restart level func restart_level(): @@ -268,14 +285,17 @@ func has_collection_bonus(): # called when player dies func _on_player_died() -> void: deaths += 1 + if marathon_mode: + marathon_deaths += 1 if use_lives and lives <= 0: still_playing = false can_restart = false can_pause = false - Save.current_file.play_time += time - Save.current_file.levels[LevelData.levels[current_level].save_id].deaths += deaths - Save.current_file.save_to_file() - clear_collectibles() + if not marathon_mode: + Save.current_file.play_time += time + Save.current_file.levels[LevelData.levels[current_level].save_id].deaths += deaths + Save.current_file.save_to_file() + clear_collectibles() Audio.play_sound(Audio.a_game_over, Audio.ac_die) get_tree().get_nodes_in_group("player")[0].queue_free() var time_tween = create_tween() @@ -286,11 +306,14 @@ func _on_player_died() -> void: Engine.time_scale = 1.0 Fade.fade_out(Options.transition_speed_secs) yield(Fade, "fade_finished") - var map = get_map() - var gover = load("res://menus/game_over.tscn").instance() - map.add_child(gover) - can_restart = true - can_pause = true + if marathon_mode: + SceneManager.current_scene = load("res://menus/main_menu.tscn").instance() + else: + var map = get_map() + var gover = load("res://menus/game_over.tscn").instance() + map.add_child(gover) + can_restart = true + can_pause = true else: # count death lives -= 1 diff --git a/autoloads/level_data.gd b/autoloads/level_data.gd index 8d9775c..67990f6 100644 --- a/autoloads/level_data.gd +++ b/autoloads/level_data.gd @@ -1,6 +1,8 @@ tool extends Node +export var marathon_start: int = 0 +export var marathon_end: int = 11 export var levels: Array = [] setget set_levels func set_levels(value): diff --git a/autoloads/scene_manager.tscn b/autoloads/scene_manager.tscn index e0506e0..4c6aaa6 100644 --- a/autoloads/scene_manager.tscn +++ b/autoloads/scene_manager.tscn @@ -5,10 +5,10 @@ [sub_resource type="ShaderMaterial" id=1] shader = ExtResource( 2 ) -shader_param/enabled = false +shader_param/enabled = true shader_param/resolution = Vector2( 256, 192 ) shader_param/curvature = Vector2( 0, 0 ) -shader_param/scanline_opacity = Vector2( 0.2, 0 ) +shader_param/scanline_opacity = Vector2( 0.1, 0.1 ) shader_param/brightness = 1.0 [node name="SceneManager" type="Node"] diff --git a/maps/boss/boss1_arena.gd b/maps/boss/boss1_arena.gd index ca40972..952c0bf 100644 --- a/maps/boss/boss1_arena.gd +++ b/maps/boss/boss1_arena.gd @@ -30,4 +30,13 @@ func _on_Boss1_entered_phase(phase): func _on_ExitTimer_timeout(): Game.save_boss() - Game.change_map(load("res://menus/level_select_scholar.tscn")) + if Game.marathon_mode: + Game.current_level += 1 + if Game.current_level > LevelData.marathon_end: + Fade.fade_out(Options.transition_speed_secs) + yield(Fade, "fade_finished") + SceneManager.change_scene(load("res://menus/main_menu.tscn").instance()) + else: + Game.change_map(LevelData.levels[Game.current_level].scene) + else: + Game.change_map(load("res://menus/level_select_scholar.tscn")) diff --git a/maps/boss/boss2_arena.gd b/maps/boss/boss2_arena.gd index 70be256..6a2bfb3 100644 --- a/maps/boss/boss2_arena.gd +++ b/maps/boss/boss2_arena.gd @@ -21,4 +21,13 @@ func _on_2600_entered_phase(phase): func _on_ExitTimer_timeout(): Game.save_boss() - Game.change_map(load("res://menus/level_select_scholar.tscn")) + if Game.marathon_mode: + Game.current_level += 1 + if Game.current_level > LevelData.marathon_end: + Fade.fade_out(Options.transition_speed_secs) + yield(Fade, "fade_finished") + SceneManager.change_scene(load("res://menus/marathon_results.tscn").instance()) + else: + Game.change_map(LevelData.levels[Game.current_level].scene) + else: + Game.change_map(load("res://menus/level_select_scholar.tscn")) diff --git a/maps/boss/boss3_arena.gd b/maps/boss/boss3_arena.gd index fb6ec79..d8b1b35 100644 --- a/maps/boss/boss3_arena.gd +++ b/maps/boss/boss3_arena.gd @@ -23,6 +23,7 @@ func _on_Famira_health_changed(amount) -> void: func _on_cutscene_finished() -> void: + $GUI.visible = true sg2083.visible = true sg2083.state = sg2083.State.STAND famira.visible = true @@ -40,3 +41,18 @@ func _on_Famira_died() -> void: var tween = create_tween() tween.set_trans(Tween.TRANS_CUBIC) tween.tween_property($"%Camera", "global_position:x", famira.global_position.x - 128, 0.5) + tween.tween_interval(10.0) + tween.tween_callback(self, "_on_death_cooldown") + + +func _on_death_cooldown() -> void: + if Game.marathon_mode: + Game.current_level += 1 + if Game.current_level > LevelData.marathon_end: + Fade.fade_out(Options.transition_speed_secs) + yield(Fade, "fade_finished") + SceneManager.change_scene(load("res://menus/marathon_results.tscn").instance()) + else: + Game.change_map(LevelData.levels[Game.current_level].scene) + else: + Game.change_map(load("res://menus/level_select_scholar.tscn")) diff --git a/maps/boss/boss3_arena.tscn b/maps/boss/boss3_arena.tscn index 356d063..16efb4b 100644 --- a/maps/boss/boss3_arena.tscn +++ b/maps/boss/boss3_arena.tscn @@ -26,6 +26,7 @@ texture = ExtResource( 9 ) centered = false [node name="GUI" type="CanvasLayer" parent="."] +visible = false [node name="Control" type="HBoxContainer" parent="GUI"] anchor_right = 1.0 diff --git a/menus/main_menu.gd b/menus/main_menu.gd index 9a38988..5fd16b3 100644 --- a/menus/main_menu.gd +++ b/menus/main_menu.gd @@ -1,8 +1,10 @@ +class_name MainMenu extends Node onready var continue_button = $Panel/Continue func _ready(): + Game.marathon_mode = false Fade.fade_in(Options.transition_speed_secs) #Grey out continue if no save files yield(get_tree(),"idle_frame") @@ -12,28 +14,34 @@ func _ready(): $Panel/Body/GreyedContinue.visible = true continue_button.visible = false $Panel/FileSelect.grab_focus() + if Game.last_mm_button != null: + get_node(Game.last_mm_button).grab_focus() Vector2( 0.83205, 0.5547 ) func _on_Continue_button_down(): + Game.last_mm_button = "Panel/Continue" Fade.fade_out(Options.transition_speed_secs) yield(Fade, "fade_finished") SceneManager.current_scene = load("res://menus/level_select_scholar.tscn").instance() func _on_FileSelect_button_down(): + Game.last_mm_button = @"Panel/FileSelect" Fade.fade_out(Options.transition_speed_secs) yield(Fade, "fade_finished") SceneManager.current_scene = load("res://menus/file_select.tscn").instance() func _on_Exit_button_down(): + Game.last_mm_button = @"Panel/FileSelect" Fade.fade_out(Options.transition_speed_secs) yield(Fade, "fade_finished") get_tree().quit() func _on_SoundTest_button_down(): + Game.last_mm_button = @"Panel/SoundTest" Fade.fade_out(Options.transition_speed_secs) yield(Fade, "fade_finished") SceneManager.current_scene = load("res://menus/sound_test.tscn").instance() @@ -41,12 +49,21 @@ func _on_SoundTest_button_down(): func _on_HighScores_button_down() -> void: + Game.last_mm_button = @"Panel/HighScores" Fade.fade_out(Options.transition_speed_secs) yield(Fade, "fade_finished") SceneManager.current_scene = load("res://menus/scoreboards.tscn").instance() func _on_Options_button_down() -> void: + Game.last_mm_button = @"Panel/Options" Fade.fade_out(Options.transition_speed_secs) yield(Fade, "fade_finished") SceneManager.current_scene = load("res://menus/options_menu.tscn").instance() + + +func _on_MarathonMode_button_down() -> void: + Game.last_mm_button = @"Panel/MarathonMode" + Fade.fade_out(Options.transition_speed_secs) + yield(Fade, "fade_finished") + SceneManager.current_scene = load("res://menus/marathon_start.tscn").instance() diff --git a/menus/main_menu.tscn b/menus/main_menu.tscn index db0cc2f..26b701f 100644 --- a/menus/main_menu.tscn +++ b/menus/main_menu.tscn @@ -247,6 +247,8 @@ align = 1 [connection signal="button_down" from="Panel/FileSelect" to="." method="_on_FileSelect_button_down"] [connection signal="button_down" from="Panel/FileSelect" to="MenuSounds" method="play_confirm_sound"] [connection signal="focus_entered" from="Panel/FileSelect" to="MenuSounds" method="play_select_sound"] +[connection signal="button_down" from="Panel/MarathonMode" to="." method="_on_MarathonMode_button_down"] +[connection signal="button_down" from="Panel/MarathonMode" to="MenuSounds" method="play_confirm_sound"] [connection signal="focus_entered" from="Panel/MarathonMode" to="MenuSounds" method="play_select_sound"] [connection signal="focus_entered" from="Panel/Augmentations" to="MenuSounds" method="play_select_sound"] [connection signal="button_down" from="Panel/Options" to="." method="_on_Options_button_down"] diff --git a/menus/marathon_results.gd b/menus/marathon_results.gd new file mode 100644 index 0000000..e003778 --- /dev/null +++ b/menus/marathon_results.gd @@ -0,0 +1,19 @@ +extends Control + + +onready var score: Label = $"%Score" +onready var shards: Label = $"%Shards" + + +func _ready() -> void: + Audio.play_music(load("res://audio/music/rumble_revolution_demo.ogg")) + score.text = score.text % Game.marathon_score + shards.text = shards.text % Game.marathon_shards + Fade.fade_in() + + +func _input(event: InputEvent) -> void: + if Input.is_action_just_pressed("ui_accept"): + Fade.fade_out(Options.transition_speed_secs) + yield(Fade, "fade_finished") + Game.change_map(load("res://menus/marathon_start.tscn")) diff --git a/menus/marathon_results.tscn b/menus/marathon_results.tscn new file mode 100644 index 0000000..bd02188 --- /dev/null +++ b/menus/marathon_results.tscn @@ -0,0 +1,77 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=1] +[ext_resource path="res://ui/theme.tres" type="Theme" id=2] +[ext_resource path="res://menus/marathon_results.gd" type="Script" id=3] +[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=4] + +[sub_resource type="ShaderMaterial" id=1] +shader = ExtResource( 1 ) +shader_param/color_1 = Color( 1, 0.709804, 0.380392, 1 ) +shader_param/color_2 = Color( 0.345098, 0.945098, 0.905882, 1 ) +shader_param/checker_size = Vector2( 24, 24 ) +shader_param/pan_speed = Vector2( 8, 12 ) +shader_param/cycle_speed = Vector2( 4, 4 ) +shader_param/cycle_alternation = Vector2( 4, 4 ) +shader_param/uv_transform = Transform2D( 1, 0, 1, 1, 0, 0 ) + +[node name="MarathonResults" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = ExtResource( 2 ) +script = ExtResource( 3 ) + +[node name="Background" type="ColorRect" parent="."] +material = SubResource( 1 ) +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="Panel" type="Panel" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -60.0 +margin_top = -32.0 +margin_right = 60.0 +margin_bottom = 38.0 + +[node name="Label" type="Label" parent="Panel"] +material = ExtResource( 4 ) +anchor_right = 1.0 +margin_bottom = 22.0 +text = "Good Job!" +align = 1 +valign = 1 + +[node name="Score" type="Label" parent="Panel"] +unique_name_in_owner = true +material = ExtResource( 4 ) +anchor_right = 1.0 +margin_left = 4.0 +margin_top = 24.0 +margin_right = -4.0 +margin_bottom = 46.0 +text = "Score: %05d" +align = 1 +valign = 1 + +[node name="Shards" type="Label" parent="Panel"] +unique_name_in_owner = true +material = ExtResource( 4 ) +anchor_right = 1.0 +margin_left = 4.0 +margin_top = 46.0 +margin_right = -4.0 +margin_bottom = 68.0 +text = "got %d shards!" +align = 1 +valign = 1 + +[node name="ComingSoon" type="Label" parent="."] +material = ExtResource( 4 ) +margin_top = 16.0 +margin_right = 256.0 +margin_bottom = 39.0 +text = "Wow you done did it!" +align = 1 diff --git a/menus/marathon_select_lives.gd b/menus/marathon_select_lives.gd new file mode 100644 index 0000000..0ae291d --- /dev/null +++ b/menus/marathon_select_lives.gd @@ -0,0 +1,89 @@ +extends Button + + +const INFINITY_SIGIL := "▬↨" + + +var delay := 1.0 +var cooldown := 0.0 + + +onready var back_arrow: TextureRect = $"../BackArrow" +onready var next_arrow: TextureRect = $"../NextArrow" + + +func _ready() -> void: + _update_display() + + +func _process(delta: float) -> void: + if not has_focus(): + return + if Input.is_action_pressed("ui_left"): + if cooldown <= 0.0: + cooldown = delay + delay *= 0.5 + if Game.use_lives: + Game.marathon_lives -= 1 + if Game.marathon_lives < 0: + Game.use_lives = false + cooldown = INF + else: + Game.use_lives = true + Game.marathon_lives = 999 + cooldown -= delta + _update_display() + elif Input.is_action_pressed("ui_right"): + if cooldown <= 0.0: + cooldown = delay + delay *= 0.5 + if Game.use_lives: + Game.marathon_lives += 1 + if Game.marathon_lives > 999: + Game.use_lives = false + cooldown = INF + else: + Game.use_lives = true + Game.marathon_lives = 0 + cooldown -= delta + _update_display() + else: + cooldown = 0.0 + delay = 1.0 + + +func _update_display() -> void: + if Game.use_lives: + text = "%03d" % Game.marathon_lives + else: + text = INFINITY_SIGIL + + +#func _gui_input(event: InputEvent) -> void: +# if event.is_action_pressed("ui_left"): +# if Game.use_lives: +# Game.marathon_lives -= 1 +# if Game.marathon_lives < 0: +# Game.use_lives = false +# else: +# Game.use_lives = true +# Game.marathon_lives = 999 +# if event.is_action_pressed("ui_right"): +# if Game.use_lives: +# Game.marathon_lives += 1 +# if Game.marathon_lives > 999: +# Game.use_lives = false +# else: +# Game.use_lives = true +# Game.marathon_lives = 0 +# _update_display() + + +func _on_focus_entered() -> void: + back_arrow.visible = true + next_arrow.visible = true + + +func _on_focus_exited() -> void: + back_arrow.visible = false + next_arrow.visible = false diff --git a/menus/marathon_start.gd b/menus/marathon_start.gd new file mode 100644 index 0000000..2b753f6 --- /dev/null +++ b/menus/marathon_start.gd @@ -0,0 +1,49 @@ +extends Control + + +const DISABLED_COLOR := Color(0xb0b0b0ff) + + +onready var difficulty_buttons := [ + $"%BeginnerButton", + $"%AdvancedButton", + $"%AdvancedButton", + $"%ProfessionalButton", +] + + +func _ready() -> void: + Fade.fade_in(0.4) + Audio.play_music(load("res://audio/music/rumble_revolution_demo.ogg")) + yield(get_tree(), "idle_frame") + difficulty_buttons[Game.difficulty].grab_focus() + + +func _input(event: InputEvent) -> void: + if Input.is_action_just_pressed("ui_accept") or Input.is_action_just_pressed("pause"): + Game.marathon_mode = true + Game.lives = Game.marathon_lives + Game.marathon_score = 0 + Game.marathon_shards = 0 + Game.marathon_deaths = 0 + Game.current_level = LevelData.marathon_start + Game.change_map(LevelData.levels[Game.current_level].scene) + elif Input.is_action_just_pressed("ui_cancel"): + Game.marathon_mode = false + Game.current_level = 0 + Fade.fade_out(Options.transition_speed_secs) + yield(Fade, "fade_finished") + SceneManager.change_scene(load("res://menus/main_menu.tscn").instance()) + + +func _set_difficulty(difficulty: int) -> void: + var use_lives := Game.use_lives + Game.difficulty = difficulty + Game.use_lives = use_lives + for b in difficulty_buttons: + b.get_parent().modulate = DISABLED_COLOR + difficulty_buttons[difficulty].get_parent().modulate = Color.white + + +func _on_DifficultySelect_focus_entered() -> void: + difficulty_buttons[Game.difficulty].grab_focus() diff --git a/menus/marathon_start.tscn b/menus/marathon_start.tscn new file mode 100644 index 0000000..aa953a1 --- /dev/null +++ b/menus/marathon_start.tscn @@ -0,0 +1,250 @@ +[gd_scene load_steps=13 format=2] + +[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=1] +[ext_resource path="res://ui/theme.tres" type="Theme" id=2] +[ext_resource path="res://menus/marathon_start.gd" type="Script" id=3] +[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=5] +[ext_resource path="res://graphics/hud/file_select_arrow.png" type="Texture" id=6] +[ext_resource path="res://ui/2ndpuberty_scholar_outline.fnt" type="BitmapFont" id=7] +[ext_resource path="res://shaders/wibble_wobble.gdshader" type="Shader" id=8] +[ext_resource path="res://graphics/hud/pause_arrow.png" type="Texture" id=9] +[ext_resource path="res://menus/marathon_select_lives.gd" type="Script" id=10] + +[sub_resource type="ShaderMaterial" id=1] +shader = ExtResource( 1 ) +shader_param/color_1 = Color( 0.815686, 0.917647, 0.462745, 1 ) +shader_param/color_2 = Color( 0.152941, 0.772549, 0.356863, 1 ) +shader_param/checker_size = Vector2( 24, 24 ) +shader_param/pan_speed = Vector2( 8, 12 ) +shader_param/cycle_speed = Vector2( 4, 4 ) +shader_param/cycle_alternation = Vector2( 4, 4 ) +shader_param/uv_transform = Transform2D( 1, 0, 1, 1, 0, 0 ) + +[sub_resource type="ShaderMaterial" id=2] +shader = ExtResource( 8 ) +shader_param/speed = Vector2( 4, 0 ) +shader_param/ammount = Vector2( 2, 0 ) +shader_param/offset = Vector2( 0, 0 ) +shader_param/delay = Vector2( 0, 0 ) + +[sub_resource type="ShaderMaterial" id=3] +shader = ExtResource( 8 ) +shader_param/speed = Vector2( 4, 0 ) +shader_param/ammount = Vector2( 2, 0 ) +shader_param/offset = Vector2( 0, 0 ) +shader_param/delay = Vector2( 4, 0 ) + +[node name="MarathonStart" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = ExtResource( 2 ) +script = ExtResource( 3 ) + +[node name="Background" type="ColorRect" parent="."] +material = SubResource( 1 ) +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="PressStart" type="Label" parent="."] +material = ExtResource( 5 ) +anchor_right = 1.0 +margin_top = 160.0 +margin_bottom = 182.0 +theme = ExtResource( 2 ) +text = "Press start to begin" +align = 1 +valign = 1 + +[node name="FlavorText" type="Label" parent="."] +material = ExtResource( 5 ) +anchor_right = 1.0 +margin_top = 8.0 +margin_bottom = 31.0 +theme = ExtResource( 2 ) +text = "Begin your adventure... +in revolution 2083 world" +align = 1 +valign = 1 + +[node name="DifficultySelect" type="PanelContainer" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -112.0 +margin_top = -48.0 +margin_right = 112.0 +focus_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="DifficultySelect"] +margin_left = 3.0 +margin_top = 3.0 +margin_right = 221.0 +margin_bottom = 45.0 + +[node name="DiffcultySelect" type="Label" parent="DifficultySelect/VBoxContainer"] +material = ExtResource( 5 ) +margin_right = 218.0 +margin_bottom = 14.0 +rect_min_size = Vector2( 0, 14 ) +text = "difficulty select:" +align = 1 +valign = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="DifficultySelect/VBoxContainer"] +margin_top = 18.0 +margin_right = 218.0 +margin_bottom = 42.0 +custom_constants/separation = 8 +alignment = 1 + +[node name="Beginner" type="VBoxContainer" parent="DifficultySelect/VBoxContainer/HBoxContainer"] +margin_left = 41.0 +margin_right = 76.0 +margin_bottom = 24.0 +custom_constants/separation = 2 + +[node name="Label" type="Label" parent="DifficultySelect/VBoxContainer/HBoxContainer/Beginner"] +margin_right = 35.0 +margin_bottom = 10.0 +custom_fonts/font = ExtResource( 7 ) +text = "Sweet" + +[node name="BeginnerButton" type="TextureButton" parent="DifficultySelect/VBoxContainer/HBoxContainer/Beginner"] +unique_name_in_owner = true +margin_left = 17.0 +margin_top = 12.0 +margin_right = 17.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 0, 12 ) +focus_neighbour_right = NodePath("../../Advanced/AdvancedButton") +size_flags_horizontal = 4 +texture_focused = ExtResource( 6 ) +expand = true +stretch_mode = 3 + +[node name="Advanced" type="VBoxContainer" parent="DifficultySelect/VBoxContainer/HBoxContainer"] +margin_left = 84.0 +margin_right = 119.0 +margin_bottom = 24.0 +custom_constants/separation = 2 + +[node name="Label" type="Label" parent="DifficultySelect/VBoxContainer/HBoxContainer/Advanced"] +margin_right = 35.0 +margin_bottom = 10.0 +custom_fonts/font = ExtResource( 7 ) +text = "Spicy" + +[node name="AdvancedButton" type="TextureButton" parent="DifficultySelect/VBoxContainer/HBoxContainer/Advanced"] +unique_name_in_owner = true +margin_left = 17.0 +margin_top = 12.0 +margin_right = 17.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 0, 12 ) +focus_neighbour_left = NodePath("../../Beginner/BeginnerButton") +focus_neighbour_right = NodePath("../../Professional/ProfessionalButton") +size_flags_horizontal = 4 +texture_focused = ExtResource( 6 ) +expand = true +stretch_mode = 3 + +[node name="Professional" type="VBoxContainer" parent="DifficultySelect/VBoxContainer/HBoxContainer"] +margin_left = 127.0 +margin_right = 176.0 +margin_bottom = 24.0 +custom_constants/separation = 2 + +[node name="Label" type="Label" parent="DifficultySelect/VBoxContainer/HBoxContainer/Professional"] +margin_right = 49.0 +margin_bottom = 10.0 +custom_fonts/font = ExtResource( 7 ) +text = "Pungent" + +[node name="ProfessionalButton" type="TextureButton" parent="DifficultySelect/VBoxContainer/HBoxContainer/Professional"] +unique_name_in_owner = true +margin_left = 24.0 +margin_top = 12.0 +margin_right = 24.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 0, 12 ) +focus_neighbour_left = NodePath("../../Advanced/AdvancedButton") +size_flags_horizontal = 4 +texture_focused = ExtResource( 6 ) +expand = true +stretch_mode = 3 + +[node name="LivesSelect" type="PanelContainer" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -66.0 +margin_top = 7.0 +margin_right = 66.0 +margin_bottom = 39.0 + +[node name="VBoxContainer" type="VBoxContainer" parent="LivesSelect"] +margin_left = 3.0 +margin_top = 3.0 +margin_right = 129.0 +margin_bottom = 29.0 +custom_constants/separation = 0 + +[node name="Label" type="Label" parent="LivesSelect/VBoxContainer"] +material = ExtResource( 5 ) +margin_right = 126.0 +margin_bottom = 14.0 +rect_min_size = Vector2( 0, 14 ) +text = "number of lives:" +align = 1 +valign = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="LivesSelect/VBoxContainer"] +margin_top = 14.0 +margin_right = 126.0 +margin_bottom = 26.0 +rect_min_size = Vector2( 0, 12 ) +size_flags_horizontal = 3 +alignment = 1 + +[node name="BackArrow" type="TextureRect" parent="LivesSelect/VBoxContainer/HBoxContainer"] +visible = false +material = SubResource( 2 ) +margin_left = 51.0 +margin_top = 2.0 +margin_right = 57.0 +margin_bottom = 10.0 +size_flags_vertical = 4 +texture = ExtResource( 9 ) +flip_h = true + +[node name="SelectLives" type="Button" parent="LivesSelect/VBoxContainer/HBoxContainer"] +margin_left = 56.0 +margin_right = 70.0 +margin_bottom = 12.0 +focus_neighbour_left = NodePath(".") +focus_neighbour_top = NodePath("../../../../DifficultySelect") +focus_neighbour_right = NodePath(".") +theme = ExtResource( 2 ) +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_fonts/font = ExtResource( 7 ) +text = "▬↨" +script = ExtResource( 10 ) + +[node name="NextArrow" type="TextureRect" parent="LivesSelect/VBoxContainer/HBoxContainer"] +visible = false +material = SubResource( 3 ) +margin_left = 69.0 +margin_top = 2.0 +margin_right = 75.0 +margin_bottom = 10.0 +size_flags_vertical = 4 +texture = ExtResource( 9 ) + +[connection signal="focus_entered" from="DifficultySelect" to="." method="_on_DifficultySelect_focus_entered"] +[connection signal="focus_entered" from="DifficultySelect/VBoxContainer/HBoxContainer/Beginner/BeginnerButton" to="." method="_set_difficulty" binds= [ 0 ]] +[connection signal="focus_entered" from="DifficultySelect/VBoxContainer/HBoxContainer/Advanced/AdvancedButton" to="." method="_set_difficulty" binds= [ 2 ]] +[connection signal="focus_entered" from="DifficultySelect/VBoxContainer/HBoxContainer/Professional/ProfessionalButton" to="." method="_set_difficulty" binds= [ 3 ]] +[connection signal="focus_entered" from="LivesSelect/VBoxContainer/HBoxContainer/SelectLives" to="LivesSelect/VBoxContainer/HBoxContainer/SelectLives" method="_on_focus_entered"] +[connection signal="focus_exited" from="LivesSelect/VBoxContainer/HBoxContainer/SelectLives" to="LivesSelect/VBoxContainer/HBoxContainer/SelectLives" method="_on_focus_exited"] diff --git a/menus/results.gd b/menus/results.gd index cde0dbb..026fe7d 100644 --- a/menus/results.gd +++ b/menus/results.gd @@ -51,6 +51,15 @@ func final_score(): func _on_AnimationPlayer_animation_finished(anim_name): + if Game.marathon_mode: + Game.current_level += 1 + if Game.current_level > LevelData.marathon_end: + Fade.fade_out(Options.transition_speed_secs) + yield(Fade, "fade_finished") + SceneManager.change_scene(load("res://menus/marathon_results.tscn").instance()) + else: + Game.change_map(LevelData.levels[Game.current_level].scene) + return Fade.fade_out(Options.transition_speed_secs) yield(Fade, "fade_finished") if Debug.is_cheating == false: diff --git a/objects/hud/hud.gd b/objects/hud/hud.gd index c2a4037..9341134 100644 --- a/objects/hud/hud.gd +++ b/objects/hud/hud.gd @@ -70,9 +70,12 @@ func _physics_process(delta): if Game.use_lives: lives_counter.text = str(Game.lives) else: - lives_counter.text = str(Game.deaths) + if Game.marathon_mode: + lives_counter.text = str(Game.marathon_deaths) + else: + lives_counter.text = str(Game.deaths) #Life bonus color - if Game.lives == 2: + if Game.deaths <= 0: lives_counter.modulate = bonus_color else: lives_counter.modulate = Color.white diff --git a/project.godot b/project.godot index b78cbab..37337f3 100644 --- a/project.godot +++ b/project.godot @@ -29,6 +29,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://scripts/level_entry.gd" }, { +"base": "Node", +"class": "MainMenu", +"language": "GDScript", +"path": "res://menus/main_menu.gd" +}, { "base": "State", "class": "ParallelState", "language": "GDScript", @@ -64,6 +69,7 @@ _global_script_class_icons={ "BallSnake": "", "CompoundState": "res://addons/godot_state_charts/compound_state.svg", "LevelEntry": "", +"MainMenu": "", "ParallelState": "res://addons/godot_state_charts/parallel_state.svg", "RadioButtons": "", "State": "res://addons/godot_state_charts/state.svg", diff --git a/ui/2ndpuberty_scholar_outline.png b/ui/2ndpuberty_scholar_outline.png index c72a8ee5bdd15454fae3552f9ba731afef648d7f..edacf109ba4fd96fc96f4c38fa781dd8f9a4c401 100644 G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