youvsvirus / youvsvirus-unity

Unity version of the you vs virus game.
GNU General Public License v3.0
1 stars 1 forks source link

Levelmasks: make a prefab out of the player house so that the player can still get in and out #113

Closed maccxs closed 4 years ago

holke commented 4 years ago

On the levelmask branch i started this by making a prefab of the house. However, the player cannot get in or out yet.

As I imagine this to work:

maccxs commented 4 years ago

I think the merge request does this. There is some commented code at the end that can be used to end the level depending on your end game conditions. In my case this was only "endlevel.NotifyPlayerAtHome" which ends the game but it can be something different of course, could also be handled in further function. In that case StartCoroutine(SetPlayerOutOfHouse(p)); would not be called and instead one that ends the level. I used the space key so that the player gets inside/ouside house since I already used that in my level. I think it is good that the user has to press a key to get inside otherwise this might happen on accident. But this has to be explained somewhere (e.g. in the start screen)? Also if we do not use a key to enter and the player is set outside near the trigger, he just gets set inside again. This was a nice morning activity. Thank you.