Side scrolling tunnel

Hey,

I used to play this cool game (till the blocked it in school :() where you click and a helicopter flys up, while its going through a tunnel. Decided to try recreating the fun but having problems when it comes to deleting the sections of the tunnel after they go off the screen. I’ll show you what I mean.

scenewidth = 550
points = 20;
x= 0;
speed = 10;
tunnel = 80
y = Math.random()*200 + 100
function level (x, y){
_root.lineStyle(10, 0xFF0000, 100)
_root.moveTo(x, 400)
_root.lineTo(x, y)
_root.lineTo(x+scenewidth/points, y)
_root.lineTo(x+scenewidth/points, 400)

_root.moveTo(x, 0)
_root.lineTo(x, y-tunnel)
_root.lineTo(x+scenewidth/points, y-tunnel)
_root.lineTo(x+scenewidth/points, 0)

}

onEnterFrame = function(){
for ( var i=0; i < points; i ++ ){
level (x, y)
x+=scenewidth/points
y+=Math.random()*20-10
}
_x -= speed;
}

If someone could help me remove the clips after they go off the left of the screen would be great, thanks :slight_smile:

Sam