Overview

Magnet Agent’s gameplay is a 2D puzzle game based on Physics and Magnetic interaction.

The player controls Magnet Boy who interacts with other magnets in the environment using his magnetic powers. For example, when he touches a magnet with the same polarity, he is repelled and bounces into the air; when he touches one with the opposite polarity, he is attracted toward it.

Players do not control the magnet man directly. Instead, they must strategically place magnets in the scene to guide him safely to the destination.

https://drive.google.com/file/d/1s0VR2wAQBo5k56xSiJCQIrIO9LBYQ8iS/view?usp=sharing

There are four modules included in the core gameplay system:

Character

protected bool CheckIsGrounded()
{
    if (_movement.IsGrounded())
    {
        return true;
    }
    return false;
}

private bool CheckTrap()
{
    return Physics2D.OverlapCircle(_center.position, 0.5f, _settings.trapLayer);
}

private bool CheckInteractable(out IInteractable obj)
{
    var hit = Physics2D.OverlapCircle(_center.position, 0.3f, _interactableLayer);

    if (hit)
    {
        obj = hit.GetComponent<IInteractable>();
        if (obj != null)
        {
            return true;
        }
    }
    obj = null;
    return false;
}

Interaction

Level Flow Management

GameController.cs