In this solo project, I embarked on an exciting journey to recreate a cherished childhood favourite - Pacman. Armed with JavaScript, HTML, and CSS, I immersed myself in the delightful process of bringing this classic arcade game to life.
Over the course of a week, I dedicated my efforts to crafting an engaging and functional Pacman game that would capture the essence of the original, while infusing it with a touch of creativity and innovation.
My version of Pacman boasts several compelling features that pay homage to the beloved classic:
- Two Unique Maps: I meticulously designed and incorporated two distinct maps, each offering a unique challenge and gameplay experience.
- Progression to the Next Level: Players can revel in the excitement of advancing to the next level upon successful completion of each stage.
- True to the Original: Emphasizing authenticity, I ensured that the game retained all the familiar characteristics of the classic Pacman, creating a nostalgic and enjoyable experience for players.
Try It Out!
I invite you to relive the nostalgia and embark on a thrilling Pacman adventure. Play the game here and experience the joy of chomping pellets, evading ghosts, and advancing through the levels.
Play the game here - here
Pacman: https://thisisgurpal.github.io/pacman/ Gurpal Gohler (LinkedIn): https://www.linkedin.com/in/gurpal-gohler/To create a game of your choice in a week using Vanilla JavaScript.
- JavaScript
- CSS
- HTML
- Visual Studio Code
One of the notable challenges encountered during this project was dealing with repetitive code segments across different sections. To tackle this issue, I opted for a more organized approach. By creating smaller functions that performed specific tasks and reusing them throughout the codebase, I achieved not only cleaner code but also improved readability for other team members.
Another significant hurdle arose when implementing the Ghosts class to incorporate ghosts into the game. After careful consideration and reviewing my notes, I concluded that using a class would be the most effective approach. However, it posed a challenge, particularly when integrating additional elements such as the ghost's scared state (isScared). Yet, once the class structure was established, adding ghosts, adjusting their speeds, and modifying their starting positions became considerably more manageable.
A notable accomplishment was the successful integration of different pages into the game, allowing smooth navigation. The home page, in particular, proved to be an engaging entry point to the game. Furthermore, incorporating various components during gameplay significantly enhanced the user experience. Elements like animated reactions, such as the box shaking upon beating high scores or displaying a sad face upon colliding with a ghost, added a delightful touch to the overall gameplay.
Throughout this project, my primary focus was to gain proficiency in the structure of HTML, refine CSS styling, and utilize JavaScript to create functional interactions. Notably, mastering JavaScript to handle keyboard inputs and dynamically amend HTML content proved to be a valuable takeaway. Initially, I wasn't fully aware of the potential of manipulating HTML through JavaScript and creating reusable functions to improve code efficiency. This newfound knowledge empowered me to write more efficient and legible code, minimizing redundancy and promoting a modular approach.
As I reflect on this project, I feel content with its achievements, especially considering it was my first venture into this domain. However, looking ahead, an exciting future feature I envision is implementing Artificial Intelligence (AI) for the ghosts. This would introduce a new layer of challenge and engagement to the game by enabling the ghosts to intelligently follow Pacman. While I did not have the opportunity to include this feature within the current timeline, it remains a compelling goal for future iterations.