Since the Game Status becomes Singleton, how can we set pointsPerBlockDestroyed differently in each scene?
Should I take the pointsPerBlockDestroyed from Game Status and put it into another set of gameObject and script?
Since the Game Status becomes Singleton, how can we set pointsPerBlockDestroyed differently in each scene?
Should I take the pointsPerBlockDestroyed from Game Status and put it into another set of gameObject and script?
Hi,
In your GameStatus object, you could check in which level you are and determine how much points each block is supposed to give.
However, it would probably make more sense to define the points in the Block object because the block provides the points.
That’s a design decision, though.
See also:
Thanks for suggestion.
I have tried two methods but failed.
Anyway, how should I excite your first suggestion about checking in which level? Should I get the Scene number as use conditional statement inside AddToScore() method?
Either the build index or the name of the scene. Check the Scene class in the API. It contains all the information you need. And then you create a bunch of if-statements or a switch to define what is supposed to happen in specific scenes.
I used conditional statement with scene build index to determine PointsPerBlockDestoryed, everything works fine, and the process reinforced my learning. Thank you so much!
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.