Develop a basic game using PyGame
by k1ng
Software Development Journey Overview
Follow this step-by-step software development journey to see real progress updates, challenges overcome, and practical experience.
Progress Updates (6 total)
Update #1: Develop a basic game using PyGame
I’ve always been interested in developing a game of some sort. Creating my own set of rules and mechanics and logics, with a cool narrative. I also have a subsequent goal of enhancing my Python skills. This goal will hopefully handle both.
Update #2: Clicker Game
15% completeThings are moving along and I’m happy with the progress. I made a quick “Clicker” game demo where it cycled through text and loaded an Asset image, and even audio. I then decided to take that to the next level and morph it into something i can build a game off. I would put myself just before completion of the second milestone.
Challenges Overcome: I’m getting better at the big picture of what does what in Python. I’ve implemented lots of functions and getting the hang of where and when arguments should be used.
Obstacles Faced: That being said, I still find myself taking time to try to understand why certain Python approaches work or don’t work.
Question: What would be a fun (and easy) challenge to try to implement into a “Clicker” based game?
Update #3: Sharable Demo
25% completeI was able to put together a playable demo, add some more assets and game mechanics.
Challenges Overcome: Now that i have a slightly better understanding on how things work, the struggle lately has been trying to juggle lots of logic happening simultaneously. I was able to clean things up a bit and the current state of the game should be a (hopefully) bug-free playable demo.
Obstacles Faced: Organization is going to be paramount going forward. I'm doing my best to organize things as cleanly as possible so i can easily implement new systems without breaking other ones.
Looking Back: There have been a lot of changes over time to my approaches as i got more comfortable with the language/library.
Update #4: Re-Organizing
35% completeGame content wise, not much has visibly changed. But I've spent a lot of time re-organizing my code to work more effectively, and in a way that is easier to expand it going forward. I've found that keeping the project structured cleanly is one of the best things I can do for myself to keep progressing. Along with the re-structure has come a lot of experimentation and learning what (and what not) to do.
Challenges Overcome: I was able to restructure my project in what I feel like is a much more clean way. There is still a lot to learn of course, but I could feel my code getting spaghettified as I trudged along the old way.
Obstacles Faced: The main idea to the re-structure was to organize things in a way that was A. easier to navigate and B. easier to expand. Some of my functions were becoming bloated, with tons of the same arguments being passed in and returned. One way to try to rectify that was using dicts, which would help in some ways but not entirely. Another way was using global variables. What I ultimately landed on was putting the code into it's own class, so instead of using global variables, they are class attributes that can be used and modified in any of the class functions.
Looking Back: Spending a lot of time using functions, how they work in terms of passing in and returning arguments and values, and how to access those returned values. The subject of global variables was a major hurdle, as I've found is the case for most programming noobies.
Update #5: Expanded features and mechanics
50% completeI was able to add new features to the game, and see how my reorganizing felt. I still feel there's more that can be done to smooth things out and keep better organizing, but that will come naturally as the game grows.
Challenges Overcome: Added a few "animations". I have a better grasp on how things in the library work so I see a bit more of the Matrix. The direction of the game is slowly taking more shape. The framework feels fairly solid and should allow me to continue expanding.
Obstacles Faced: A lot of the more recent progress has been based around UI and flow. I want stages to be clean and obvious to what they do. Also adding some cool looking animations will add to the vibe of the game, which are a little tricky to implement.
Looking Back: I'm hoping all my breakthroughs in understanding scopes and what classes/functions etc are used for and what they can do will help me when I undertake different coding projects.
Update #6: Added features
100% completeI've added some new features, but these have all come with slowdowns and hurdles where a lot of time has been spent thinking and learning.
Challenges Overcome: This time through, a lot of the work has been drafting ideas of where to take the game so I can develop a new plan going forward. It's so easy to get feature creep, and every time I remind myself I need to take smaller steps, I seem to actually make good progress. I'm pivoting the game to be a more "relaxed" RPG autobattler type game. So far I've added a little more narrative to help bring it there, as well as implemented the first versions of how "fights" will play out. I also have a very basic Equipment and Ability system mostly set up in the background.
Obstacles Faced: Lots of Python concepts are stacking on top of each other, so I need to make sure I'm slowing down and commenting out my code for what the intent of every line is and what it's doing. Getting down battle logic is very challenging. Being able to set unit order, have units exchange attacks, and have their gear affect their stats and abilities, has been tricky.
Looking Back: Keep a plan in mind, keep goals easy and not too lofty. They'll be worked up to. For this update I've also spent a lot more time messing around with different modules and importing scripts within a project.