09-12-2022, 10:31 AM
(09-09-2022, 02:34 PM)TerryRitchie Wrote: My preferred method is to load the sprite images into an array.
Hi Terry,
So I tried loading graphics via sprite sheet in 2 different ways:
1) Just loading the sprite sheet and referencing the sprites I needed.
2) Loading the sprite sheet and adding the sprites into an array (your preferred method).
Option 2 is indeed nice if you want to have greater control over which frames get shown. Using this method, I was able to easily "rewind" an animation.
However, from a game design standpoint, it needs to be pointed out that option 2 comes at the cost of load time.
When I loaded just the sprite sheet (option 1), I could get all the graphics in the animation to show in about 1.15 seconds.
Option 2 increased the load time to 2.25 seconds.