# Collisions?

**URL:** <https://forum.kirupa.com/t/collisions/269360>\
**Category:** Uncategorized\
**Created:** [August 26, 2008, 4:37pm UTC](https://forum.kirupa.com/t/collisions/269360 "2008-08-26T16:37:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robbyk](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@robbyk](https://forum.kirupa.com/u/robbyk)\
**Post date:** [August 26, 2008, 4:37pm UTC](https://forum.kirupa.com/t/collisions/269360/1 "2008-08-26T16:37:25Z")

</div>

Well I’m an Amateur in AS2 coding so Here is the code i use for walking,

on(keyPress “\<Up\>”)  
{ this.\_y -= 5;  
this.gotoAndStop(2)}  
on(keyPress “\<Left\>”)  
{ this.\_x -= 5;  
this.gotoAndStop(3)}  
on(keyPress “\<Right\>”)  
{ this.\_x += 5;  
this.gotoAndStop(4)}  
on(keyPress “\<Down\>”)  
{ this.\_y += 5;  
this.gotoAndStop(1)}

How would I make it so when My mc hits a wall it stops or bounces off?:ub:
