top of page

15/10/20 - Scene transition & Singleton

Portfolio_Peice_10.JPG
Portfolio_Peice_11.JPG

I was working on a scene manager that would keep a record of where the player was and which scene the player needed to move to next. Things seemed fine, until I realized the every time the current scene was being reloaded, when the player died a new scene manager appeared. The fix for this, was a 'Singleton' class (code that ensures there is only one version in the entire game), which would ensure that only one scene manager existed and that it is the one you got from the beginning. This fix worked perfectly.

bottom of page