---
title: "Python Games for Kids: Code Your First Game, Then Pygame"
description: "Python games for kids to code: a no-install guessing game, a full pygame arcade game, five games ordered by difficulty, and the Python version that pygame supports."
canonical: https://learn.modernagecoders.com/python-games-for-kids
source: src/pages/python-games-for-kids.html
---
> Python games for kids to code: a no-install guessing game, a full pygame arcade game, five games ordered by difficulty, and the Python version that pygame supports.

In short

Kids can code Python games in two steps: a text game such as guess the number, which needs only Python and the random module, then graphical games with pygame, installed with pip install pygame. On PyPI, pygame 2.6.1 has ready-built files for Python up to 3.13, so check versions first. Modern Age Coders teaches Python through games, live online, ages 9 to 16.

Learn it live

## Three courses that begin with games

Each course writes a game in the first weeks, then uses games to teach the ideas behind them.

[![Python and AI for Kids course thumbnail](/images/python-kids.webp)  PGK / 01 Python for kids Suits 9 to 12: text games, turtle art, then pygame. Open the syllabus →](/courses/python-ai-kids-masterclass)[![Python for Teens course thumbnail](/images/python-teens.webp)  PGK / 02 Python for teens Teens 13 to 18: pygame projects, data and AI. Open the syllabus →](/courses/python-complete-masterclass-teens)[![Game Development for Kids course thumbnail](/images/game-dev-kids.webp)  PGK / 03 Game development for kids Kids 8 to 12: game design across Scratch, Roblox and more. Open the syllabus →](/courses/game-development-masterclass-for-kids)

What to build

## Five Python games for kids, from easiest to hardest

This is the order we use, because each game adds exactly one new idea to the last one. The first two run in plain Python; the last three need pygame.

| Game | Needs | The new idea | Typical age |
| --- | --- | --- | --- |
| 1. Guess my number | Python only | Loops, input and if statements | 9 and up |
| 2. Rock, paper, scissors | Python only | Random choice and comparing values | 9 and up |
| 3. Dodge the falling block | pygame | The game loop, rectangles and collisions | 10 and up |
| 4. Catch the stars | pygame | Lists of moving objects and a timer | 11 and up |
| 5. Two-player Pong | pygame | Velocity, bouncing and two sets of controls | 12 and up |

### Why start without graphics

A text game strips a program down to its logic. There is no window, no images and nothing to install, so a nine-year-old can write a complete, working game in a single lesson and understand every line.

It also teaches the hardest early skill, reading an error message, at a time when the program is short enough that the error is easy to find.

### When to move to pygame

Once a child can write a while loop with an if inside it without help, they are ready. The pygame games on this page are the same structure with a window added.

Teenagers who already type confidently can start at game 3. In our plan, younger children spend a few weeks on games 1 and 2 first.

Game 1

## A first Python game kids can code in one sitting

This guessing game needs nothing except Python itself. It uses randint from Python’s random module, which the Python documentation describes as returning a random integer N such that a <= N <= b, so 1 and 100 are both possible.

***Program 1 · guess my number**python*

```
# Guess my number (ours): plain Python, no installs
import random

secret = random.randint(1, 100)
tries = 0

while True:
    guess = int(input("Guess from 1 to 100: "))
    tries += 1
    if guess < secret:
        print("Higher!")
    elif guess > secret:
        print("Lower!")
    else:
        print("Got it in", tries, "tries")
        break
```

Run it in IDLE, which the Python docs call Python’s Integrated Development and Learning Environment, or in any Python editor. Typing a word instead of a number stops it with a ValueError, which makes a perfect first bug to fix together.

### The maths hiding in the game (our worked example)

The clever way to play is to guess the middle every time: 50, then 25 or 75, and so on. Each guess halves the numbers left. Since 2 to the 7th power is 128, which is more than 100, halving finds any number from 1 to 100 in at most 7 guesses. Six guesses are not always enough, because 2 to the 6th is only 64.

Children who work this out have discovered binary search, one of the most important ideas in computer science, by playing their own game.

### Three changes to try

Limit the player to 7 tries, and print the secret number if they run out. That needs a counter and one more if.

Ask whether they want to play again at the end. That needs a loop around the whole game.

Let the player choose the range, 1 to 1,000 for example, and work out the new maximum number of guesses: 2 to the 10th is 1,024, so 10.

Before you install

## Installing pygame, and the Python version to check first

pygame describes itself on its PyPI page as a free and open-source cross-platform library for making multimedia applications like video games in Python. Installing it is one command, as long as the Python on the computer is one that pygame has ready-built files for.

| What | Official figure | Source |
| --- | --- | --- |
| Latest pygame | 2.6.1, files uploaded 29 September 2024 | PyPI |
| Python versions pygame 2.6.1 has ready-built files for | CPython 3.6 to 3.13, plus some PyPy builds | PyPI file list |
| Python that pygame says it requires | 3.6 or newer | PyPI |
| Newest Python on python.org | 3.15.0, released October 9, 2026 | python.org |
| Latest Python 3.13 release | 3.13.16, released September 30, 2026 | python.org |
| pygame licence | LGPL | PyPI |

1. **Check Python.** In a command prompt on Windows or a terminal on a Mac, type python --version. pygame’s own instructions give Python 3.8.10 as an example of a message that means Python is installed.
2. **Check pip.** Type pip --version. pip usually comes with Python, but pygame’s page notes that you can never be sure.
3. **Install pygame.** Type pip install pygame, or pip3 install pygame on some computers.
4. **Test it.** Type python3 -m pygame.examples.aliens. A small game should open; that game ships with pygame.
5. **Keep the docs close.** python -m pygame.docs opens the documentation, and pygame says it launches the website if the docs are not found locally.

### The version trap

On PyPI, the newest ready-built pygame files stop at Python 3.13, while python.org’s big download button now offers Python 3.15.0. PyPI also lists a source package, pygame-2.6.1.tar.gz, but without a ready-built file for your Python, installing means building pygame from that source, a much harder job for a first-time install.

That is a gap between two official pages on one day, not a fault in either project, and it may close when pygame publishes a new release. Check the pygame files on PyPI before you choose a Python.

### What we do with new students

Our choice, for now: we set up game students on the latest Python 3.13 release, which python.org updated on September 30, 2026, because pygame has ready-built files for it.

When pygame lists files for a newer Python, we move up. The habit we want children to learn is the one behind this table: read the official version list before installing anything.

Sources, read 17 October 2026: [pygame on PyPI](https://pypi.org/project/pygame/) and [python.org downloads](https://www.python.org/downloads/). We are not connected with the pygame project or the Python Software Foundation.

How games work

## The game loop: four steps every pygame game repeats

Every game on a screen, from Pong to the largest console game, repeats the same short cycle many times a second. pygame’s newbie guide calls this update, render, wait loop a design pattern that serves as the skeleton of most games.

| Step | pygame code | What the documentation says |
| --- | --- | --- |
| 1. Input | pygame.event.get() | Your program must handle events every frame; not handling them may cause your system to decide the program has locked up |
| 2. Update | Move objects, check colliderect | colliderect returns true if any portion of either rectangle overlaps, except the edges |
| 3. Draw | screen.fill, draw, then pygame.display.flip() | flip updates the contents of the entire display |
| 4. Wait | clock.tick(60) | Clock.tick(40) once per frame means the program never runs at more than 40 frames per second |

### Why the input step is not optional

A classic beginner slip is leaving out the event loop when a game has no controls yet. pygame’s documentation warns what happens: events pile up, and the operating system may decide the program has frozen.

Handling pygame.QUIT is also what makes the close button on the window work. Without it, the only way out is to force the program to stop.

### Frames and speed

clock.tick(60) caps the game at 60 frames a second. Movement in the simple games here is counted in pixels per frame, so the frame cap is also what keeps the speed steady from one computer to the next.

Later, students learn the method pygame’s own quick start shows: measure dt, the time in seconds since the last frame, and multiply speeds by it, so movement stays smooth even when frames are uneven.

Game 3

## A complete pygame arcade game in under 50 lines

This is the first pygame game our students build. Move left and right, let the white block fall past you, and score a point for every block you avoid. Every line uses a part of pygame that its documentation describes.

***Program 2 · dodge the falling block**python*

```
# Dodge the falling block (ours): needs pygame
import random
import pygame

pygame.init()
screen = pygame.display.set_mode((480, 640))
clock = pygame.time.Clock()
font = pygame.font.Font(None, 36)

player = pygame.Rect(215, 580, 50, 30)
block = pygame.Rect(random.randint(0, 430), -40, 50, 40)
score = 0
running = True

while running:
    # 1. input: handle every event, every frame
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    keys = pygame.key.get_pressed()
    if keys[pygame.K_LEFT] and player.left > 0:
        player.x -= 6
    if keys[pygame.K_RIGHT] and player.right < 480:
        player.x += 6

    # 2. update: move the block, check for a hit
    block.y += 5
    if block.top > 640:
        block.x = random.randint(0, 430)
        block.y = -40
        score += 1
    if player.colliderect(block):
        running = False

    # 3. draw, then 4. wait for the next frame
    screen.fill("black")
    pygame.draw.rect(screen, "orange", player)
    pygame.draw.rect(screen, "white", block)
    label = font.render(f"Score {score}", True, "white")
    screen.blit(label, (10, 10))
    pygame.display.flip()
    clock.tick(60)

pygame.quit()
print("Final score:", score)
```

Save it as dodge.py and run it after installing pygame. Rect stores a position and a size; its left, right, top, x and y attributes can be read and changed, and colliderect does the collision maths for you.

### Is the game fair? (our arithmetic)

At 60 frames a second, a block moving 5 pixels a frame falls 300 pixels a second. It starts 40 pixels above the window and is replaced when it passes 640, so it travels 680 pixels, taking about 680 / 300 = 2.27 seconds.

The player moves 6 pixels a frame, 360 pixels a second, and the widest trip across the window is 480 - 50 = 430 pixels, about 1.19 seconds. Because 1.19 is less than 2.27, the player can always escape. Make the block faster than that and the game becomes unfair.

### Five upgrades, in order

Speed the block up a little each time the score rises. Then add a second block. Then give the player three lives instead of one.

After that, replace the rectangles with images loaded from files, and add a sound when a block is dodged. Each upgrade practises one new part of pygame.

By age

## What Python game coding looks like at each age

Our guide for US families, by grade. Children vary a lot, and we place each one by what they can already do, not by birthday.

### Grades 3 to 5, ages 9 to 11

Text games, turtle drawings and simple quizzes. Typing speed is the main limit, so programs stay short and lessons stay playful.

### Grades 6 to 8, ages 11 to 14

pygame games 3 and 4, with lists, functions and a scoreboard. A good moment to start a folder of finished games.

### Grades 9 to 12, ages 14 to 18

Pong, then larger projects with classes, sprites and levels. A good stepping stone toward AP Computer Science or a portfolio project.

Not sure where your child fits? Our pages on [Python for 10 year olds](/python-for-10-year-olds), [Python for 12 year olds](/python-for-12-year-olds) and [Python for 14 year olds](/python-for-14-year-olds) go into each age in more depth, and [our text adventure tutorial](/blog/how-to-make-a-text-adventure-game-in-python) is another good first game.

From player to programmer

## Four stages of a young Python game maker

A rough map of where children are, and the next step from each.

| Stage | What it looks like |
| --- | --- |
| 1. Copier | Types in a game from a page and gets it running |
| 2. Changer | Changes numbers and messages to see what happens |
| 3. Builder | Writes a new game from an empty file using the loop pattern |
| 4. Designer | Balances a game on purpose: speeds, scores, fairness |

### For parents

Copying is a legitimate start. Professional programmers learned the same way, by typing out code and then breaking it.

The jump to stage 3 is the big one. An empty file is intimidating, and a teacher’s first question can unlock it.

### For kids

Change one number and run it again. You learn more from ten small experiments than one big plan.

Read the last line of an error first. Python puts the reason there.

The catalogue

## Nine courses for kids who like making games

Every one runs live with the same teacher each week, in a batch or one to one.

I

### Kids

Ages 6 to 12

PGK / KID / 01

#### Python for kids

Games first, then AI projects.

[Open the syllabus](/courses/python-ai-kids-masterclass)

PGK / KID / 02

#### Scratch coding

Game ideas before typed code.

[Open the syllabus](/courses/scratch-programming-complete-course)

PGK / KID / 03

#### Coding for kids

Blocks to games and apps.

[Open the syllabus](/courses/kids-coding-blocks-masterclass)II

### Teens

Ages 13 to 18

PGK / TEN / 01

#### Python for teens

pygame, data and real projects.

[Open the syllabus](/courses/python-complete-masterclass-teens)

PGK / TEN / 02

#### Game development for teens

From pygame thinking to Unity.

[Open the syllabus](/courses/complete-game-development-masterclass-for-teens)

PGK / TEN / 03

#### Java for teens

A 2D game and Minecraft mods.

[Open the syllabus](/courses/java-programming-masterclass-for-teens)III

### Going further

Teens and adults

PGK / PRO / 01

#### Game development

Professional engines and tools.

[Open the syllabus](/courses/game-development-complete-masterclass-college)

PGK / PRO / 02

#### JavaScript for teens

Playable web pages and games.

[Open the syllabus](/courses/javascript-course-for-teens-beginners-interactive-web)

PGK / PRO / 03

#### Hackathon preparation

Build a game with a team, fast.

[Open the syllabus](/courses/hackathon-prep-for-teens-coding-ai-build-innovate-win-course)

How lessons run

## Live Python lessons, planned around your week

Weekdays or weekends, flexible: choose your batch, or for a very personalised plan choose 1-on-1 at your convenience, weekend mornings or weekdays.

Weekdays

After-school batches across US time zones.

Weekends

Morning batches for families with busy weekdays.

1-on-1

A personal plan, at times you pick.

### A game every few weeks

Each idea arrives inside a game.

### Typing on their own computer

Code written by the child, not watched.

### Set up together

Python and pygame installed in class.

### A regular teacher

The same person, week after week.

### Online, nationwide

From Maine to Hawaii.

### Batch or private

Fifteen to twenty students, or one to one.

Student work

## Projects built by our students

Finished work from some of our students. The [student labs](/student-labs) page shows more.

![NutriLife AI nutrition coach project screenshot](/images/projects/nutrilife.webp)

AI and ML

#### NutriLife

An AI nutrition coach that reads what you eat and works you toward a target.

by Bhavya · [Open it](https://nutrilife-bhavya.lovable.app)

![Misti AI chatbot for maths and coding screenshot](/images/projects/misti.webp)

AI and ML

#### Misti

A chatbot that answers mathematics and programming questions, built and deployed by a student.

by Harshit · [Open it](https://misti.modernagecoders.com)

![GuardianX AI internet safety assistant screenshot](/images/projects/guardianx.webp)

AI and ML

#### GuardianX

An assistant that helps a young person recognise unsafe situations online.

by Vivaan · [Open it](https://guardianx-cybersaver.lovable.app)

![SkyCast weather forecast application screenshot](/images/projects/skycast.webp)

Web app

#### SkyCast

A weather forecasting site with live conditions for any location.

by Krish

Fees

## Fees

Python and pygame are both free to download, and so is the first lesson. Regular classes are paid by the month in US dollars, with no long contract, and can stop when any month ends.

Free first class

USD 0

no card required

- A free first lesson
- Help installing Python and pygame
- No card

Book it

Group batch

USD 100

a month, billed in US dollars

- Batch of fifteen to twenty
- One teacher all term
- Choose a batch time
- Monthly payment

Start here

One to one

USD 150

a month, billed in US dollars

- Private lessons
- Your choice of times
- Your own game ideas

Enquire

What families say

## Rated 4.9 across 547 Google reviews

From Google, as the parents wrote it.

★★★★★

"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."

Ria Mukherjee

Parent

★★★★★

"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."

Samriddha Mondal

Student

★★★★★

"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."

Vansh Agarwal

Student

★★★★★

"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."

Sonam Oswal

Parent of Dhairya

★★★★★

"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."

Sonu Goyal

Parent

★★★★★

"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."

Ritu Kedia

Parent

Questions from families

## Python games for kids: common questions

### What Python games can kids code?

Start with text games such as guess the number and rock, paper, scissors, which need only Python. Then move to pygame for games with a window: dodging blocks, catching stars and two-player Pong.

### Is Python good for making games?

For learning, yes. Python reads clearly, and the pygame library handles windows, drawing, keyboard input and collisions, so children spend their time on game logic rather than setup.

### Is pygame free?

Yes. pygame's PyPI page describes it as a free and open-source cross-platform library, and lists its licence as LGPL.

### How do you install pygame?

Check that Python and pip work with python --version and pip --version, then run pip install pygame. Test it with python3 -m pygame.examples.aliens, a small game that comes with pygame.

### Which Python version works with pygame?

On PyPI, pygame 2.6.1 has ready-built files for Python up to 3.13, while python.org now offers 3.15.0. We set students up on the latest 3.13 release until pygame publishes files for newer versions.

### What age can kids start making Python games?

We start text games from about 9 or 10, once a child types comfortably, and pygame games from about 10. Teenagers can start with pygame directly.

### Can kids make Python games without installing anything?

A text game needs only Python itself, which includes the random module. Graphical games need pygame, which is installed with pip.

### What does clock.tick(60) do in pygame?

It limits the game to at most 60 frames per second. pygame's documentation says that calling Clock.tick(40) once per frame means the program never runs faster than 40 frames per second.

### Which class times work for US kids?

Weekdays or weekends, flexible: choose your batch, or for a very personalised plan choose 1-on-1 at your convenience, weekend mornings or weekdays.

### How much are Python game coding classes?

The first lesson is free. Regular classes are billed per month, and the fees panel on this page gives the monthly amount in US dollars.

Elsewhere on this site

## Related pages

More for US families with a young programmer.

### [Python for 10 year olds](/python-for-10-year-olds)

What a 10 year old can build.

### [Python for 14 year olds](/python-for-14-year-olds)

Bigger projects for high schoolers.

### [Text adventure in Python](/blog/how-to-make-a-text-adventure-game-in-python)

Another first game, step by step.

### [Scratch or Python first](/blog/scratch-vs-python-which-better-young-learners)

Choosing a starting language.

### [Coding classes in the USA](/coding-classes-in-united-states)

Our hub for families across the country.

### [How we teach](/how-we-teach)

What happens in a live lesson.

### [MakeCode Arcade help](/makecode-arcade-help-for-students)

MakeCode Arcade help: jumping, gravity, tilemap levels and lost projects.

### [How to make a Roblox game](/how-to-make-a-roblox-game)

Make a Roblox game step by step: devices, three Luau scripts, and safe publishing.

### [Lua for kids](/lua-for-kids)

Lua for kids: what it is, how Luau differs, and three programs to run today.

Start here

## Book a free first lesson

Tell us whether your child has written any Python before, and what kind of game they would love to make. The first lesson starts there.

Before booking you can read [about our teaching](/how-we-teach) or look through [every syllabus](/courses).

[WhatsApp us](https://wa.me/919123366161?text=Hello%20Modern%20Age%20Coders%2C%20my%20child%20in%20the%20US%20wants%20to%20make%20games%20in%20Python.%20Could%20we%20book%20a%20free%20first%20lesson%3F) · [+91 91233 66161](tel:+919123366161) · [connect@modernagecoders.com](mailto:connect@modernagecoders.com)

Classes are taught live online by teachers working from India, so the lesson comes to your home in any state. For a fast reply, send us a WhatsApp message.

### Want a class sooner? Book a priority demo

A priority demo is a full class of about 45 to 60 minutes. After the class the mentor sends a written skill report and a personal learning roadmap on WhatsApp. If you enrol, the demo fee is adjusted against your first month's fee. Share your demo Order ID with us on WhatsApp and we take it off.

[Book a priority demo](/book-demo)

## Keep exploring Modern Age Coders

### Coding classes in nearby places

- [Python Projects for Kids: 20+ Finishable Python Projects (Ages 8 to 15)](/python-projects-for-kids)
- [Python for Kids & Teens](/python-and-ai-classes-for-kids-teens)
- [Vibe Coding and AI Agents Classes in Airdrie](/vibe-coding-and-ai-agents-classes-in-airdrie)
- [Machine Learning Course for Beginners](/machine-learning-course-for-beginners)
- [Vibe Coding and AI Agents Classes in Albany, WA](/vibe-coding-and-ai-agents-classes-in-albany-wa)
- [Machine Learning Competitions for High School Students](/machine-learning-competitions-for-high-school-students)
- [Vibe Coding and AI Agents Classes in Wokingham](/vibe-coding-and-ai-agents-classes-in-wokingham)
- [Coding Classes in County Galway](/coding-classes-in-county-galway)
- [Coding Classes in As Suwaiq](/coding-classes-in-as-suwaiq)
- [Scope, LEGB Rule, and Closures Practice](/resources/python/scope-and-closures/practice)

### Learn more

- [Coding Classes for 13 Year Olds: Python Course, Web, Apps and AI](/coding-for-13-year-olds)
- [Coding for Class 3: Scratch, Block Coding & First Python for 8 Year Olds](/coding-for-class-3)
- [Coding for Class 4: Scratch, Block Coding & First Python for 9 Year Olds](/coding-for-class-4)
- [Coding Classes for 9 Year Olds: Scratch Games and First Python](/coding-for-9-year-olds)

### Free resources

- [Python Tutorial for Beginners: Complete Guide](/resources/python)
- [Inheritance and Polymorphism](/resources/python/inheritance-and-polymorphism)
- [Comprehensions and Generators](/resources/python/list-comprehensions-and-generators)
- [Modules and Packages in Python](/resources/python/modules-and-packages)

### From the blog

- [Python Tutorials & Guides](/blog/topic/python)
- [Conway's Game of Life in Python: Rules, Patterns and Code](/blog/conways-game-of-life-python)
- [How to Find HCF and LCM in Python (5 Easy Methods)](/blog/how-to-find-hcf-and-lcm-in-python)
- [How to Reverse a String in Python: 5 Easy Methods](/blog/how-to-reverse-a-string-in-python)

### Start here

- [About Modern Age Coders, teaching since 2020](/about)
- [Modern Age Coders pricing, one honest price per plan](/pricing)

Free class[Priority demo](/book-demo)[Call us](tel:+919123366161)

---

*Canonical: https://learn.modernagecoders.com/python-games-for-kids*
