yes, they canjj st!
This commit is contained in:
parent
6b92473eeb
commit
a6421235f8
22 changed files with 510 additions and 14 deletions
15
systems/bullets/behaviors/simple_linear_behavior.gd
Normal file
15
systems/bullets/behaviors/simple_linear_behavior.gd
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
class_name SimpleLinearBehavior
|
||||
extends BulletBehavior
|
||||
## Makes bullets move in [member Bullet.direction], potentially accelerating.
|
||||
|
||||
|
||||
## Initial speed of the bullet when it is spawned.
|
||||
@export_custom(0, "suffix:px/s") var initial_speed: float = 0.0
|
||||
|
||||
## Rate at which the bullet will speed up.
|
||||
@export_custom(0, "suffix:px/s²") var acceleration: float = 0.0
|
||||
|
||||
|
||||
func process_bullet(bullet: Bullet, delta: float) -> void:
|
||||
var speed = initial_speed + acceleration * bullet.time_elapsed
|
||||
bullet.position += bullet.direction * speed * delta
|
||||
Loading…
Add table
Add a link
Reference in a new issue