mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-01 17:01:53 +08:00
21 lines
403 B
GDScript
21 lines
403 B
GDScript
|
|
extends BulletBase
|
||
|
|
|
||
|
|
@export var allColor: GradientTexture1D = null
|
||
|
|
|
||
|
|
var myColor: Color
|
||
|
|
|
||
|
|
func register():
|
||
|
|
damage = 5
|
||
|
|
penerate = 1
|
||
|
|
func spawn():
|
||
|
|
myColor = allColor.gradient.sample(randf())
|
||
|
|
setColor(myColor)
|
||
|
|
|
||
|
|
func ai():
|
||
|
|
speed = (11000 - timeLived()) / 11000 * initialSpeed
|
||
|
|
rotation_degrees += speed / 10
|
||
|
|
PresetBulletAI.forward(self, rotation)
|
||
|
|
|
||
|
|
func setColor(color: Color):
|
||
|
|
texture.modulate = color
|