This repository hosts a meticulously crafted project that replicates the iconic and nostalgic arcade game, Pac-Man, utilizing the robust and versatile Unity game development engine. This clone aims to pay homage to the original game while providing a foundation for further exploration and experimentation in game development.
Navigate to Your Unity Project Directory:
Open a terminal or command prompt and go to the root directory of your Unity project where you want to use Git.
Initialize a Git Repository:
Run this command to start tracking your project with Git: git init
Install Git LFS (Large File Storage):
For Unity's large game files, Git LFS is essential. Install it with this command:
git lfs install
Create a .gitignore File:
To ignore unnecessary Unity files, create a .gitignore file:
touch .gitignore
Edit the .gitignore File:
Open the .gitignore file with a text editor and paste in the Unity-specific ignore rules:
Set Up Remote Origin:
If you want to push your project to a remote repository like GitHub, set up a remote origin:
git remote add origin
Make Your Initial Commit:
Commit your initial project files to the Git repository:
git add .
git commit -m "Initial commit"
Created layers. (Pacman, Ghost, Pellet, Obstacle, Node). This allows us to modify the Collison matrix. For example we don't want collision between the nodes and Pacman because the nodes are for the ghosts.
Imported all the sprites needed for the project! Made a new folder called sprites. Added a new game object called Game Maze. Added box colliders to my game maze to act as walls.
Making the Prefab!Added a 2d tile map in the hierarchy and named the object pellets. And then I created the prefab by creating another game object and adding a sprite render, a 2d box collider, and made sure the scale was good according to my game maze. I choose 1.7 for the sale of pellet. And then drag the pellet into a prefab folder hat I made in the assets. I also did this for the power pellet. And then deleted the objects from the hierarchy bc they are not needed there since they are prefabs A much more efficient approach from the last approach. This allows me to just draw them onto my screen with a simple click. and it'll be guaranteed symmetric versus my last approach where I had to fix the coordinates for all the pellets.
Important Step! Now that we have our pellets configured, we need to make sure when we put them on the scene, everything is symmetric. To do this we need to add a rule tile to the assets. this allows to automatically determine how tiles should be placed based on neighboring tiles. It's a powerful tool for simplifying level design and maintaining visual consistency in your tile-based games. Add rules tiles for pellet and PowerPellet.
Now after the pellets are all placed, we need to place the nodes so the ghost can choose which direction to go. We made a node prefab and dragged it to the tile map which makes it easier for us draw them on the scene.
HOW YOU SHOULD START ANY PROJECT
Navigate to Your Unity Project Directory: Open a terminal or command prompt and go to the root directory of your Unity project where you want to use Git.
Initialize a Git Repository: Run this command to start tracking your project with Git: git init Install Git LFS (Large File Storage): For Unity's large game files, Git LFS is essential. Install it with this command: git lfs install
Create a .gitignore File: To ignore unnecessary Unity files, create a .gitignore file: touch .gitignore Edit the .gitignore File: Open the .gitignore file with a text editor and paste in the Unity-specific ignore rules:
Set Up Remote Origin: If you want to push your project to a remote repository like GitHub, set up a remote origin: git remote add origin
Make Your Initial Commit: Commit your initial project files to the Git repository: git add . git commit -m "Initial commit"