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

image.png

ObjectPickup

image.png

RespawnManager

image.png

TextPromptSystem

image.png

In Action

image.png

  • 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

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.