How do sprites work?

How do sprites work?

I saw sprites from old school games like Super Mario Brothers, and wondered how they were animated to make the game.

They are always presented as one big map of images, so how are they used?

For Mario (as an example) are there pre-calculated image coordinates that describe mario and swap places between different marion sprites to create an animation?

Or are the sprites previously “cut out” during the initialization of the game using the previously calculated image coordinates and stored somewhere in the memory?

Obviously, I don't know anything about game development.

+3
source share
6 answers

, . Atari 7800 , , . - , , . , .

(, Odyssey2), , . Atari 2600 8 , , . , . , , , , .

, , . , ; , . NES .

+3

http://en.wikipedia.org/wiki/Sprite_(computer_graphics)

, , , , ...

, , , , - , , , (, , , , ).

+3

, . , .

, ,

. , . .

+1

, . , , .

+1

atlas , .

, , , , Zwoptex. . init .

+1

2D-, NES DS, . . - 8x8 . , , , , .

. - 32x64 4x8 . , 32 . . , .

Now, for the game to draw a sprite, it simply looks at the tiles in each index for the sprite and draws them in the correct position on the screen. Typically, the console hardware handles this, and that is how you can get surprisingly good graphics on very limited hardware (the original NES had a 1.67 MHz processor and only 4 KB of RAM).

+1
source

Source: https://habr.com/ru/post/1749433/


All Articles