Java Game Tutorial: Sprite/Object rotation

Subscribers:
9,540
Published on ● Video Link: https://www.youtube.com/watch?v=ypFIoPaTwJQ



Category:
Tutorial
Duration: 12:34
2,465 views
15


Here's a good vectors tutorial
http://www.mathsisfun.com/algebra/vectors.html

Note: javafx coordinate space starts at top-left, so we have to take that into account when working with Y values

Note: angle that we calculate is NOT the positive angle between bullet vector and X axis, it's negative because javafx rotate transform is applied clockwise and we want counterclockwise

Note: it is also possible to calculate the angle with atan2 as follows:
double angle = Math.toDegrees(Math.atan2(vector.y, vector.x));







Tags:
java
java programming tutorial
java game tutorial
game tutorial for beginners
java for beginners
very simple game tutorial
Java (Programming Language)
javafx tutorial
javafx transform
JavaFX (Software)
javafx game tutorial
game tutorial
sprite rotation
object rotation
javafx rotate
vectors