I'm trying to develop a Tetris game using Python, but I'm looking for ways to do it without relying on the Pygame library. I'm a total beginner, having only been programming for a couple of months, so this is quite challenging for me. Any guidance or suggestions would be greatly appreciated!
7 Answers
If you're just starting out with Python, it might be better to first try something simpler, like tic-tac-toe. Once you're comfortable, you can experiment with Tetris, maybe even using ASCII art for graphics. If you're set on something visual, you'll need to choose a graphics library. Pygame is a solid option because it’s straightforward and gives you essential tools without overwhelming complexity. If you prefer, you can also consider PySDL2, which covers the basics for setting up graphics without too much overhead.
Have you thought about why you want to avoid Pygame? If your goal is to create a well-functioning game, using Pygame might actually make your life easier. Transitioning to a game engine like Godot could also be a good choice in the long run since they provide a wealth of built-in tools for game development. But learning Python with Pygame is a great way to understand the fundamentals behind game creation, too!
Ha! I originally misread your question as "Tetris without pyjamas" and was quite confused until I figured it out!
Consider using Tkinter for a simple GUI, or even print to the command line to create something rudimentary. It's a great way to start exploring basic game mechanics!
I wouldn’t recommend starting with Tetris unless you're already familiar with game development concepts, especially grid-based and puzzle types. It’s a complex project to tackle without previous experience. Definitely check in with your professor—there might be a reason you're not allowed to use Pygame, like focusing on simpler projects for learning.
If you want to create a game without Pygame, you'll need a way to open a window and render graphics. You might want to consider using a different game library or a windowing framework like Tkinter. Pygame is built on SDL, which you could use directly if you're up for the challenge. Alternatively, you can create a text-based version of Tetris that runs in the terminal. That could simplify things a bit! But I'm curious, why do you want to avoid using Pygame in the first place?
Thanks for the tips! I’m also interested in that text-based option. Can you explain how I might implement Tetris as text? I’ve been thrown into programming at university, and I'm not very good at it yet.
Unfortunately, Pygame is likely your best bet for this project if you're looking for simplicity in a graphical interface with Python. You could look into terminal-based applications, but that often introduces its own level of complexity. Learning to manage a GUI will be beneficial for you in the long run!

Any examples of what a text-based version of Tetris could look like?