当碰到挡板
area.direction = Vector2(_ball_dir, randf() * 2 - 1).normalized()
当碰到天花板或者地板
area.direction = (area.direction + Vector2(0, _bounce_direction)).normalized()
完整源码:
当碰到挡板
area.direction = Vector2(_ball_dir, randf() * 2 - 1).normalized()
当碰到天花板或者地板
area.direction = (area.direction + Vector2(0, _bounce_direction)).normalized()
完整源码: