Tortvenger: My Foundations Portfolio Project
To end our foundations year at Holberton school, my partner (Daniel So) and I set out to create a game to ease the boredom of most of America, who have been forced to work or take classes from home due to COVID-19. Dan worked on battle design, creating sprite sheets and working on collision detection, while I worked on the user interface including the title screen and the main menu. Our main focus is to create a game that could work on most, if not all operating systems. We noticed that a lot of games that work on a Windows machine are not compatible with OSX or Linux.
Dan and I met before Foundations began. We visited the campus one day as part of the admissions process and was introduced to each other. I remember him clearly, because he talked about his tortoise, Kuppa, a lot and he even gave me a sticker of him. When it was time to decide on the theme of our project, we knew Kuppa was the right mascot for it. We just needed to decide what it was we wanted to create. Earlier this year, the world was hit by a global pandemic. Due to this pandemic, a lot of people have been staying home and playing games with their loved ones and friends to ease the boredom and isolation, so we decided to create a game ourselves.
Summary
The most important backend component of the game is the event handler. All of what you see on screen is due to the event handler reading the user’s input: buttons pressed correspond to a specific event in the game like a cursor moving or the character jumping.
During the development stage, we have accomplished these items on our to-do list:
- The user interface reads data from the current user’s machine. This way the game is scalable with any screen size and resolution.
- Collision detection was successful and Kuppa is now able to walk and jump on platforms that we set on each level
- Kuppa is able to draw his swords when on attack mode
Technologies Used
We decided to use the Pygame module with Python3 to create our game. One of the other options we considered was SDL2 with C, but since we had very little time on the development stage and Python handles memory management on its own, we decided on using Pygame instead.
Technical Challenges
The most difficult challenge for me was making the game scalable to any machine. Watching tutorials on Pygame, I quickly noticed that the developers on these videos were setting the game screen size to a precise number. What happens if I set a number too high for a user’s screen size? I did not want to find out the answer to this question, so instead, I just addressed the issue right away. The solution was to, at first, hard code the width and height of the screen to my own and hard code all widths and heights of texts, boxes, rectangles, etc. that were drawn on the screen. Once the screen is set in place the way it was supposed to look like, the width and height of the screen was replaced with the current user’s screen’s width and height by using a method from Pygame that read the user’s display’s information. The scaling factor of all the other objects were then calculated by using my own screen’s width and height.
What I’ve Learned
Learning a module like Pygame is like learning a new language. There were a lot of documentation to be read and we had to take our time understanding what the methods do, so we can successfully use them in the development of our game. If I had a chance to start over, I would definitely take the time reading more of the documentation. There were definitely some lack of understanding in some aspects of Pygame that thankfully, Stack Overflow was able to help with a little.
Another thing I learned, this time about myself, is that I really enjoy game development. I enjoyed it so much that I started leaning my Specializations choice to AR/VR instead of web stack. Another personal preference I confirmed “superior” throughout this project is VSCode with the vim plugin. I attempted to code this project using the terminal and Sublime text editor, but ended up missing VSCode so much during those times.
If you have managed to read the entirety of this blog, I truly thank you. Here is the GitHub link to our project if you wanted to check out the code: https://github.com/djso89/tortvenger. The project landing page for a quick overview of the project is here: https://1448054.wixsite.com/tortvenger.
My name is Nic Basilio and I am a developer with a lot of interest in game development and front-end design. I love learning new languages and opening myself up to awesome ideas that come my way. If you would like to reach me to discuss Tortvenger or this blog, here are links to my LinkedIn, Twitter or GitHub.