Car with a big gun on top shooty thing

Well i think the title of the thread explains what the game is about

here is the problem:

The car is rotated by ._rotation actionscript and so is the turret. this conflicts with each othr when using atan2. i have fixed the turret rotating to the mouse but when i attach a movie it doent do the same thing. also if you shoot too rapidly the bullet kinda stops.

ive attached the file if you wanna have a lil look through ( you probably do because i havnt explained the script)

Thanks in advance

Stupid Saint


be nice to your neighbour; he knows were you live

Got an unexpected format error. Using Flash 8 Professional here.

I checked the swf, though, and interestingly, if you don’t move the vehicle, the bullets are shot at the correct angles. After you move it, everything goes bogus. So, I can only assume you mix both angles at some point of your code. You should stick to turret angle when it comes to define shooting angles.

I hope it already helps. It’s not much, but it’s the best I can do without checking the code. :slight_smile:

I assume then that the turret movieclip is contained within the car movieclip. One quick thing is that since the global rotation of the turret will be its own rotation plus the car’s rotation, you could subtract the car’s rotation when you re-assign the turret rotation.

Also, I don’t know if you’ve used localToGlobal and globalToLocal If you haven’t you might want to look them up for some idea on how to fix this. That doesn’t handle the rotation directly, but since you’re using atan2 then you can run those x and y values through it, and get the x and y in the context you want.