P5 make object go straight in a direction

edited September 2016 in How To...

How do I make an object go straight in a direction, like Unity.vector2?

Tagged:

Answers

  • You could use a PVector instance.

    You could keep track of the x and y values yourself.

    You could store a direction and a speed, and then calculate the movement using the cos() and sin() functions.

    Please try something, consult the reference and some tutorials, and post if you get stuck. Good luck.

Sign In or Register to comment.