Hi, fellows! I need your opinion on sprites!
Let's take the Super Mario game as an example:
The world and characters are generated from sprites.
I can make an image file for every sprite (1 coin, 1 brick etc...).
The usage is common:
load image "1.jpg",1
sprite 1,0,0,1
load image "2.jpg",2
sprite 2,0,0,3
load image "3.jpg",3
sprite 3,0,0,3
...
Or I can make one "atlas" image file for all sprites.
Then the following pseudo code will handle the sprites creation:
load image "1.jpg",1
for spr = 1 to 100
sprite spr, 0, 0, 1
size sprite spr, sizex, sizey
set sprite texture coord sprnum, 0, 0, 0
set sprite texture coord sprnum, 1, sizex, 0
set sprite texture coord sprnum, 2, 0, sizey
set sprite texture coord sprnum, 3, sizex, sizey
next spr
So, what way is better? Multiple files or one atlas with image handling? And why?
edit: added code examples