官术网_书友最值得收藏!

Game over

The final task for your UI is to react to the game ending:

func show_game_over():
show_message("Game Over")
yield($MessageTimer, "timeout")
$StartButton.show()
$MessageLabel.text = "Coin Dash!"
$MessageLabel.show()

In this function, you need the Game Over message to be displayed for two seconds and then disappear, which is what show_message() does. However, you also want to show the start button once the message has disappeared. The yield() function pauses execution of the function until the given node (MessageTimer) emits a given signal (timeout). Once the signal is received, the function continues, returning you to the initial state so that you can play again.

主站蜘蛛池模板: 上蔡县| 大厂| 平湖市| 嘉善县| 屯门区| 泽州县| 长泰县| 全南县| 吉木萨尔县| 崇阳县| 噶尔县| 龙山县| 遂平县| 安丘市| 滁州市| 土默特左旗| 安宁市| 屏山县| 常德市| 长宁县| 宜黄县| 英超| 逊克县| 合作市| 名山县| 静安区| 萝北县| 东莞市| 宁远县| 堆龙德庆县| 常宁市| 简阳市| 万年县| 池州市| 体育| 肇东市| 湖口县| 磐安县| 繁昌县| 城口县| 南华县|