- Home /
Unity game level design patterns
Let's say you're developing a Krazy Tennis game. Each level has a different court, different racquets and balls, different physics, etc.
Each level needs a set of control routines that are identical to most or all of the other levels, like updating the score, but other routines are unique to one or just a few levels, such as the routines that handle physics or enemy behavior.
I know I can create a scene for each level and attach scripts, prefabs, etc to each scene.
What I'm asking for is opinions about the best practice to promote things like code re-use.
I can imagine a Level class that defines the common interface for levels and implements the functionality that is common to all levels. Then each level's particular script would be a custom class that inherits from the Level class and customizes the implementation.
Does that make sense? And can it be done well in Unity's javascript implementation or should I really be thinking about c# at this point?
Your answer
Follow this Question
Related Questions
Online levels database 0 Answers
Deleted a scene, cannot create new one 1 Answer
Size increasing everytime i add new level in seperate scenes 1 Answer
Fade In each level 1 Answer
Should i invest in level prefabs instead of scenes? 3 Answers