Sparkles and Powerball

This commit is contained in:
2024-05-07 23:12:23 +01:00
parent 0017d49923
commit 0cc0b4a40b
8 changed files with 113 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
extends RigidBody2D
class_name Ball
const MIN_SPEED = 50.0
const MAX_SPEED = 500.0
@@ -23,6 +24,7 @@ func _physics_process(delta: float) -> void:
PhysicsServer2D.BODY_STATE_TRANSFORM,
Transform2D.IDENTITY.translated(capture_object.global_position - capture_offset)
)
global_position = capture_object.global_position - capture_offset
linear_velocity = Vector2.ZERO
angular_velocity = 0
else:
@@ -77,3 +79,13 @@ func _on_body_exited(body: Node) -> void:
func slowdown() -> void:
speed = 100
func _on_body_entered(body: Node) -> void:
pass # Replace with function body.
func enable_sparkles() -> void:
$CPUParticles2D.emitting = true
func disable_sparkles() -> void:
$CPUParticles2D.emitting = false