14 lines
393 B
GDScript
14 lines
393 B
GDScript
extends Projectile
|
|
class_name StraightProjectile
|
|
|
|
# Прямой снаряд для стрельбы
|
|
|
|
func _ready():
|
|
super._ready()
|
|
# Устанавливаем скорость только горизонтально (параллельно земле)
|
|
var horizontal_dir = direction
|
|
horizontal_dir.y = 0
|
|
horizontal_dir = horizontal_dir.normalized()
|
|
velocity = horizontal_dir * speed
|
|
|