Scrolling moving clouds

I am creating a platform game and would like to have clouds that move at the top of the screen to add an extra dynamic but I am having trouble with this as I would like to have the clouds reappear as they leave the game screen.

I tried to use a invisible sprite and after a cloud hit it to create new clouds but this didn’t work well does anyone know a way to do this.

This is my code so far I looked into parallax scrolling but I only want the clouds to move nothing else.

You can check their X position against camera borders


Cloud X position is LESS THAN CameraBorderLeft()+Cloud.Width()

Delete Cloud

That was for left i mean if your clouds appear from the right and goes left

IF they appear on left and go right

Cloud X position is GREATER THAN CameraBorderRight()

Delete Cloud

For up it is the same
Top and bottom instead of Left and Right
And for Top you add+Cloud.Hegiht() instead of Width like you would with Left camera border

Where now you just spawn them off screen
For example if you want them spawn OFF screen on the right
You would go with
Create object Cloud at CameraBorderRight()+200
And so cloud will be spawned 200 pixels to the right from right camera border

There is also Tiled sprite object
For example i have these 2


And i get this

With this