Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WallManager: Use transition for wall and moles. #201

Open
bastianilso opened this issue Sep 21, 2022 · 5 comments
Open

WallManager: Use transition for wall and moles. #201

bastianilso opened this issue Sep 21, 2022 · 5 comments
Assignees

Comments

@bastianilso
Copy link

After the in-game count-down, wallmanager generates the Whack-A-Mole wall and shows it immediately. An aesthetic improvement would be to let this transition be more gradual.

  • It would be nice if a brief transition introduced the wall geometry.
  • It would be nice if moles quickly appeared one-by-one similar to the animation used in Trail it (see animation below).

In total this animation should take less than 500ms.

introduce-transition gif

@Xav1204
Copy link
Collaborator

Xav1204 commented Sep 26, 2022

@bastianilso I'm making my tests for the transition and his duration. I tried to find the place in the code where we can define the countdown time but I didn't find it. Can you tell me where I can change this time please.
Here a picture of the time that I want to change:
image

@bastianilso
Copy link
Author

@Xav1204 This is about transitioning the wall and the moles. Why do you need to change the countdown time? I don't recognize the screenshot you have taken a picture of, sorry.

The wall is generated by WallManager.cs in line 443 and the moles are generated in line 408.

For reference, the animation I show above from Trail it is created by the following function from GameLevel.cs:

    IEnumerator SpawnTargets(GameObject[] objsToSpawn)
    {
        float t = TargetSpawnDelay;

		spawnSound.Play();
        for (int i = 0; i < objsToSpawn.Length; i++)
        {
			if (objsToSpawn != null && objsToSpawn[i] != null)
			{
				objsToSpawn[i].GetComponent<Animator>().Play("TargetSpawn");
				objsToSpawn[i].SetActive(true);
			}
            yield return new WaitForSeconds(t);
        }

        yield return null;
    }

https://github.com/med-material/Trail-it/blob/master/Assets/Scripts/Game/GameLevel.cs#L417

For this task I suggest you check out IEnumerators and Unity animations. Hope this helps!

@Xav1204
Copy link
Collaborator

Xav1204 commented Sep 26, 2022

I don't need to change the cooldown, it just that I want to use this variable for the duration of the transition.

@bastianilso
Copy link
Author

@Xav1204 Ideally the transition happens after the countdown finishes (like shown in the animation from Trail it above). Is that what you mean? The count down is controlled by GameManager.cs, which emits a signal for every second passed. I'm not sure it is ideal for controlling the transition itself.

image

If you are trying to sync the transition to the countdown, I'm not sure how it would work. I do get the idea - that it would look cool if the "wall is building up" while the player is waiting those 3 seconds. But that's not what the 3 second countdown is for - the countdown is to prepare the player to get ready to play - ideally the wall is already built, so the player can focus on just getting ready. I think it's better to keep a separate duration (a 3 seconds for a transition might be too long, typically we aim to fade for shorter periods, e.g. 500ms or so).

Let me know if I misunderstood what you are trying to do. If I did, please elaborate in text, a bit more in depth what you are trying to do.

@Xav1204
Copy link
Collaborator

Xav1204 commented Sep 26, 2022

ok thanks. I will continue my tests for this transition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants