Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

DAY 1 AND 2 CONTINUED

So, the player must free prisoners... but I dont have idea how to make the prisoners. I couldnt find any assets that I liked.

So this is the first version of the prisoners. And maybe the last.


The weird movement is generated by a Sin function

private void AnimatePrisoner()
{
    Vector3 temporalPosition = _prisoner.localPosition;
    temporalPosition.y = amplitude * Mathf.Sin(Time.time * frequency) + _verticalShift;
    _prisoner.localPosition = temporalPosition;
}

The prisoner has a collider and  when the player collides with it, the remaining prisoner count decreases.

private void OnTriggerEnter2D(Collider2D collision)
{
    if (collision.gameObject.CompareTag("Player"))
    {
        FreePrisoner();
    }
}

Now I should start to work on the level desing, at least the logical desing