Why is my square growing?

I am trying to code flappy bird for the EV3 mindstorms and am trying to make pipes go across the screen, but the pipe is growing while going over the screen, can someone help me?

let scroll = 0
let pipe = image.create(screen.width, screen.height)
forever(function () {
scroll += 5
brick.showImage(pipe)
pipe.fill(2)
pipe.fillRect(scroll, 0, scroll + 15, 75, 1)
})

1 Like

change the:
pipe.fillRect(scroll, 0, scroll + 15, 75, 1)
to:
pipe.fillRect(scroll, 0, 15, 75, 1)
why:
“fillRect” uses “at x,y with w,h” but you used “from x,y to x,y”.

1 Like

ah Thanks! :slight_smile:

1 Like

Glad I could help, @TruestLegend.

@robotosaurus and how can I display the text?