We can split 2D game creation in 2 primary workflow.
Game world is pretty fast paced, so any delay in loading of asset or registration of key press can result in weird behaviour or bugs/glitches in game.
To make sure all the assets loads on time we do preloading of assets which mean all the assets necessary for the game are loaded into RAM before even the game begin.
This make sure there won't be any lag because of the asset.
This can basically be done in 2 steps.
Using pixi.pomle.com we can find the x, y, width and height of any subarea in the image.
Gameloop has 3 major functioning i.e. init, update, reset.
Init