# Precision Hit Test Needs to be More Precise

**URL:** <https://forum.kirupa.com/t/precision-hit-test-needs-to-be-more-precise/152516>\
**Category:** flash\
**Created:** [June 25, 2005, 1:41pm UTC](https://forum.kirupa.com/t/precision-hit-test-needs-to-be-more-precise/152516 "2005-06-25T13:41:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [June 25, 2005, 1:41pm UTC](https://forum.kirupa.com/t/precision-hit-test-needs-to-be-more-precise/152516/1 "2005-06-25T13:41:25Z")

</div>

Hey guys,  
I am quite a way through creating my own game from scratch and i have smacked straight-on, head first into a triple layer brick wall.

As it is I have my hitTest code(Below.) which detects a hitTest on the \_x and \_y positon of my car MC. The code is placed on the background, however, as the car mc is large it overlaps the wall when they are driving, until the \_x and/or \_y position are colliding.

So, basically, I need it so it goes off the hitTest of my actual picture rather than the \_x/\_y postions, any ideas?

My code(partial) at the moment;

```auto

**.....**
x = Math.sin(_root.car.dude._rotation*(Math.PI/180))*_root.speed;
y = Math.cos(_root.car.dude._rotation*(Math.PI/180))*_root.speed*-1;
**.....**
if **(!_root.land.map.hitTest(_root.car[color=black]._x+x, _root.car._y+y,[/color] true))** {
_x += x*-1;
_y += y*-1;
**.....**

```

**…** this just means there are bits of code i have, but have cut out

EDIT:: Sorry, exlude the [color=black] [color=black]and [/color] the [/color]as they were placed in by the editor and not me, so they’re not part of my code
