You may have found a bug in the way the createEdgeSprites() and ball.bounceOff(edges) commands work. When I change your velocity to a speed lower than 15, it appears to work great. It bounces just fine and appears to do so indefinitely. However, at a higher velocity, the ball is somehow escaping the screen at the corners. This happens almost every time when the X and Y velocity are the same (as that causes it to perfectly hit the corner), but if you change one of them to a different number, such as 18 or 19, the ball bounces around the screen for a while, but any time there is a near direct hit on the corner, it escapes.
I don’t know exactly for for sure why, but I’m guessing the “edge sprites” that are created, although invisible, are thinner in the corner and at high velocities, the ball skips just enough pixels that it jumps over the border. Same thing happens when I remove the ball.velocityY command and set the ball.velocityX command to a high number (over 400). The ball skips over the edge and disappears from the screen.
If you need to use that high of a velocity in your program, you may manually have to create some sprites the top, bottom, left and right of your screen that are fairly tall and wide so the ball won’t skip over them or use a conditional block to check the x and y positions of the ball.
Let us know if we can help.