投射物 的《Laser Bolt》是这一分类里 15 帧的循环特效。帧尺寸 128×32,整张精灵表 256×256 像素、2 列排布,播放帧率 30 fps,pivot 原点落在 (108, 16)。飞行的箭矢、弹丸与能量体,负责把攻击意图可视化到落点。
| fx_id | res://effects/sheets/projectiles/laser-bolt |
|---|---|
| 分类 | 投射物 / projectiles |
| 帧数 | 15 帧 |
| 单帧尺寸 | 128 × 32 |
| 精灵表尺寸 | 256 × 256(2 列) |
| 播放帧率 | 30 fps |
| 循环 | 是(loop = true) |
| pivot 原点 | (108, 16) |
| 整段时长 | 0.49 秒 |
| 源文件 | laser-bolt.png + laser-bolt.json |
# 1. 场景里加一个 FxPlayer 节点(Node2D) # 2. 检查器里填 fx_id,其余保持默认即可 fx_id = "projectiles/laser-bolt" sheets_dir = "res://effects/sheets" auto_play = true play_speed = 1.0
var fx := FxPlayer.new() fx.fx_id = "projectiles/laser-bolt" fx.auto_play = false add_child(fx) fx.load_fx("projectiles/laser-bolt") fx.play(1) # 1 = 循环播放 # 命中结束或技能中断时回收 fx.stop() fx.queue_free()