r/learnpython • u/No_Molasses_7224 • Sep 05 '24
Is python recommended for coding games?
Because I think it’s only good for coding like websites or some shit if it is recommended for coding games, sign me up where do I start because I’m starting out coding and programming
5
u/FunnyForWrongReason Sep 05 '24
For simple or smaller light weight games Python would be fine. Although looking at game engines like unity could still be a good idea.
Python can be used for anything at the end of the data but there are things it is better and worse at.
1
u/No_Molasses_7224 Sep 05 '24
Is game maker an option?
1
u/Jello_Penguin_2956 Sep 05 '24
Game Maker is generally considered a good intro into game making and quick to try out ideas.
1
u/FunnyForWrongReason Sep 05 '24
If you think it would work for your projects sure. Another one might be Godot which is light weight software that uses a custom scripting language very similar to Python.
3
u/Zephanin Sep 05 '24 edited Sep 05 '24
I beg to differ from other comments. I've used python to code my version of the classic Snake Game, and I'm currently using it to code my own Life Simulator. It's great as far as text-based and 2D games with hardly any complexity go. Otherwise, try Twine which is a story based game either linear or non-linear which is very easy to use, you create your own stories and it follows an order etc. Otherwise, your best bet is Godot or Unity, you can also try Ren'py for VN type of games too.
If you ever struggle, use Claude or Jasper which are by far the two most amazing coding bots. However, you will need some type of previous coding experience and don't just copy and paste it, see the difference and test all the time. I've been spending about 4 weeks coding my life simulator, and I've honestly tested it several thousands times and after every update, bots also allow you to debug using python which makes it so much easier to see what's wrong etc.
1
u/No_Molasses_7224 Sep 05 '24
So I have to not use game maker?
4
u/Zephanin Sep 05 '24
You don't need game maker. Python is standalone. You just have to install it right and pip install what you need and you can work from there.
0
u/No_Molasses_7224 Sep 05 '24
So it’s basically its own game engine? That’s also a coding language? I’m extremely confused.
4
u/Zephanin Sep 05 '24
It's mainly coding, not necessarily a game engine. I've literally coded everything into a game but you run the code into python and it either works in cmd (Command Prompt) which is the basis of python, it's literally all commands. Or you can pip install tkinter which gives it its own game window
3
Sep 05 '24
Python is a programming language, but you can get game engines that work with it.
Same as C++ is a programming language, and you can get game engines for it.
4
u/Chaos-n-Dissonance Sep 05 '24
Not really.
You can code games in Python... But it only really works for lighter games. If you wanted to make the next Valorant or CoD... Python isn't gonna cut it. If you wanna make something like Angry Birds or a simple platformer... Python will work just fine.
Check out this video from DaFluffyPotato, someone who has successfully made and sold games written in Python.
1
u/No_Molasses_7224 Sep 05 '24
No, I’m only making 2D no games call of duty clone
4
u/Chaos-n-Dissonance Sep 05 '24
Check out the video then, the answer is "maybe, it depends on the game".
4
u/imbev Sep 05 '24
That depends on the type of game. For simple games, try the pygame-ce package
-6
2
u/oclafloptson Sep 05 '24
You might be interested in Ursina if you're familiar with Python and looking to play around with some light game dev. It handles both 2d and 3d pretty well and is relatively easy to use. You can spin up a simple Minecraft clone in only 30 lines of code. The docs are severely lacking, though, so if you're really new maybe check it out later after having a better grasp
I find the Flet framework to be really good at building card and board style games where physics aren't required. I've built card games, mancala, minesweeper type games and even an ant farm sim all with Flet
Not every game has to be CoD lol but yeah they're right if CoD is your goal there are better options
1
u/No_Molasses_7224 Sep 05 '24
I’m not familiar with python whatsoever. I am completely new. please don’t shame me for being a new person to this kind of stuff that isn’t scratch
2
u/oclafloptson Sep 05 '24
No shame intended. We all started somewhere. Only pointing out that the Ursina docs don't do a very good job of explaining as they assume implied knowledge. It is a really fun engine to work with though if you prefer Python
1
u/No_Molasses_7224 Sep 05 '24
I’ve heard python is pretty good probably better than JavaScript, but I don’t know I’m new to coding languages
1
u/oclafloptson Sep 05 '24
Python and JavaScript are extremely similar. One is more commonly used for web dev while the other more commonly used for data science. Both are ok options for game dev. But...
Like others have pointed out, if game dev is your goal you might be better off starting with a popular engine. Unity, GoDot etc
0
u/No_Molasses_7224 Sep 05 '24
Another thing I’m only interested in making 2-D games I don’t want to make a call of duty clone
1
u/oclafloptson Sep 05 '24
Yeah I got that. That part of my comment was more aimed at others who assumed that game dev = advanced fps
2
u/ninhaomah Sep 05 '24
Python good for websites ? Lol ...
3
0
u/No_Molasses_7224 Sep 05 '24
Listen, I don’t know anything about coding languages. I just want to code video games.
2
u/ninhaomah Sep 05 '24
Then go learn Unreal or Unity3d.
And learn what is a game engine.
1
u/No_Molasses_7224 Sep 05 '24
I don’t wanna make 3-D games
2
u/ninhaomah Sep 05 '24
https://unity.com/solutions/2d
As I said , go learn what is a game engine.
-2
u/No_Molasses_7224 Sep 05 '24
But when I upload my game, I don’t want them made with unity thing to pop up
1
u/BadSmash4 Sep 05 '24
You might consider using Godot. It's a game engine. It's language is based on Python, so good easy learning curve. Works well for 2d games. And is free.
Alternately, you could use a language called Lua and a framework called Love2D. It's a pretty simple framework and a nice way to learn. But overall I think I'd recommend Godot to you. Worth looking into.
1
u/RandomPersonDotExe Sep 05 '24
Unity has built-in 2d, and unreal engine has paper-2d (which is 2d located in a 3d space).
As for your unity splash screen question, you can disable that in the project settings.
Go do some research, please. Dont just ask around in reddit for all advice.
1
u/No_Molasses_7224 Sep 05 '24
I thought unity was only for 3-D games
2
u/RandomPersonDotExe Sep 05 '24
It is only for 3d games, but you can still fake the 2d effects.
Some people find it easier to work in a 3d environment when making 2d games. Some have other opinions.
Now i hear you're very new to this, so save some struggle and use unreal engine's node-based programming.
2
u/JohnJSal Sep 05 '24
Because I think it’s only good for coding like websites or some shit
Jesus. Start with growing up and learning how to communicate first.
-3
u/No_Molasses_7224 Sep 05 '24
It’s not my fault that I’m Gen Z OK we talk differently instead of you millennials but if you insist
3
u/JohnJSal Sep 05 '24
It’s not my fault that I’m Gen Z OK we talk differently instead of you millennials but if you insist
When you were born is certainly not your fault, but it is entirely within your power to learn to speak and write properly. There is not one single bit of punctuation in your sentence above. Good luck in the real world.
P.S. I'm not a millennial, unless you consider someone in their 40s to be one.
-1
-4
1
u/Sufficiency2 Sep 05 '24
depends on what you want to make.
say if you want to make something like Elden Ring, you will be better off learning unreal.
1
1
u/sad_developer123 Sep 05 '24
Sorry to break it to you but python is very inefficient for game making, people generally develop games either in c or c++, python is a fantastic general purpose language but games and game engines like unity are mostly based on some flavor of c.
1
2
u/SquiffyUnicorn Sep 05 '24
Trying to collate the responses into a single meaningful reply here…
The real answer is that Python can be used to make games, with the caveat that some types of games are better made using other tools.
Unfortunately a lot of people ask what seems to them to be a very straight-forward question. There is no simple answer to this question. The actual answer is much more nuanced than they realised- more actual work is required before you can understand the answer. This is not what many people want to hear- sadly life is full of complexity and this has to be accepted.
High performance games (triple As, high quality 3d etc) will be better executed using other tools. Just like while you could fit that carpet with a knife and fork, in practise it would be hard work and won’t look good at the end.
As you said, you want to do 2D games.
Can I ask what your future plans are? If you want to do this professionally you might think about developing useful skills and experience with certain tools.
I understand that Python is used in a lot of games, but usually only in a small or very specific part. Graphics engine etc will often be done in something else.
Yes you can make games in Python. Yes 2D games are feasible in Python. It would not be a bad thing to start there and move on to do something else in the future should you want to.
Why should you choose Python over other languages? It is quick to learn and you don’t need an in-depth knowledge of it just to get started. Lots of libraries and a relatively friendly community. It is the standard for the AI and data science industry, and increasingly common in other areas.
Why would people suggest doing other things? C++ is more common for professional game studios and associated tooling. However, C++ has a steep learning curve which could prevent you from making your first game.
There is no single best language for anything.
Life is complicated and has many options. Sometimes it is best just to choose one and try it out, being willing to swap to your other option if needs be.
Caveat- I am not a game developer, nor am I a professional developer. However, I read, I learn and try to understand but accept that many things cannot be reduced down to a ‘which one is the best’ question.
This one is for free- sadly a lot of people seem all too willing to let others do their thinking for them. Think for yourself, make a judgement call and own it. Don’t be afraid to be wrong, just be willing to admit it and take a better path.
Especially, Don’t let chatGPT do your thinking for you- it does not actually think, and relies on the internet for its ‘facts’.
1
1
1
u/ryoko227 Sep 05 '24
I am currently working on the Alien Invasion section from the book Python Crash Course, and those chapters are solely about making a 2D shooter game in Python. It heavily uses pygame and OOP. I've heard that Godot's code is very similar to Python, but haven't used it myself. I think even if Python isn't specifically for games, it might be a good foot in the door to programming and possibly the "how" part of making a game.
Granted, I only really jumped in on finally learning to code about 2 months ago, so I may be totally off base, www
1
u/Ok_Cupcake8963 Sep 05 '24
If you're only starting to learn coding, the Renpy engine and community are good starting points, but it's not a good language for game development overall.
1
u/WillHasStyles Sep 05 '24
Python isn't really that great for making websites (unless you're referring to backend), much less video games. It's a general purpose language meaning you can do all of those things, but for many tasks it's not the standard tool. However it's even an excellent language if you want your skills to translate to multiple domains.
But if you specifically want to learn game development, and not general programming skills, you're probably better off learning to use a game engine and whatever language is most commonly used in it.
1
u/KCRowan Sep 05 '24
Here's a video of someone making a game in python if you want an idea of what that would involve https://youtu.be/fo4e3njyGy0?si=FE2demAt-BQPFP-X
Although as you'll probably realise right away, you need to learn the basics of the python language first, so you'll want to start with some basic tutorials like this one https://youtube.com/playlist?list=PLzMcBGfZo4-mFu00qxl0a67RhjjZj3jXm&si=2cCVCqdOrk0aJToR
1
u/MiniMages Sep 05 '24
It's doable but not recommended unless you know what you are doing.
This is why game engines exist as it offers a lot of the tools needed to make a game however, you now need to learn about the tool itself.
Saying all that one of my early projects was a 2D top down game built purely using JS. I learned a lot and some parts were fun, others were not so...fun.
1
18
u/backfire10z Sep 05 '24 edited Sep 05 '24
Python can definitely work, especially for a 2D game. A game engine may make more sense for you though: Godot, Unity, or Unreal Engine (in order of increasing complexity, more or less).