# Wall collision with a scrolling effect

**URL:** <https://forum.kirupa.com/t/wall-collision-with-a-scrolling-effect/231012>\
**Category:** Uncategorized\
**Created:** [July 1, 2007, 4:21am UTC](https://forum.kirupa.com/t/wall-collision-with-a-scrolling-effect/231012 "2007-07-01T04:21:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snowboundmage](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@snowboundmage](https://forum.kirupa.com/u/snowboundmage)\
**Post date:** [July 1, 2007, 4:21am UTC](https://forum.kirupa.com/t/wall-collision-with-a-scrolling-effect/231012/1 "2007-07-01T04:21:47Z")

</div>

Does anyone know how to make a collision with this script?

onClipEvent (enterFrame) {  
if (Key.isDown(Key.LEFT)) {  
scroll = 20;  
xspeed = 0;  
this.\_x -= 20;  
\_root.\_x += scroll;  
}  
if (Key.isDown(Key.RIGHT)) {  
scroll = 20;  
xspeed = 0;  
this.\_x += 20;  
\_root.\_x -= scroll;  
}  
}

Any help would be arrrrrr-preciated!:pirate3:
