DevLog: Week 4 - Movement System, Text System, and Quantum Mechanic
DevLog: Week 4 - Movement System, Text System, and Quantum Mechanic
This Week’s Focus
This week, I finished the new movement system for now. My focus shifted to the text system, which is almost done, and reworking the quantum mechanic to fit the new input and movement systems. This script is halfway done and has been challenging. I’m learning how to use IEnumerator (Coroutines) in Unity, which is tricky but necessary for this mechanic. I also started planning collectible items. In my game, you need to gather 4 objects to unlock the final area. I’m thinking of using a “GameManager” object to count these items and unlock the area when all are collected.
Goals for Last Week:
- Finish the new movement system.
- Work on the text prompt system.
- Start reworking the quantum mechanic.
Goals Achieved:
- Completed the new movement system.
- Almost perfected the text prompt system.
Scripts
ObjectPickup
RespawnManager
TextPromptSystem
In Action
- Started reworking the quantum mechanic to fit the new systems.
Goals for Next Week:
- Complete the quantum mechanic script using coroutines.
- Plan and start implementing collectible items with a “GameManager.”
- Plan Teleport system
Learning Goals:
- Learn more about using coroutines in Unity.
- Research best practices for managing game collectibles and triggers.
Observations:
The new movement system is flexible and supports various controllers. The text prompt system works well, but the quantum mechanic script is challenging due to coroutines. Planning for collectible items is underway.
Note:
Coroutines in Unity: Coroutines allow you to run code in parallel to other code, which is helpful for tasks that need to wait or run over multiple frames, like animations or timed events. Using IEnumerator
and yield return
statements, coroutines can make code cleaner and more efficient for specific tasks. For example, my coroutines are used to move the character smoothly to the wall when detected:
IEnumerator MoveToPosition(Vector3 target, float speed)
{
isMoving = true;
playerCollider.enabled = false;
movementController.enabled = false;
while (Vector3.Distance(transform.position, target) > 0.1f)
{
transform.position = Vector3.MoveTowards(transform.position, target, speed * Time.deltaTime);
yield return null;
}
transform.position = target;
isMoving = false;
}
GameManager: A GameManager is an empty object in Unity that manages game-wide systems and logic. For my game, the GameManager will track collectible items. When the player collects an item, it sends a signal to the GameManager, which counts the collected items. Once all items are collected, the GameManager will unlock the final area of the game. I will need to create two scripts: one for the pickable object to send the info that it was picked, and one for the GameManager to receive it and keep track of how many were picked.
End of DevLog Week 4.
Get HACKTAIL: The Digital Frontier
HACKTAIL: The Digital Frontier
Embark on a journey with Yuki, a pine marten navigating through a digital world in "Hacktail".
Status | Released |
Author | Jonarella - KAOS |
Genre | Platformer, Action |
Tags | 3D, Indie |
More posts
- DevLog: Week 3 - New Movement System and Text Prompt ScriptMay 23, 2024
- GDM LinkApr 10, 2024
- GDD LinkApr 10, 2024
- DevLog: Week 2 - Quantum Tunneling Mechanic DevelopmentApr 10, 2024
- DevLog Week 1 - Character Movement and Camera DynamicsApr 10, 2024
Leave a comment
Log in with itch.io to leave a comment.