1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00
Files
fallingshrimp b343708b3b feat: 添加SCBlock和Bengbeng子弹类型及相关资源
feat(角色): 为Kernyr和CyberCat添加新攻击类型

refactor(角色): 更新Kernyr角色贴图和显示名称

feat(关卡): 调整测试关卡配置和敌人波次

style: 更新子弹资源文件及导入配置
2026-04-04 21:07:16 +08:00

29 lines
796 B
GDScript

extends BulletBase
class_name SCBlockBullet
var speedV2 = Vector2.ZERO
func register():
speedV2 = Vector2(
(launcher.currentFocusedBoss.position - launcher.position)
.sign().x
* randf_range(-0.25, 1)
* 100,
-50
)
func spawn():
var staticTexture = texture.get_node_or_null("static")
if staticTexture is Sprite2D:
var text = load("res://resources/bullets/scblock/%d.png" % randi_range(0, 8))
staticTexture.texture = text
var trail = staticTexture.get_node_or_null("trail")
if trail is GPUParticles2D:
trail.texture = text
func ai():
rotation = speedV2.angle()
speed = speedV2.length()
PresetBulletAI.trace(self , position + Vector2.from_angle(deg_to_rad(90)), lifeTimePercent() / 15)
PresetBulletAI.forward(self , rotation)
speedV2 *= 0.95
speedV2 += Vector2(0, 1)