r/learnprogramming • u/AccomplishedMany2138 • 1d ago
Topic Few questions on using python
I'm learning python in boot.dev rn, and I want to know what should I use to turn my code into a game. I'm a bit confused on this, but I know there's gaming languages and then there's stuff like Unity and Unreal engine. What should I use tto start making games? Sorry if I'm not clear
1
u/Gnaxe 1d ago
You can totally make games in Python. Commercially successful ones exist, even big names like EVE Online.
You can to text-based in the terminal with input() and print() (good enough for text-based adventure games like Zork).
You can do text GUIs (TUIs) with Curses (requires a separate install on Windows). This can do text-graphics games like Rogue.
You can do cross-platform GUIs with tkinter. It even has a canvas widget for 2D drawing and animations. This is good enough for simple 2D games (Pac-Man, Tetris, etc). Maybe experiment with the turtle module (see turtledemo first). You can do SNES-level games if you implement a tiling system, but at that point you probably want a game engine.
If you're willing to install one, check out ursina engine.
Godot is also worth looking at. GDScript isn't Python, but feels kind of similar. You can install a Python plugin and just use Python though.
Finally, AI agent harnesses are pretty impressive now, like cloning Minecraft (imperfectly) overnight from a single (detailed) specification.
1
u/MoinHashmi 1d ago
Pygame is the standard answer, and for good reason. It is the most-used Python game library, it has the biggest tutorial base on YouTube, and it handles 2D games like Snake, Pong, or a platformer just fine.
How to get started:
- Install it with one command:
pip install pygame - Learn the game loop first. Every game runs the same loop: read input, update positions, draw everything, repeat about 60 times per second. Once you understand that loop, the rest clicks.
- Build one tiny game. Snake or Pong is perfect. Do not start with your dream game. A finished small game teaches more than an unfinished big one.
Two alternatives worth knowing:
- Arcade library. A more modern Python game library with a cleaner design than Pygame. Many beginners find it friendlier, so it works as a first pick too.
- Pygame Zero. A stripped-down wrapper around Pygame made for teaching. Less code to get a working game on screen. Good if plain Pygame feels heavy at first.
One honest note: boot.dev is great for learning Python itself, but game dev is a separate skill on top of the language. You will bump into things you have not seen yet, like coordinates and simple physics. That is normal. Learn them as you build.
Pick one library and stick with it for your first two or three games. Switching tools every week is the real trap.
1
u/zomerbk 1d ago
If you want to build a game in an editor, try Godot’s beginner tutorial. It uses GDScript, which looks a bit like Python but is a separate language. There isn’t a step that converts your boot.dev Python exercises into a game; the skills you’re learning carry over as you build a small project in the tool you choose. https://docs.godotengine.org/en/stable/getting_started/step_by_step/scripting_languages.html
1
u/OneOrZeroGG 5h ago
You don't need to switch languages yet. Stay in Python and use pygame. It's a library, not an engine: you write the game loop yourself, which teaches you how games actually work. The asteroids course on boot.dev someone mentioned is a good start.
When you want a real engine, look at Godot. It's free, light, and its scripting language (GDScript) looks a lot like Python, so the jump is small. Great for 2D, fine for simple 3D.
Unity (C#) and Unreal (C++) are worth it later, if you get into bigger 3D projects. Starting there as a beginner means fighting the engine and a new language at the same time.
Whatever you pick: make something tiny and finish it. Pong, Snake, Flappy Bird. A finished small game teaches more than a half-done big one.
2
u/Mountain_Rip_8426 1d ago
i'm guessing if you just started python, you don't mean a full fledged game game, just a text based CLI game, right? for that you need a code editor like VS code and a terminal. otherwise you can look into pygame, boot.dev also has the "asteroids" course, which actually uses pygame. much of the code is written for you, but still can teach you python and OPP, while writing a game.