Participating in Hacktoberfest has been exciting and rewarding journey for me, as I've had the opportunity to contribute to meaningful open-source projects while honing my skills. This year, for my third Pull Request, I chose to contribute to a project that's more complex than my first 2 PRs, it is the ZTM-Quest repository.
ZTM-Quest is a project that is part of the Zero to Mastery Academy, a platform that helps developers improve their skills and build real-world projects. The project itself is an engaging interactive web app that allows users to complete quests, level up their coding abilities. In this blog, I'll walk you through my experience working on the ZTM-Quest repo, the challenges I faced, what I learned, and how I managed to complete my third PR for Hacktoberfest
This week, I tackled an issue focused on enhancing the ZTM-Quest project by adding additional NPCs (Non-Playable Characters) to map_start. Currently, the project has only a limited number of NPCs per map, and the maintainers wanted to populate the map_start area further. Fortunately, the project already included some code for generating NPCs randomly, which provided me with a solid starting point. Additionally, the maintainer suggested that I could create custom NPCs using my own spritesheets, but given the complexity and size of the codebase, I decided to proceed with the existing assets to meet the project requirements more efficiently.
The ZTM-Quest project consists of three maps: map_arcade, map_city, and map_start. For this issue, I focused solely on map_start to align with the maintainer’s request. As someone who has never worked with a 2D game development library before, I initially found the task daunting. However, thanks to the maintainer’s guidance and detailed instructions, I was able to navigate through the codebase and identify the key files and structures related to the task.
I started by exploring the src/factories/npc.factory.js file, where the NPC creation logic is defined. From there, I began adding new NPCs by creating a file named randNpcsOnRestroomSinkCouch.gameObject.js in the src/gameObjects/map_start directory. My initial implementation placed NPCs in only one location (chairs), but upon further review, I realized that the maintainer intended for them to be distributed more dynamically across the map. To address this, I utilized the search functionality in my code editor to identify other relevant locations, such as sinks, couches, and washrooms.
Based on the positions of these identified objects on the map, I added two NPCs standing near the sink, two sitting on the couch, and three positioned in the washroom area, thus creating a livelier and more interactive environment in map_start.
My PR
Working on this issue gave me invaluable insight into the open-source community and game development. The ZTM-Quest maintainers have been incredibly supportive and professional, providing timely feedback and resources to help me succeed. When I first joined the project, I was invited to their Discord group, where I could reach out whenever I had questions. This made the experience even more enjoyable and collaborative.
Overall, this week pushed me out of my comfort zone as I took on a challenge in an area I had no prior experience in—2D game development. Despite the initial learning curve, I gained confidence in navigating unfamiliar codebases and problem-solving within a complex project. As I look forward to completing my final PR for Hacktoberfest, I aim to continue exploring new areas of development to broaden my skill set.
The above is the detailed content of Open Source Achievement: Completing My Third PR in Hacktoberfest. For more information, please follow other related articles on the PHP Chinese website!