137
社区成员
发帖
与我相关
我的任务
分享

给跳台Node2D节点添加代码,使其生成随机的Scale_x的值,从而产生生成不同宽度的跳台。

#Block.gd
extends Node2D
func _ready():
scale.x += randf()*0.8-1.0 #x轴比例大小的范围(0.8,1)
func _process(delta):
position += Vector2.LEFT*750.0*delta
if position.x < 0:
queue_free()
