Search Unity

Architecture for simple 2D quiz style game

Discussion in 'Scripting' started by eco_bach, Sep 23, 2014.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    This is my very first Unity application, a very simple movie quiz game for a standalone kiosk style deploy
    There are 3 main 'sections'


    1 A landing screen when there is no user activity.

    2 The primary quiz section that works with speech input.

    3 The final 'game over' section or screen showing the players score and asking them if they want to play again.

    I've done dozens of these types of applications using Actionscript.

    My question is, how to make the most of Unity's strengths and weaknesses in creating something this simple.

    Should I have a different Scene for each section or create everything in a single scene and simply encapsulate each section in a different Game Object?

    What about code architecture?
    I was thinking of using a single Singleton 'Model' class to handle and keep track of my game state and current game score.

    What other classes would make sense?
    Being familiar with MVC I would normally create a different 'View' class for each of my 3 sections. Does this make the most sense in Unity?

    Thanks for any feedback!
     
  2. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    Should I have a different Scene for each section or create everything in a single scene and simply encapsulate each section in a different Game Object?
    I would separate them in different scenes and would use
    Code (csharp):
    1. Application.LoadLevelAdditive();
    If you want the game over section on top of the quiz, for instance.

    What about code architecture?
    Yes Singleton are great. Be careful not to used them for everything as this is a bad practice as it will eventually make your life harder in the end. Been there, done that...
    My rule is as follow: Singleton for managers ONLY, e.g. GameManager, AudioManager, ParticleManager, etc.

    What other classes would make sense?
    Being familiar with MVC I would normally create a different 'View' class for each of my 3 sections. Does this make the most sense in Unity?

    MVC is fine with Unity. Can't help you more on that, as I'm no MVC guru...

    Good luck! Make sure to use Prefabs ;)

    EDIT:

    Check this link: http://devmag.org.za/2012/07/12/50-tips-for-working-with-unity-best-practices/

    I found it of great help when I started.
     
    lasantha and eco_bach like this.