Hi - (i'm a newbie)

I've come to a halt in working something out. After a long drawn out search for collision detection script i found one on this forum that is similar to what i want.

I have a boat which travels forward only (altered script for a moving car), you are able to rotate it left and right to chage direction you are travelling in. You aren't able to go backward.

There is land that you cannot travel (instance 'hit') over (as you're in the sea obviously ) and i have collision detection to make that possible. So it basically hits it and bounces util you change direction.

The problem i have - is that when you rotate to change your direction (with the reg point at the front of the boat) the rear of the boat goes ontop of the land.

I have tried changing my collision detection so that its bounding boxes rather than points that it checks, however - as soon as you rotate it no longer checks the collision of the bounding box.

I'm a bit stumped - i understand i would have to put a check where it's telling to rotate - but still havent come up with anything working


hope someone can point me in the right direction - thanks for any help in advance!


onClipEvent (load) {
speed = 0;
}
onClipEvent (enterFrame) {
// make the car go forward
speed += 0.1;
// tells the car to slow down after the speed of 20
if (Math.abs(speed)>20) {
speed *= .7;
}
// you can change the rotation of the car to your desire
if (Key.isDown(Key.LEFT)) {
_rotation -= 15;
}
if (Key.isDown(Key.RIGHT)) {
_rotation += 15;
}
// here is where the hittest is for the boundary
speed *= .98;
x = Math.sin(_rotation*(Math.PI/180))*speed;
y = Math.cos(_rotation*(Math.PI/180))*speed*-1;
if (!_root.hit.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.6;
}
}