How to Make a Game in Python

Опубликовано: 07 Октябрь 2024
на канале: Techy Help
31,671
like

I want to know how to make a game in Python.

Python is Okay for 2D games, but C++ and C are going to be better for 3D games. You can make 3D games in Python if you use Panda 3D engine and pull in parts from C++.

I’m doing 2D. And I’m no where near doing anything that complicated.

Python is good for a game engine’s scripting, but for a lot of games like Minecraft and RPG, are not going to be good if you try to do it in Python.

Right now, I’m looking at 2D simple game development without the hassles of Java and Java runtime updates, or the security holes of JavaScript.

TuxRadar dot com has a page on how to build a mouse game in Python.

Mouse action is so 2010; I think a lot of the action is on tablets and smart phones.

I’d suggest hitting the Wiki for game programming on Python dot org.

Obviously it has been of enough interest that they created a page or more for it.

Actually, Pygame is a good option for Python game development, no matter what interface or the type of game.

What is Pygame? I was asking about making games in Python.

Pygame is a group of Python code modules specific for creating games in Python, such as device drivers, sound libraries, game logic and graphics.

I’m glad you’re not saying I have to learn a second language on top of Python.

Pygame is more like a subset of Python, the way C++ is a version of C, but you can make games with Python without using the Pygame set.

So how do I use Pygame to make games in Python?

The Python.org Wiki page on game programming with Python comes with several tutorials on how to make games with Python and Pygame plus links to free books on Python game building.

That’s at least a good starting point.

Once you get the basics on Python down, the site InventWithPython dot com teaches you how to build computer games in Python, though everything above the intro includes a buy my book feature.

It is common in gaming today to make you pay to level up.

You could also go to the Pygame dot org site. That site includes tutorials on learning how to program in Python and Pygame, though I have not actually reviewed them myself.

It is certainly better than researching options on Youtube and getting pages of demos of other people’s games in Python.

I’d recommend the Marek Belski Pygames channel on Youtube. Or try the lessons on ProgramArcadeGames dot com if you do not like Youtube, if not the game dev lessons on learn python the hard way.

If I wanted the hard way, I would not be considering watching videos on Youtube to learn game development.