Thanks for the sample project. I’ve looked into this and there are two separate things going on.
The flickering looks machine-dependent. I can’t reproduce that here, and your edit notes that other Windows machines don’t show it either, so I’ll need more information before treating that as a confirmed GameCanvas rendering bug: Windows version, GPU model, driver version, display scaling, and ideally a short screen recording.
The boundary behaviour is clearer. CollidesWithBoundary = True means “fire SpriteBoundaryCollision when this sprite touches or crosses a boundary”. It does not automatically keep the sprite inside the GameCanvas. In the sample project, the collision handler reverses velocity, but it does not move the sprite back inside the canvas. If a frame overshoots the bottom edge, the sprite can remain partly outside the canvas and keep firing boundary collisions on following frames.
A safer bounce handler clamps the sprite to the edge and sets the outgoing velocity direction explicitly:
Sub PlayCanvas_SpriteBoundaryCollision(sprite As Sprite, boundary As Integer)
If boundary = GameCanvas.LEFT Then
sprite.X = sprite.Width * sprite.OriginX
sprite.VelocityX = sprite.VelocityX.Abs()
ElseIf boundary = GameCanvas.RIGHT Then
sprite.X = PlayCanvas.Width - (sprite.Width * (1.0 - sprite.OriginX))
sprite.VelocityX = 0.0 - sprite.VelocityX.Abs()
ElseIf boundary = GameCanvas.TOP Then
sprite.Y = sprite.Height * sprite.OriginY
sprite.VelocityY = sprite.VelocityY.Abs()
ElseIf boundary = GameCanvas.BOTTOM Then
sprite.Y = PlayCanvas.Height - (sprite.Height * (1.0 - sprite.OriginY))
sprite.VelocityY = 0.0 - sprite.VelocityY.Abs()
End If
End Sub
The sliders in the sample also always write a positive velocity, so moving a slider can force the ball to start moving right/down even if it was previously travelling left/up. That can make it look as though the trajectory changed in the middle of the canvas.
I’ve updated the GameCanvas documentation to make this clearer and to show the safer clamp-and-bounce pattern.