This rotates the cannon okay, but, I would like to have some kind of delay to that turning (I mean, nowit's instant.How is such a thing even possible? Somehow with delta time? I suck at math and physics sooo.

Well, if someone could help, I would really appreciate that!

Thanks in advance

edit. I try to explain better...

The cannon is now facing direction x,yWhen I move the mouse, the facing direction changes of course to nx,ny. I want it to be so that cannon slowly rotates to the new facing direction...

Note I am not talking about experience here - have yet to succesfully build a game that lets you change angles =(

However, I do know a little bit about interpolation and extrapolation, which you probably need to former here if my knowledge is correct, or a form of it at least.

Save those variables as currentX, currentY and have it move some percent or absolute amount max at a time toward the current x/y and you have done it. Note that if this is an FPS of some sort or requires 'twitch' responses, this should be configurable, because it will give the user a different response then what he does, which will annoy them if it's twitch.

No problem, i remember i have had this problem once to.The only problem you could have is; the cannon will be switching between 2 values all the time, with a greater movement rate you can spot this better.Its easy to fix this problem anyway, didnt want to type to many code

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org