Use sin or cos and total_ticks to make the bar change its size at all times. Use vec_dist to detect if the ball has come close enough to a certain entity. Let me know if you have problems with the code and I'll answer your question in the following magazine.