diff --git a/community/parallax-scrolling-background/scrolling_background.go b/community/parallax-scrolling-background/scrolling_background.go index 87ba83f..8982fde 100644 --- a/community/parallax-scrolling-background/scrolling_background.go +++ b/community/parallax-scrolling-background/scrolling_background.go @@ -40,13 +40,13 @@ func NewScrollingBackground(pic pixel.Picture, width, height, speed float64) *Sc func (sb *ScrollingBackground) positionImages() { if sb.speed > 0 { sb.positions = [2]pixel.Vec{ - pixel.V(sb.width/2, (sb.height/2)+1), - pixel.V((sb.width/2)-sb.width, (sb.height/2)+1), + pixel.V(sb.width/2, (sb.height / 2)), + pixel.V((sb.width/2)-sb.width, (sb.height / 2)), } } else { sb.positions = [2]pixel.Vec{ - pixel.V(sb.width/2, (sb.height/2)+1), - pixel.V(sb.width+(sb.width/2), (sb.height/2)+1), + pixel.V(sb.width/2, (sb.height / 2)), + pixel.V(sb.width+(sb.width/2), (sb.height / 2)), } } }