# Side scrolling tunnel

**URL:** <https://forum.kirupa.com/t/side-scrolling-tunnel/178842>\
**Category:** Uncategorized\
**Created:** [February 14, 2006, 6:13pm UTC](https://forum.kirupa.com/t/side-scrolling-tunnel/178842 "2006-02-14T18:13:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![slideth3](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@slideth3](https://forum.kirupa.com/u/slideth3)\
**Post date:** [February 14, 2006, 6:13pm UTC](https://forum.kirupa.com/t/side-scrolling-tunnel/178842/1 "2006-02-14T18:13:56Z")

</div>

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.

```auto
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 🙂

Sam
