Chapter 1: What Makes a Game?
What Makes a Game? 🎮
Section titled “What Makes a Game? 🎮”Before you build your first game, you need to understand what a game actually is. Not just “something fun on a screen” — we’re going to break it down like a developer.
The Four Pillars of Every Game
Section titled “The Four Pillars of Every Game”Every video game, from Pong to Fortnite, is built on four core elements:
1. The Game Loop
Section titled “1. The Game Loop”The game loop game loop: A continuous cycle that runs every frame: check input → update game state → render graphics. This is the heartbeat of every game. is the heartbeat of your game. It runs constantly, typically 60 times per second, doing three things:
while game_is_running: handle_input() # What did the player do? update_state() # What changed in the game world? render_frame() # Draw the new frame on screen2. Player Input
Section titled “2. Player Input”Input is how the player communicates with your game. This could be:
| Input Type | Example |
|---|---|
| Keyboard | WASD to move, Space to jump |
| Mouse | Click to shoot, drag to build |
| Touch | Tap to jump, swipe to dodge |
| Controller | Joystick to steer, buttons to attack |
3. Game State
Section titled “3. Game State”The game state game state: All the data that describes what's happening in the game right now: player position, score, health, enemy locations, etc. is everything the computer needs to know about your game at any moment:
- Where is the player?
- What’s the score?
- How much health is left?
- Where are the enemies?
4. Rendering
Section titled “4. Rendering”Rendering Rendering: The process of drawing all game objects onto the screen as pixels. Happens every frame — typically 60 times per second. is the process of turning your game state into pixels pixels: The tiny dots of color that make up everything you see on a screen. A 1080p screen has over 2 million pixels. on screen. Every frame, the game redraws everything based on the current state.
Think Like a Developer 🧑💻
Section titled “Think Like a Developer 🧑💻”Look at your favorite game and try to identify:
- What inputs does it use? (keyboard, mouse, controller?)
- What data is in the game state? (score, position, inventory?)
- How fast does the game loop run? (Check the FPS counter if it has one!)
Key Concepts Checklist
Section titled “Key Concepts Checklist”- I understand what a game loop is
- I can name the four pillars of a game
- I know the difference between game state and rendering
- I can identify input types in games I play