Pac-Man 3D

Back

Player Movement

I wanted that the camera view was in first person so you can navigate through the maze.

There was a problem with the pacman model because every time i moved the model would eventually on a different position than the camera.

I fixed it to made a different script that put the model and the camera in the same place in LateUpdate

Point System

The next step was to make a point system. There is a amount of pallets(points) in de maze and a counter can check how many points there are and knows when the player picks up a pallet.

However because the point was a prefab object i couldn't assign it with the script that contains the method that would update the amount of points.

I eventually fixed it by using a static variable and call that one in the pickup script (Hard code).

Mini map with expanding

Next, I created a mini that you can expand on to make it easier to find the missed points and to see if there are ghost nearby.

I used a camera and placed it at the top of the map and faced down at the map. Then I created a camera material and a UI image where I can place the material so you can see the map through the image.

At firts the camera wouldn't follow the pacman.

By using a script I made the player a sort of anchor point so the camera will alsway the pacman.

State Machine

First i made a script gives the npc a random point in the maze. after some months after the ending of the school project i decided that i will change the whole structure into a state machine.

the purpose of the state machine is that I can later implement all ghost rules and more easily add variances of the ghost.

only when i wanted to connect with the some certain states it didn't work. after some research i discovered that i need return methods.

The Models

Here Are the models i made myself in blender.

Pacman 3D build

First version.