Animating objects inside JavaFX 2D Game

I’m going to build a simple online 2D game using JavaFX. but i have a question regarding animating graphic objects inside it . for example if a have a vector for “person” and want a move his hand only , Should i redraw many sprites for this movement ? and play an animation for replacing the image quickly ?

Almost I know that way . but what i want to know is there another way instead redrawing many images for one movement?

What i mean is there a way for moving the hand only freely for same image ? and If i’m using Inkscape and has exported the image as fx. does it help to do that ?

Your tips please , i’m new to this field

Generally, you shouldn’t post multiple copies of the same message.

But to answer your question: just redraw the whole thing each time. It’s easier for you, easier for the computer, and less prone to bugs.

Is it possible to just redraw the hand? Absolutely. But it’s also almost definitely overkill.

However, don’t take my word for it: why not try creating an MCVE of each approach, and seeing which you like the best?

Thx a lot brother , and i tried to remove the duplicated message but couldn’t do that .

I want to know what’s the most ideal method that games developers are using it in their 2D games , sure that save pc resources too, especially it’s an online game (browser)

Removed :slight_smile:

Just redraw the whole thing, unless you have a very specific problem related to redrawing.

Most games redraw the entire screen 60 times a second, so any time (either your own or the computer’s) you spend on trying to be smarter than that is probably wasted time.

Premature optimization is the root of all evil, and all that.