Game Over

A couple of modifications: Cube Dude Soccer (because America). I made the scores show the color of the player, as well as showing the player’s color in the winner text.

I found it unsatisfying to slam the ball into the goal only to have the ball and players freeze abruptly, so I use two timers. The GoalTimer starts once a goal has been scored. This gives the ball a few seconds to bounce around and the players time to keep running, do a victory dance, etc, before a second timer freezes the action for two seconds. After the second timer, the ball and player positions reset. I set a goals_active variable to false after scoring a goal so no additional goals are scored during gloating time.

When the game is over, I show the Game Over popup, and just don’t set goals_active to true again. The players can still run around until someone clicks Play Again.

One problem: I first tried showing my popup with Popup.show(). When I tried changing to Popup.popup_centered(), my on_Button_pressed() function was no longer being called. I tried disconnecting and making a new connection, but it didn’t work. Clicking the Try Again button would dismiss the popup without calling the function to reload the scene. I changed back to Popup.show() and everything is fine again. Not sure what’s up with that.

1 Like

Hm - not sure what’s happening there. If you’ve not changed the script and you’re reconnecting the signals after the node change, it should work the same? Might be a bug in Godot

Privacy & Terms