Advertisement

Should I drop pygame?

Started by May 04, 2017 06:49 PM
18 comments, last by Lucas_Cage 7 years, 6 months ago

Last August I posted a thread asking whether I should focus on Python or Game Maker Language. I chose Python since the advice seemed somewhat mixed. I've been making a game in Pygame but I recently read the post "is my Idea Possible with Pygame". Since I've been struggling just to make a button class with Pygame I felt like maybe I should scrap what little progress I've made in python and just do something else.

One of the reasons I've become wary about Pygame because in the thread it was mentioned that Pygame is best for small short projects. I don't let myself have (too many) grandiose plans but I'd like something I can easily just continue working with indefinitely.

My first thought is that I should code in unity. I don't know C# but I'll have to learn it sooner or later for my Computer Science major and it seems to be a better choice for hobbyist game development than python. I understand C# in unity is different from regular C# but I'm not sure how much.

Overall I guess I'm just overwhelmed by the different options. To sum up, my question is what should I do at this point, stick with Pygame, or learn C# and use unity, or maybe work with some completely different sort of game-making software. If possible I'd like to do something that will benefit my Computer Science studies. I'll also have to learn Java and a bunch of other languages. Once this semester is over, I won't use python again for my major.

If you're making a game with Pygame, then a game with the same complexity as:

pong, snake, asteroids, breakout, tetris, missile command, galaga, pac-man, ikari warriors, gradius, super mario bros, or zelda

then pygame should be [more than] sufficient.

If you're struggling with making a button class, then know it's not going to be much easier in other languages. Python is one of the easier languages to work with.

So I guess the questions really are:

  • what is it exactly you're struggling with,
  • what's the button planned to be used for (menu, part of in-game GUI, etc),
  • and do you understand what's actually needed to make a button class?

Beginner in Game Development?  Read here. And read here.

 

Advertisement

If you're making a game with Pygame, then a game with the same complexity as:

pong, snake, asteroids, breakout, tetris, missile command, galaga, pac-man, ikari warriors, gradius, super mario bros, or zelda

then pygame should be [more than] sufficient.

I don't doubt it's more than sufficient. I would bet you could do just about any 2D game project in pygame. However it seems like it would be substantially more difficult than programming with game-software specifically designed to help you create games.

If you're struggling with making a button class, then know it's not going to be much easier in other languages. Python is one of the easier languages to work with.

According to the post I mentioned, Pygame is aging significantly. I guess since (I think) it's independently developed, it seems a lot harder to get a grasp of than any of the python libraries that I'm familiar with.

what is it exactly you're struggling with,

Typical programming issues. I make something I think will work. It doesn't, so I fix it. Then I find out something else doesn't work. I hesitate to answer here because I'm afraid if I answer somebody will just give me the answer to the specific problem I'm facing. if I don't struggle for a while, I don't learn. I just don't want to work harder than I have to. I'll edit my post above because I didn't mention this, but I won't be learning python again for my major. At least not for awhile, so I'm free to move to another language. Right now Python is all I know.

what's the button planned to be used for (menu, part of in-game GUI, etc),

I'm making a button "class" specifically because I want the buttons it creates to be used for a bunch of different stuff. All of the examples you mentioned would fit.

and do you understand what's actually needed to make a button class?

Erm, I'm not sure what you mean here. If I understood that, I wouldn't be having problems would I?

Overall it seems like you might think I've only been working on this for a little while, got frustrated and maybe started to give up. That's not what I intended to convey. This post is about planning for the future. Ultimately my game is a hobby I have no plans to abandon. I'm just wondering if it might not be better to switch to a different medium

However it seems like it would be substantially more difficult than programming with game-software specifically designed to help you create games.

Switching to Unity or a other engine would make things a hundred times easier, yet it's the worst thing you could do.

Yes Unity will allow you to make buttons easy, load sprites easy and in fact Unity will do all the basics for you. Then what? After you have some basic thing that looks like a game and it gets to the point where you need to make the game, you hit the same wall.

Making object, characters and effects for a game still uses the same basics as making a button. It doesn't matter that the language you use is different, the principals remain the same.

So for you to switch to Unity you will need to make at least a menu with pygame, if you don't you will face the same problem later.

Start here: https://pythonprogramming.net/pygame-buttons-part-1-button-rectangle/

First make the button then create a class for the button.

Making games is all about passing walls, true you can run to Unity and avoid the wall for a while, however sooner or later you will have to get past it.

To sum up, my question is what should I do at this point, stick with Pygame, or learn C# and use unity, or maybe work with some completely different sort of game-making software. If possible I'd like to do something that will benefit my Computer Science studies. I'll also have to learn Java and a bunch of other languages. Once this semester is over, I won't use python again for my major.

Stick with PyGame. There is a tremendous amount of value in learning to solve problems in your given environment. There is also a tremendous amount of value in learning how to iteratively prototype and develop in languages like Python that offer a REPL (Read-Evaluate-Print Loop). Thirdly, there is a tremendous amount of value in learning different approaches/techniques embodied by different languages. A language like Python is deeply, trivially introspective, whereas a language like C# requires more elaborate reflection libraries to approximate the same; or Python's structural flexibility and preference for composition over inheritance versus C#'s object orientation orthodoxy.

Over the course of your studies and, should you continue to pursue this professionally, career, you will need to work with and learn many different languages. Completing reasonably complex projects in different languages is a great way to build competence. Finish your current project in PyGame, then reevaluate and see if you want to move to Unity or something else for your next project.

Good luck!

Stick with PyGame. There is a tremendous amount of value in learning to solve problems in your given environment. There is also a tremendous amount of value in learning how to iteratively prototype and develop in languages like Python that offer a REPL (Read-Evaluate-Print Loop). Thirdly, there is a tremendous amount of value in learning different approaches/techniques embodied by different languages. A language like Python is deeply, trivially introspective, whereas a language like C# requires more elaborate reflection libraries to approximate the same; or Python's structural flexibility and preference for composition over inheritance versus C#'s object orientation orthodoxy.

Over the course of your studies and, should you continue to pursue this professionally, career, you will need to work with and learn many different languages. Completing reasonably complex projects in different languages is a great way to build competence. Finish your current project in PyGame, then reevaluate and see if you want to move to Unity or something else for your next project.

Good luck!

Switching to Unity or a other engine would make things a hundred times easier, yet it's the worst thing you could do.

Yes Unity will allow you to make buttons easy, load sprites easy and in fact Unity will do all the basics for you. Then what? After you have some basic thing that looks like a game and it gets to the point where you need to make the game, you hit the same wall.

Making object, characters and effects for a game still uses the same basics as making a button. It doesn't matter that the language you use is different, the principals remain the same.

So for you to switch to Unity you will need to make at least a menu with pygame, if you don't you will face the same problem later.

Start here: https://pythonprogramming.net/pygame-buttons-part-1-button-rectangle/

First make the button then create a class for the button.

Making games is all about passing walls, true you can run to Unity and avoid the wall for a while, however sooner or later you will have to get past it.

Thank you for these informative posts. I understand what you guys are saying. I probably could easily make a menu in Pygame by following any of numerous instructions on the internet. They didn't really cover what I wanted to do. That said, I'm already extremely close to making buttons work. There's just one more thing to sort out and then I think I'll be golden.

That said, I'm only interested in working on a single project right now. I have various game ideas that I want to work on for awhile instead of just making tiny game after tiny game. That's why I'm worried about the whole "Pygame aging" and "small quick games" things. To clarify, I don't plan on making the next triple-A game. I just want a project that I can work on a little at a time for a long time. This creates a problem with the whole "finish what you start" idea, because I don't really have a finish line.

Also, I the problem I'm having seems to be more of a Pygame syntax thing than something to do with understanding buttons in general. I just need to figure out how to get Pygame events returned from a function or class into the game loop, or find someway around that. If it isn't possible.

Advertisement

Also, I the problem I'm having seems to be more of a Pygame syntax thing than something to do with understanding buttons in general. I just need to figure out how to get Pygame events returned from a function or class into the game loop, or find someway around that. If it isn't possible.

You use return for that. However I don't think you need to for something like this.
Pygame's syntax is derived from python, so you just need to understand how pythons classes and functions work.

[spoiler]
# ******************************
myFunction():
    print("Hello world")
 
# to run a function we call it 
myFunction()
 
# ******************************

def myFunctionWithInput(MyInput):
    print(MyInput)

# we call it again, now with a unput
myFunctionWithInput("Hello again world")

#******************************
# a function with return 
def myMath(InputA, InputB):
    MyAnswer = InputA + InputB
    return MyAnswer

# we print the function and because it returns MyAnswer we print MyAnswer
print(myMath( 1, 3))
 
# ******************************
# a class
class MyCharacter():
 
    def __init__(self): # this allows us to call self
 
        self.HP = 100
 
    def damageCharacter(self,AmountOfDamage): #add self here so we can use it
        self.HP = self.HP - AmountOfDamage
 
 
#To use a class we create a instannce
Player = MyCharacter()
print(Player.HP) # We will get a 100 because it's what self.HP is set to
 
Player.damageCharacter( 20)
print(Player.HP) # We get 80 because the player lost 20
 
[/spoiler]
So we can see that Pygame's pygame.draw.rect() is just a function that wants inputs.

If you have problems understanding this, I recommend the python tutorial on CodeAcademy.

I posted that thread you're referring to, and I decided to stay with PyGame.

I just want a project that I can work on a little at a time for a long time. This creates a problem with the whole "finish what you start" idea, because I don't really have a finish line.

The game I'm working on is a hobby project, so for me, it's done when it's done :wink:.

I decided to stick with it, because as Oluseyi, it's a chance to learn a new language, and show you can solve a problem regardless of environment. I've never worked with Python, but I do have some experience with C#/Java.

If you interested, another library that was mentioned was Arcade, although other than the official website, tutorials are hard to find, but according to the website, it's improves on certain PyGame functions. I'm not saying don't try Unity, but I'm using PyGame as a beginning/starter project, when I get comfortable, then I can probably move on to Unity.

I also don't think you should use "Game Making" software, unless you want to get an idea of how they work, so you can create you own game making software. To me, this seems like a cheat, and as a programmer, you're a problem solver, regardless on language.

I make something I think will work. It doesn't, so I fix it. Then I find out something else doesn't work.


Don't worry about that; that pretty much sums up programming for everyone ever.

This topic is closed to new replies.

Advertisement