Java Game Tutorial: Sprite/Object rotation

preview_player
Показать описание
Here's a good vectors tutorial

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:
Рекомендации по теме
Комментарии
Автор

is it possible for you to post the code

chaitanyapatel
Автор

Slightly offtopic, but I noticed in this tutorial as well as one earlier you control click a method to view its source. Do you know if intelliJ has similar functionality? If so how do I access it? Ctrl + click seems to be a different feature. Thanks!

hendrixj.
Автор

Dear Almas: I have a 27 inch Mac . . . I can't read your code. It's too small. I know what a vector is and how to use them with pencil and paper. What I don't know is how to translate vector math into JavaFX code. Please post the code so we can learn from it. Thank you for sharing.

basalduat
join shbcf.ru