diff --git a/src/Actors/Ball.gd b/src/Actors/Ball.gd index afd8c5f..2bf2127 100644 --- a/src/Actors/Ball.gd +++ b/src/Actors/Ball.gd @@ -1,6 +1,7 @@ extends Actor export var top_speed: = 1000 +onready var particles: Particles2D = $Particles2D func _ready() -> void: randomize() @@ -15,8 +16,12 @@ func _on_BounceCheck_body_entered(body: PhysicsBody2D) -> void: bounce(body) func bounce(object: PhysicsBody2D) -> void: - if speed.x <= top_speed: + if speed.x >= top_speed: + speed.x = top_speed + particles.visible = true + else: speed.x *= 1.1 + if object is Actor: _direction.x = -_direction.x $"SFX/BounceSound-2".play()