Create Pac-Man in UE4 in 30 Minutes
(Actually, this tutor teachs very fast and quite difficult to follow, but I got basic logic from it)
First, I built the scene for the mini game. The assets come from Sun Temple (Unreal Shop) which I used before (for the temple in the human world). There are 500 energy balls in total. Players need to collect all the energy balls to finish the game.
This is the old version, you can see there are more energy balls. After I tested it, I think it is too tormented if there are more than 1 row of energy balls on the same road. Also, there are too many roads which may make players feel bad during playing. Therefore, I reduced the energy ball and changed the design of the maze. (I may continue to change the design during testing in the future)
Enumeration
It is for creating different object in same type. In this case. I can create different type of pick up object.
Here, I just follow the tutor to create "DotPickUp" and "PowerPickUp". However, I will change it in the future to create my own style game. I will have different PowerPickUp. For example:
A power ball can let player know the position of the balls remained (~30s) (A vertical light on each remained ball, player can guess the position when the camera move upeards)
A power ball to stop the movement of enemy (~ 10s)
A power ball to avoid die once
etc...
Go to the Construction Script to make the looks of the looks of PowerPickUp. I think I will use color to seperate different function of power ball in the future.
Then, we can easily change the type of ball.
_______________________________________________________________________
Pick Up Energy Ball
Sequence 1 is for picking up the energy ball
It is written on the BP of Player Character.
The type of All Pick Up List is the actor of the energy ball. It removes index 0, then checks to see if the new length is equal to or less than 0. If it is true, the game will finish (I will do it after finish checking the game play of PacSlime)
It shows the amount will increase when we pick up the energy ball. Also, there is a pick up sound (Ref from Unreal)
It is written on the actor of the energy ball.
It shows when the player touches the collision sphere, the ball will be destroyed.
There is a special function on "Collected Power Pick Up", but I will change all power ball functions in the future, so I won't show it here.
Content:
0: PickUpAmount
99: TotalPickUp
Therefore, the number will instantly change according to how many ball I picked up and there are how many ball in total(Not need to count by myself)
__________________________________________________________________________
Enemy (Soul)
I want to use this mini game to tell a story. For my story setting, devouring living creatures (human or animals) is the main point of the game story. Only dying creatures with a strong preoccupation can be devoured by the protagonist. However, there are good and bad preoccupations in the world. Therefore, the protagonist should avoid some bad preoccupations. For the mini game of PacSlime, the enemies are the souls with bad preoccupation. Therefore, players need to avoid them to finish the game.
For the speed, the player is 500 cm/s while the enemy is 300 cm/s. It looks unfair but I still will die when I test the game. I may change the speed in the future, but the speed of the enemy must not be faster than the player.
For the character death which is just a draft. For now, when the enemy touches me, it will stop moving. Therefore, I can know when I die, but the game will not end. I can still continue to test the game without starting the game again.
Event tick means event called every frame, if ticking is enabled.
This is ref from the video and I think I will have something change to make the AI better. Therefore, I dont explain too much here.
For the first true part, it loops to follow the player. If the enemy does not chase the player, it will go back to its starting place. However, I can’t feel the function of this part because I don't know where they are when I am playing.
Comments