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

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.

主站蜘蛛池模板: 抚顺县| 中方县| 手游| 通州市| 谷城县| 华亭县| 呼图壁县| 五家渠市| 玛纳斯县| 石林| 房产| 民丰县| 成安县| 大城县| 左权县| 焦作市| 库伦旗| 民勤县| 洪湖市| 华安县| 梨树县| 永寿县| 江永县| 巴南区| 五寨县| 肇源县| 天峻县| 长丰县| 恭城| 盐亭县| 江都市| 娄底市| 绥宁县| 自治县| 宝坻区| 靖安县| 北海市| 普安县| 故城县| 龙山县| 永兴县|