CGDD W2: Fake Game

A. Playing Demo

The inspiration of this game:https://www.bilibili.com/video/BV1Cu41197dZ/?spm_id_from=333.337.search-card.all.click&vd_source=1b16d263d8bc90f438faabdc3eec7cf9

B. Developing Process:

1. Check the game flow:

The players should be able to get points to win the game. If the points earned can’t meet a certain amount when reaching the destination, they’ll lose the game.

2. Define important variables

In this game, the most important variable is objectCount, which stores the amount of blocks the player has got. It is linked to the UI text on the top left corner to show the current point, and determines the hight of the blocks the player controls.

To check whether the player has won the game or not, I defined winStatus to check whether the cubes have reached the star. If the collider on the star has detected objects with tag “followingObject”, winStatus will be set to 1. Once this public static is set to 1, the UI will show “YOU WIN” and end this game. If the cube has reached the end of this game (which is the long block) and winStatus is not 1 at that time, another variable named loseStatus will be set to 1, and the UI will show “YOU LOSE” and end the game.

3. Write scripts and attach scripts

Finisher is linked to the star
FollowPlayer is linked to the blocks
Lose is linked to the certain long block in the end
LoseStatus, UIController and Winstatus care linked to the UI texts
PlayerController is linked to the player (the cube that is under control)
 
C. Achievements and Challenges
Achievements:
I learned to use colliders, rigidbody and use certain tags to trigger specific incidents. I also learn to get public variables from other scripts, how to automatically end the game after winning/losing.
Challenges:
The different variables and functions in Unity is confusing to a starter like me. When I began to write the scripts, I was confused with vectors (like Vector3) and scalars (like int). Many errors was caused by this misunderstanding. Also, it is important to learn the difference between update functions and other conditional functions, which might lead to mistakes in storing values.
If there was more time, I would like to try to add some obstacles (which will decrease the score) and add some sound effects when the player hits a block or an obstacle to make the game experience more diverse and interesting. I may also switch between scenes to make more levels in the game for the players to challenge.

Leave a Reply

Your email address will not be published. Required fields are marked *