XNA - positioning after rotation

Posted by DijkeMark on Game Development See other posts from Game Development or by DijkeMark
Published on 2012-07-10T20:56:32Z Indexed on 2012/07/10 21:25 UTC
Read the original article Hit count: 214

Filed under:
|
|

I have a turret with a 2 gunbarrels. The turret rotates towards my mouse. So far no problem. When it creates a few bullets and positions them at the end of the gun barrels.

Here is the problem. It only works the moment the gun is point upwards. The moment it rotates the end of the gun barrels have moved ofcourse, thus the bullets don't spawn at the end of the gun battels, but at the place the where the gun barrels are when the turret is pointing upwards.

How can I check where the end of the gun barrels are the moment it rotates?

Thanks in Advance,

Mark Dijkema

PS. If you need code please let me know, I didn't post any yet, because I didn't what code you would need.

© Game Development or respective owner

Related posts about XNA

Related posts about rotation