Skip to content

Commit

Permalink
Merge pull request #40 from miketvo/dev
Browse files Browse the repository at this point in the history
[p0ng-bugfix] Game Over UI menu not working properly
  • Loading branch information
miketvo authored Aug 7, 2024
2 parents d31d985 + 70bccf7 commit ba78ec2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/export-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- synchronize
branches:
- dev
push:
tags:
- '*'

env:
GODOT_VERSION: 4.2.2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/export-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- synchronize
branches:
- main
- dev
push:
tags:
- '*'

env:
GODOT_VERSION: 4.2.2
Expand Down
2 changes: 1 addition & 1 deletion p0ng/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config_version=5
[application]

config/name="p0ng"
config/version="1.1.3"
config/version="1.1.4"
run/main_scene="res://scenes/main.tscn"
config/use_custom_user_dir=true
config/custom_user_dir_name="ambientlamp/p0ng"
Expand Down
8 changes: 4 additions & 4 deletions p0ng/scripts/scenes/game/game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ func _ready() -> void:


func _process(_delta: float) -> void:
_game_hud.update_score_labels(left_score, right_score, _game_point_state)
if _game_over:
_game_ui.game_over(winner)
pause()
if not _game_over:
_game_hud.update_score_labels(left_score, right_score, _game_point_state)


func _physics_process(delta: float) -> void:
Expand Down Expand Up @@ -333,6 +331,8 @@ func _win_round(winning_side: int) -> void:
func _win_game(winning_side: int) -> void:
winner = winning_side
_sfx_controller.play_sound("GameEndSfx")
_game_ui.game_over(winner)
_game_over = true
pause()
#endregion
# ============================================================================ #
2 changes: 2 additions & 0 deletions p0ng/scripts/scenes/game/game_ui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func _ready() -> void:
child.connect("pressed", _on_ui_scene_changer_button_pressed)

_endgame_dialog.modulate = Color(1.0, 1.0, 1.0, 0.0)
_endgame_dialog.visible = false
_win_label[Global.SIDE_LEFT].hide()
_win_label[Global.SIDE_RIGHT].hide()
_lose_label[Global.SIDE_LEFT].hide()
Expand Down Expand Up @@ -103,6 +104,7 @@ func game_over(winning_side: int) -> void:
_:
assert(false, "Unrecognized side")

_endgame_dialog.visible = true
_endgame_dialog.get_node("MenuContainer/VBoxContainer/RestartButton").grab_focus()
tween_transition_fade_appear_container(
_endgame_dialog,
Expand Down

0 comments on commit ba78ec2

Please sign in to comment.