The Anatomy of a Game: Sprites & Objects

Nevin Katz
JavaScript in Plain English
9 min readDec 11, 2022

--

Image by upklyak on Freepik

In the world around us, we open and close doors all the time, taking for granted that we can only walk through them when they’re open.

In a game meant to simulate the exploration of a labyrinth, a door is merely an assortment of pixels. Yet the player can only move through it when it’s open. How does the game know whether the door is open or closed?

--

--