mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 15:01:53 +08:00
8d841b2f7b
添加新的熊角色贴图和遮罩资源 实现新的攻击类型7并调整现有攻击逻辑 优化动画和碰撞体设置 移除旧的SVG资源文件
33 lines
1.2 KiB
GDScript
33 lines
1.2 KiB
GDScript
extends BulletBase
|
|
|
|
@export var allColor: GradientTexture1D = null
|
|
@export var length: float = 1000
|
|
|
|
@onready var track: ShaderStage = $"%track"
|
|
@onready var sword: Sprite2D = $"%sword"
|
|
@onready var points: GPUParticles2D = $"%points"
|
|
|
|
var myColor: Color
|
|
func register():
|
|
speed = 1
|
|
damage = 5
|
|
penerate = 1
|
|
func spawn():
|
|
myColor = allColor.gradient.sample(randf())
|
|
track.material = track.material.duplicate()
|
|
points.process_material = points.process_material.duplicate()
|
|
setColor(myColor)
|
|
track.size.x = length
|
|
TickTool.modifyAnimationKey(animator, "spawn", "sword:position:x", Animation.TrackType.TYPE_BEZIER, 2.5, length / -2)
|
|
TickTool.modifyAnimationKey(animator, "spawn", "sword:position:x", Animation.TrackType.TYPE_BEZIER, 3, length / 2)
|
|
TickTool.modifyAnimationKey(animator, "spawn", "%hitbox:position:x", Animation.TrackType.TYPE_BEZIER, 2.5, length / -2)
|
|
TickTool.modifyAnimationKey(animator, "spawn", "%hitbox:position:x", Animation.TrackType.TYPE_BEZIER, 3, length / 2)
|
|
await TickTool.millseconds(2500)
|
|
points.emitting = true
|
|
func setColor(color: Color):
|
|
var result = Color(color)
|
|
result.a = 0
|
|
track.material.set_shader_parameter("color", result)
|
|
sword.modulate = color
|
|
points.process_material.color = color
|