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

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.

主站蜘蛛池模板: 临澧县| 无锡市| 凉城县| 讷河市| 固阳县| 泸西县| 苍梧县| 绥化市| 康平县| 阿克| 石棉县| 嘉祥县| 乌鲁木齐县| 临汾市| 商河县| 故城县| 广德县| 永仁县| 布尔津县| 台山市| 临桂县| 申扎县| 平谷区| 孝昌县| 万年县| 高青县| 富阳市| 浦东新区| 资溪县| 青岛市| 长兴县| 正蓝旗| 班玛县| 四川省| 桓台县| 达拉特旗| 宽甸| 河池市| 贵州省| 嘉祥县| 偏关县|