Technology/Multimedia: Coding (Python) Part 2

Python, python, python. It’s a snake! There is a snake called python, but that’s not what we’re referring to. It’s a programming language. Python 2? No, that was last round. It’s python 3 this round! So in this round of Technology and Multimedia, we continued learning the programming language of python, but we used a better, more updated version of it which was python 3.

So what’s changed in python 3? Python 2 and 3 are still the same, I’d say. There’s just a small difference. In python 2, the way you would use the print function is:

But in python 3, it would be like:

On the course of a week, we learned new functions to better expand our knowledge of python, opening new doors for exploration and experimentation. The first function that we learned was ‘define’ and it is a function that allows you to make your own functions using the functions that are already in python. It basically allows you to repeat lines of code by writing whatever you named the function, it’s just like creating shortcuts. The next two things we learned were python lists and dictionaries. These two are similar. A list does what it’s called, it’s a list. It’s a collection of items that has an order, is changeable, and let there be more than one of the same thing; duplicates. A dictionary is like a list except that it is unordered and does not allow duplicates. It took some getting used to the changes in python 3, but we were back to writing code and programming in less than a snap because we needed to put what learned to use. In exercises.

The second week, I worked on two exercises from Code Club, a website that has lots of projects for you to work on in different languages of code. The two I worked on were making a program that chooses teams and a rock, paper, and scissors game. When writing code in programs and exercises this round, I wanted and decided to make my own additions. Like 80% of the time, the functions didn’t work on first run which still made me frustrated, but that frustration wasn’t bigger than the satisfaction of them working on later runs which I loved.

At the end of the round, we had to choose another project from Code Club to work on. Whenever I write code or think about code, creating a game or a program always comes up to my mind. And so I took this opportunity to do it. The project that I worked on was an RPG (role-playing game). When choosing a project on Code Club, instructions would pop up and you would follow them. I followed the first step, which was copying the pre-made code for the project, but then I went off drifting and trying to understand code that I copied. There were comments talking about what the code below them did and I read every single one of them. They taught me new functions and opened the door of possibilities which means they gave me lots of new ideas. I went back and followed all of the instructions. Its goal was to make a simple maze game that was short and easy to play, but it wasn’t the type of simple I liked. So I made my own additions to the game.

It certainly took a lot of time, but I did it and I’m really happy about it. At around the same time I was writing and making the game, I was extremely addicted with and fascinated by a very artistic and wonderful game, Hollow Knight. It is a metroidvania and it was made by a team of two developers from Australia. What I love most about Hollow Knight is the lore and its art and a lot more. I’m still playing it as of writing this. I think it was the source of inspiration when I was writing the game and what drove me to make one in the first place. In the process of changing and making the game, I faced a lot of errors, of course, but the joy in fixing in was still there. There was one time when I lost the code and everything in it, so that was a, I guess I can say, a daunting and sad moment because I had made characters for the game and I had written the story of what was happening in the game. Rewriting the functions was hard, but it certainly wasn’t as hard as rewriting the story. That time taught me to save my code and also have a backup of it in a document and so I did that.

After a while, I finished the game and I made a map for it too (picture above previous paragraph). It’s called Twitfall. You, the player, wake up in a mansion. You don’t know how you got here in this cursed mansion, but you do know that you are stuck. The way you can get out of there is to escape its curse and to do that, you must use what’s inside the mansion. I put in an enormous amount of effort and time into this small project of mine and I greatly enjoyed the pleasure and happiness it brought me. If you want to play Twitfall, go to the end of this blog post and you will find links to it as well as the two other projects I worked on from Code Club. And if you’re going to play it, use the map to help you and always look at the commands when you think you’re stuck because maybe you haven’t tried using all the functions yet. I’m proud of the game and I hope you will at least get a little bit of fun and joy playing it. Lastly, I would like to say I loved learning a lot more about python, I loved that I still got frustrated with errors, still became happy when I fixed them, and that enjoyed making my own game. Thanks for reading!

Team Chooser: https://trinket.io/python/9b52a291b0

Rock, paper, scissors game: https://trinket.io/python/1ef3f217fb

Twitfall: https://trinket.io/python/bfcae35d6f

Map for Twitfall: http://bit.ly/2KVvgRt

It’s called ‘The Woriun Mansion Map’ in the drive.

Leave a Reply

Your email address will not be published. Required fields are marked *