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

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.

主站蜘蛛池模板: 丹凤县| 弥渡县| 沂源县| 永泰县| 措勤县| 简阳市| 宣城市| 隆林| 元氏县| 晋江市| 峨山| 桦南县| 安仁县| 临桂县| 驻马店市| 金平| 米脂县| 修水县| 舒兰市| 射洪县| 阜新市| 邮箱| 克拉玛依市| 西城区| 安达市| 安丘市| 凤山市| 德化县| 永丰县| 上高县| 北海市| 富民县| 循化| 涞源县| 济南市| 尤溪县| 宣城市| 宕昌县| 长葛市| 于都县| 阳春市|