I’ve been trying to learn more python so I can automate day to day tasks. I have been using it in blender to create some simple operators to change multiple bone shapes at once and help speed up other rigging processes, but found myself stumbling when the complexity required goes above a simplistic script. Cue more learning required.
In an attempt to learn more python I’ve started making a small, simple text based adventure game!
Making games is fun and I’ve never made a text based game before and apparently learning happens best when you having fun. Needless to say I’m loving python! My favorite language feature so far is list slicing, and list comprehension.
Initially I had a simple game loop running all in a single file (it was nasty) but was awesome to see how much was being done with so few lines of code. I’ve since extracted functionality and separated the game into different classes that handle their own responsibilities and have shared structure across common entities. In making all these separate files, I’ve learnt ways to import the different modules and how to group them into a common packages. It’s exactly what I was hoping to get from this exercise.
Making a text based game is helping me FOCUS. How to separate functionality and how to think of “when to class” more than anything I’ve made in unity so far. I think it’s because I can’t get distracted and get lost in decisions about making pretty pixels. It’s a frequent trap I find myself in, only realizing where I am after having sunk many hours in doing “not the next most important thing”. Even though I know about the trap, my feet get caught by it 90% of the time, but in this environment I seem to be flying it’s awesome!
So if you wanting to learn python but don’t have and idea for a project that can help you right now, try making a simple text based adventure! It’s fun 😀