# Code overloading computer

**URL:** <https://forum.kirupa.com/t/code-overloading-computer/202335>\
**Category:** Uncategorized\
**Created:** [September 29, 2006, 7:36pm UTC](https://forum.kirupa.com/t/code-overloading-computer/202335 "2006-09-29T19:36:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhryn](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@Dhryn](https://forum.kirupa.com/u/Dhryn)\
**Post date:** [September 29, 2006, 7:36pm UTC](https://forum.kirupa.com/t/code-overloading-computer/202335/1 "2006-09-29T19:36:55Z")

</div>

I am using the following code to find out if the wall hits the corners of my character. this code is placed on the character  
[AS]  
topleft = \_root.wall.hitTest(getBounds(\_root).xMin,getBounds(\_root).yMin,true);  
[/AS]

Then changing it appropriately for the other three corners. I then placed dynamic text fields on the screen which link to the variables for testing purposes. This worked fine.

I then tried to use this code on my character to stop him walking through walls. Code also placed on character

[AS]  
if(topleft && bottomleft){  
this.\_x += 5;  
}  
[/AS]

but with this code, when the character hits the wall it overloads the computer and stops responding.

If any one can tell me why it is doing this and how I can get around this problem without massive code changes to my whole game.
