Game Development-Task 3
INSTRUCTIONS
Task 3
In previous task, we have done the design for the game assets. In this task, we given the task to create the prototype of the game.
This includes :
- Coding movements and actions
- Coding obstacles and enemies’ interactions
- Coding game levels (Logic of the game)
I will show my game mechanics of level 1 and level 2 in this task, which my third level is the combination of this two.
Level 1
In level 1, players are tasked with limited energy challenge to break as many rocks as possible to collect valuable diamonds. The scene is filled with rocks that players must break using their tools. In my proposal, I introduced the mechanism of this level, which is to complete the game within a limited time instead of within a limited stamina. I think the switch to limited stamina will make it more challenging and more logical.
Player Movement
This is my level 1 player movement animation script (I have a different player script in level 2, because this script when player enter trigger area with box collider 2D component, the player speed become very slow.) I apply the idle, walk and jump animation in level 1.
Energy Bar & Diamond Counter
I created a energy bar for the player, it will decrease when player breaking the rock, so breaking the rocks and reduce energy key is the same, using "X" on keyboard. I search for few tutorials video from Youtube to create this two UI.
https://youtu.be/BLfNP4Sc_iA?si=wrn0hXboCgxd_n9-
https://youtu.be/rD3orKDCM50?si=-_ateJTP-Xxe2v4_
Get Diamond
When hit on "X" key inside the rock trigger (which is where closing to the rock), the rock animation will plays, and the diamond appears, the energy bar decrease and diamond counter +1 at the same time.
Add Energy
Door
As what we learn in class, I set the door will only can open if the diamond is collected more than 4.
Level 2
Player Movement
This is the player movement script for level 2. I did not include the walk and jump animation in it, because I'm focusing on solving the player getting slow when enter the trigger area. Luckily, using this code doesn't happen the issue (but having problem to include the jump animation arghhhhhhhh, I can solve it :) !!!).
Enemy Path
I used 2 ways to add the path, one is the enemy will follow the exactly path where the player move, another one is the enemy just wandering in fixed position.
Path 1
https://youtu.be/jvtFUfJ6CP8?si=FcM_67EkC6_29xfP
I search for a tutorial that make the enemy follow the player move. I download an AI pathfinder file and can install it easily to the enemy and it can follow where the player go.
This is using the Pathfinder component to detect the ground, it makes the enemy bypass or not allow to cross the ground.
The second movement is enemy just moving between the fixed point. I set 3 points for the enemy in this GIF, so the enemy just repeating to move between this points.
Stamina Bar
Same code with the energy bar script, but using fixed mode for the gradient.
Collectible Live
What's done
- Player movement speed/action/anim
- Enemy attack
- Collectible item/appears after player make an action
- Energy bar, Stamina bar, diamond counter
What's yet to be done
- Starting page/Introduction page
- Game over page/Successful page
- Sound effect/background music
- Virtual camera change between different action
- Player attack/breaking rock's anim
























Comments
Post a Comment