GAMEOVER/RETRY LEVEL Function (Please Help Me Improve It)
JoshKahane
Member Posts: 470
Hi
So, for my game, to add a retry level function and detect which level it has to change to when pressing the retry level button on my game over scene I make an attribute for example called Level4Retry.
Whenever my actor collides with another actor in level 4 which is meant to cause a game over it make the above attribute true. Then on my Retry Level actor (button) it has a rule for each level saying if this is true, change scene. In this example, it would change to level 4.
Only I have an issue that sometime these stay true after playing several levels in a row, for example I play level 8, and fail it once or twice but eventually complete it. Then I decide to go back to level 4 (or any level) to play it, but I fail at it and so I am given the opportunity on my Game Over scene to retry level. But of course because some of the attributes from earlier are still true, it takes me to the wrong level; the one I had played before.
I figured that if every time one of these attributes become true, the rest must revert to false, but I have 40 levels, so how can I do this without having to add a ridiculous amount of Change Attribute (one for every other level) to change all the others to false?
Hope that makes sense. A lot of information, but kind of makes sense I think.
So, for my game, to add a retry level function and detect which level it has to change to when pressing the retry level button on my game over scene I make an attribute for example called Level4Retry.
Whenever my actor collides with another actor in level 4 which is meant to cause a game over it make the above attribute true. Then on my Retry Level actor (button) it has a rule for each level saying if this is true, change scene. In this example, it would change to level 4.
Only I have an issue that sometime these stay true after playing several levels in a row, for example I play level 8, and fail it once or twice but eventually complete it. Then I decide to go back to level 4 (or any level) to play it, but I fail at it and so I am given the opportunity on my Game Over scene to retry level. But of course because some of the attributes from earlier are still true, it takes me to the wrong level; the one I had played before.
I figured that if every time one of these attributes become true, the rest must revert to false, but I have 40 levels, so how can I do this without having to add a ridiculous amount of Change Attribute (one for every other level) to change all the others to false?
Hope that makes sense. A lot of information, but kind of makes sense I think.
Comments
Also, if they are individual I imagine just adding a scene reset would be easier yes?