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;
**.....**
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