# Racing Game Boundaries - Acting weird!?

**URL:** <https://forum.kirupa.com/t/racing-game-boundaries-acting-weird/197517>\
**Category:** programming\
**Created:** [August 17, 2006, 12:10am UTC](https://forum.kirupa.com/t/racing-game-boundaries-acting-weird/197517 "2006-08-17T00:10:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![craze3](https://avatars.discourse-cdn.com/v4/letter/c/bbce88/32.png) [@craze3](https://forum.kirupa.com/u/craze3)\
**Post date:** [August 17, 2006, 12:10am UTC](https://forum.kirupa.com/t/racing-game-boundaries-acting-weird/197517/1 "2006-08-17T00:10:44Z")

</div>

Okay check out what I’m working on.  
[http://media.putfile.com/Untitled-Uber-Racing-Game-TEST-1](http://media.putfile.com/Untitled-Uber-Racing-Game-TEST-1)  
The graphics are open source, so don’t nag if you’ve seen em before.  
Try the game I posted, you will notice that when racing at high speeds, you can get **stuck inside** the boundaries! :asleep:  
Here’s the boundary code I’m using. I don’t care that the car overlaps the boundary, I’m just worried about players getting stuck.

```php

      y = (Math.cos(Math.PI/180*_rotation))*_root.speedHolder;
x = (Math.sin(Math.PI/180*_rotation))*_root.speedHolder;
    if (_root.land.hitTest(_x+x, _y+y, true)) {
        _root.speedHolder *= -.1;
    }

```

\_root.speedHolder is the current speed of the car. This script is inside of the car movieclip. \_root.land is the track boundaries. What can I do to fix this problem?

Thanks,  
/craze3
