0

enter image description here

Hi,

I'm using a SKNode to represent a ship sprite. This sprite can be rotated and moved by touch events. This sprite should fire a bullet (another SKNode object) every second.

I plan to use SKAction to move the bullet.

The zRotation method of SKNode objects returns the rotation around the z-Axis. But how can I transform this into the right vector?

Thanks for your help Stefan

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Stefan
  • 5,203
  • 8
  • 27
  • 51
  • 1
    Isn't the centre point of the object and the angle of rotation to determine the vector at which the bullets need to be fired? – rakeshbs Jan 04 '15 at 15:46
  • 1
    ie like so: http://stackoverflow.com/questions/18851761/convert-an-angle-in-degrees-to-a-vector – CodeSmile Jan 04 '15 at 16:52
  • @LearnCocos2D Thanks for the link. That's the solution to my problem. – Stefan Jan 04 '15 at 23:20
  • @rakeshbs Yes. My issue was that I didn't know how to calculate this vector. Thanks for your help – Stefan Jan 04 '15 at 23:21

0 Answers0