- Godot Engine Game Development Projects
- Chris Bradfield
- 102字
- 2021-06-18 18:51:31
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.
推薦閱讀
- Dreamweaver CS3+Flash CS3+Fireworks CS3創意網站構建實例詳解
- Dreamweaver CS3網頁制作融會貫通
- 工業機器人工程應用虛擬仿真教程:MotoSim EG-VRC
- STM32嵌入式微控制器快速上手
- 數據庫系統原理及應用教程(第5版)
- Apache Superset Quick Start Guide
- The Python Workshop
- Mastering ServiceNow Scripting
- Docker on Amazon Web Services
- 新編計算機圖形學
- Excel 2007常見技法與行業應用實例精講
- Godot Engine Game Development Projects
- 空間機械臂建模、規劃與控制
- MATLAB-Simulink系統仿真超級學習手冊
- 數據要素:全球經濟社會發展的新動力