- Godot Engine Game Development Projects
- Chris Bradfield
- 86字
- 2021-06-18 18:51:29
Checking for remaining coins
The main script needs to detect whether the player has picked up all of the coins. Since the coins are all children of CoinCointainer, you can use get_child_count() on this node to find out how many coins remain. Put this in the _process() function so that it will be checked every frame:
func _process(delta):
if playing and $CoinContainer.get_child_count() == 0:
level += 1
time_left += 5
spawn_coins()
If no more coins remain, then the player advances to the next level.
推薦閱讀
- 三菱FX3U/5U PLC從入門到精通
- Circos Data Visualization How-to
- Deep Learning Quick Reference
- 7天精通Dreamweaver CS5網(wǎng)頁設計與制作
- 教父母學會上網(wǎng)
- Dreamweaver CS3網(wǎng)頁設計50例
- 網(wǎng)上生活必備
- 現(xiàn)代機械運動控制技術(shù)
- STM32嵌入式微控制器快速上手
- Visual C++編程全能詞典
- 21天學通Java Web開發(fā)
- 教育機器人的風口:全球發(fā)展現(xiàn)狀及趨勢
- Apache源代碼全景分析(第1卷):體系結(jié)構(gòu)與核心模塊
- Flink原理與實踐
- IBM? SmartCloud? Essentials