createSpriteAtlas slices a texture into frames: a uniform grid (left) or named JSON rectangles (middle), both reduced to the same frame table. useSpriteAnimation cycles them, writing onto the sprite the part of the picture each moment needs.
The one on the right plays an attack clip once on Space, which does not loop: when playing turns false it goes back to walking. Any of them can go into createSpriteTexture to animate on a 3D screen.