1
\$\begingroup\$

For a 2d side scrolling game made in Java, should I make a sprite sheet for my character walking left and for walking right, or should I just do the one, and flip it when it loads?

Also, the way I've been doing it, both left and right would be in the same image file, if that makes any difference.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Does it really a problem for your Java game? Will this make any difference at all? If yes, why don't you try both, measure and compare? \$\endgroup\$ Nov 6, 2015 at 19:09

1 Answer 1

2
\$\begingroup\$

Performance-wise, flipping it at load time will be fine.

(Or at instance-render-time, for that matter, if the platform lets you do that.)

But you might want separate sprite sheets for left and right anyway, so they can be slightly different, not exact reflections. For example, a little bit of lighting always from the left (for both left- and right-running) can add some visual consistency.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Yes, usually lighting requires sprites to be redrawn (unless you use some clever sprite-lighting maps) \$\endgroup\$
    – Kromster
    Nov 6, 2015 at 19:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .