PDA

View Full Version : Hittest and a bit of positionig of a MC



knutlig
October 13th, 2003, 03:05 AM
Have a look at http://knut.es*****h.com/speedracer/content/game.html.

What happens here is that the car MC performs a hittest on the road MC. When the cars centre goes outside the shape of the road it sends the car MC back some points on its axis.

I want the car to stop going the direction its going when it exceeds the x and y co-ordinates of the Road MC..

This is the code...

_root.car._x += -1;
_root.car._y += 25;

I want it to say something like this..

_root.car._x = the x co-ordinate it has when the hittest detects that it is outside the roadMC;

_root.car._y = the y co-ordinate it has when the hittest detects that it is outside the roadMC;


Cheers

Knut Erik Sorli