Read this lesson as text
Video Game Coordinate System
Pre-Algebra · Axiom Academy
LESSON Video Game Coordinate System Every sprite lives at an (x, y) address on a grid — and moving it is nothing more than adding to those two numbers. 1. A Sprite Has an Address: (x, y) Drop a sprite anywhere on the grid and it has exactly two numbers attached to it. The first, x , counts how far across it sits. The second, y , counts how far up it sits. Read them in that order and you have the sprite's position. 2. Changing x Moves the Sprite Sideways Press right and the game adds to x ; press left and it subtracts. The y value never changes — only the across-number does, so the sprite slides along a horizontal line. x goes up by 1: . The sprite slides right one square. x goes down by 1: . The sprite slides left one square. Starting at (1, 2) and pressing right three times: . Only the first number climbs — the sprite stays on the same row. 3. Changing y Moves the Sprite Up and Down The second number works the same way, just vertically. Press up and the game adds to y ; press down and it subtracts. This time x holds still and the sprite climbs or drops straight along a vertical line. y goes up by 1: . The sprite rises one square. y goes down by 1: . The sprite drops one square. 4. A Move Is Just Addition: Work One Out Now put it together. A sprite starts at (4, 2) . It moves left twice , then up once . Where does it land? Each move only nudges one of the two numbers, so we can track x and y separately.
This is the written version of the interactive lesson above. See the full Pre-Algebra course.