The main game engines that use Python are Pygame (and its community fork pygame-ce), Arcade, Panda3D, Ursina, Ren’Py and Pyxel. Godot’s GDScript looks like Python but isn’t, and Unreal uses Python only for editor scripting:
pip install pygame-ce # 2D games
pip install arcade # modern 2D
pip install ursina # simple 3D
To show what Python game code looks like, I built a tiny coin-collecting game with Python 3.12.5 with pygame-ce 2.5.8 and saved a real rendered frame from it.
We’ll compare the engines, look at a Pygame game loop, check how fast pure Python game code runs, and answer whether Python is a good choice for game development.
Game engines that use Python, compared
| Engine | Type | Best for |
|---|---|---|
| Pygame / pygame-ce | 2D library | Learning, jams, classic 2D games |
| Arcade | 2D framework | Modern 2D with a friendlier API |
| Pyglet | Multimedia/OpenGL library | Windowing, audio and custom engines |
| Panda3D | 3D engine | Full 3D games and simulations |
| Ursina | 3D engine (built on Panda3D) | Quick, beginner-friendly 3D |
| Ren’Py | Visual novel engine | Story-driven visual novels |
| Pyxel | Retro engine | Pixel-art games with a fixed palette |
These all let you write your game logic in real Python. A few big names come up in searches but work differently:
- Godot uses GDScript, which borrows Python-style syntax but is its own language. Python support exists only through community add-ons.
- Unreal Engine includes Python for automating the editor and pipelines, not for gameplay code, which uses C++ or Blueprints.
- Unity uses C#; there’s no official Python for game code.
- Blender removed its built-in game engine in version 2.80; the community UPBGE fork continues it with Python scripting.
What Python game code looks like (Pygame)
Most Python game engines you’ll try share the same shape: a loop that handles input, updates positions, checks collisions and draws a frame. Here it is in pygame-ce:
import os
import random
import pygame
os.environ.setdefault("SDL_VIDEODRIVER", "dummy") # draw off-screen so the frame can be saved
pygame.init()
screen = pygame.display.set_mode((640, 360))
font = pygame.font.SysFont("arial", 24, bold=True)
random.seed(7)
player = pygame.Rect(300, 300, 40, 40)
coins = [pygame.Rect(random.randint(20, 600), random.randint(40, 260), 16, 16) for _ in range(8)]
score = 0
for frame in range(120): # two seconds at 60 frames per second
player.x += 3 if frame < 60 else -2 # stand-in for keyboard input
player.y -= 2
for coin in coins[:]:
if player.colliderect(coin): # collision detection built in
coins.remove(coin)
score += 10
screen.fill((20, 24, 48))
for coin in coins:
pygame.draw.circle(screen, (250, 204, 21), coin.center, 8)
pygame.draw.rect(screen, (56, 189, 248), player, border_radius=6)
screen.blit(font.render(f"Score: {score}", True, (255, 255, 255)), (16, 12))
pygame.image.save(screen, "pygame_frame.png") # a real rendered frame
print(f"frames: {frame + 1}, coins left: {len(coins)}, score: {score}")
pygame.quit()
Output:
frames: 120, coins left: 6, score: 20

I drew the frames off-screen so the result could be saved. Here’s the last frame the game rendered:

In a real game, keyboard events from pygame.event.get() replace the scripted movement. If you’ve built the console games here, like tic tac toe and Pong with turtle, this is the natural next step.
Is Python fast enough for games?
For your 2D games, usually yes. The heavy drawing work happens in C inside SDL; your Python code handles the logic. Here’s a stress test with 2,000 moving sprites:
import os, time
os.environ.setdefault("SDL_VIDEODRIVER", "dummy")
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 360))
clock = pygame.time.Clock()
sprites = [pygame.Rect(i * 6 % 640, i * 4 % 360, 8, 8) for i in range(2000)]
start = time.perf_counter()
for _ in range(300):
for s in sprites:
s.x = (s.x + 2) % 640
screen.fill((0, 0, 0))
for s in sprites:
pygame.draw.rect(screen, (255, 255, 255), s)
clock.tick() # no frame cap: measure raw speed
elapsed = time.perf_counter() - start
print(f"300 frames with 2,000 moving sprites: {elapsed:.2f} s ({300 / elapsed:.0f} frames per second)")
pygame.quit()
Output:
300 frames with 2,000 moving sprites: 0.31 s (976 frames per second)

You’ll find Python struggles with very large numbers of objects with complex per-object logic, and high-end 3D. Engines like Panda3D keep the 3D heavy lifting in C++ and expose it to Python.
Is Python good for game development?
| Python is great for | Python is a weak fit for |
|---|---|
| Learning game programming | AAA 3D games |
| Game jams and prototypes | Console releases |
| 2D, puzzle and retro games | Mobile app stores (harder to package) |
| Visual novels with Ren’Py | Games needing every last frame of performance |
| Tools, level editors and pipelines |
Plenty of developers prototype in Python and then move to Godot or Unity for a commercial release. Packaging for others is possible with tools like PyInstaller; see converting a Python file to an exe.
Python game projects to try next:
- Rock paper scissors in Python
- Guess the number game in Python
- Python turtle graphics
- How to create an app using Python
Frequently asked questions
What game engines use Python?
Pygame (and pygame-ce), Arcade, Pyglet, Panda3D, Ursina, Ren’Py and Pyxel all use Python for game code.
Does Godot use Python?
Not officially. Godot uses GDScript, which looks like Python, plus C#. Python works only through community extensions.
Can you make games in Unreal or Unity with Python?
Unreal’s Python is for editor automation, not gameplay. Unity uses C#.
Is Pygame good for beginners?
Yes. It’s simple, well documented and great for learning game loops, sprites and collisions.
Can Python make 3D games?
Yes, with Panda3D or Ursina, though large commercial 3D games usually use C++ or C# engines.
Where is pygame-ce documented?
See the pygame-ce documentation.

Bijay Kumar is a 13-time Microsoft MVP with more than 18 years in software development, and the founder of Python Guides and TSinfo Technologies. He started out building .NET and SharePoint solutions at HP, TCS and KPIT before moving into Python, machine learning and AI, and he also builds web apps with TypeScript and React. He writes the tutorials here himself, and every example is run before publishing so you see the real output. More about Bijay · Microsoft MVP profile · LinkedIn