public static GameModeLogic createGameModeLogic(GameHandlerScript gameMaster, LevelRecord level)
    {
        GameModeLogic newGameModeLogic;

        switch (level.getLevelType())
        {
            case LevelRecord.LevelType.NORMAL:
                newGameModeLogic = new NormalDiamondGameModeLogic(gameMaster);
                break;
            case LevelRecord.LevelType.STRESS:
                newGameModeLogic = new NormalDiamondGameModeLogic(gameMaster);
                break;
            case LevelRecord.LevelType.BOSS:
                newGameModeLogic = new NormalDiamondGameModeLogic(gameMaster);
                break;
            case LevelRecord.LevelType.STRESSBOSS:
                newGameModeLogic = new NormalDiamondGameModeLogic(gameMaster);
                break;
            default:
                newGameModeLogic = new NormalDiamondGameModeLogic(gameMaster);
                break;
        }

        return newGameModeLogic;
    }
    public StressDiamondGameModeLogic(GameHandlerScript gameMaster)
    {
        this.gameMaster = (DiamondMasterScript) gameMaster;
        this.level = gameMaster.getCurrentLevelRecord();

        this.gameMaster.CollectedDiamondCountChanged += onDiamondCollected;
    }
    public NormalDiamondGameModeLogic(GameHandlerScript gameMaster)
    {
        this.gameMaster = (DiamondMasterScript)gameMaster;
        this.level = gameMaster.getCurrentLevelRecord();

        gameMaster.setGameTimeLeft(level.timeToSecondReward);
    }
    public void setCurrentGameMaster(GameHandlerScript master)
    {
        this.gameMaster = master;

        if(LevelConfigurationFinished != null)
        {
            LevelConfigurationFinished();
        }
    }
Exemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        GameObject gridObject = GameObject.FindWithTag("Grid");

        grid = gridObject.GetComponent <Grid>();

        GameObject gameHandleObject = GameObject.FindWithTag("GameHandler");

        gameHandler = gameHandleObject.GetComponent <GameHandlerScript>();
    }
Exemplo n.º 6
0
    //-----------------------------------------------------COLLISION FUNCTIONS---------------------------------------------------------------------------------

    virtual public void Land()
    {
        isInAir = false;

        GameObject        handler = GameObject.FindGameObjectWithTag("GameHandler");
        GameHandlerScript hand    = handler.GetComponent <GameHandlerScript>();

        hand.BlockLanded();
        hand.spawner.shooting = false;
    }
Exemplo n.º 7
0
    // Use this for initialization
    void Awake()
    {
        GameObject go = GameObject.FindGameObjectWithTag("StoryHandler");

        story     = go.GetComponent <GameHandlerScript> ();
        text      = GetComponent <TextMesh> ();
        box       = GetComponent <BoxCollider2D> ();
        storyText = text.text;
        init();
    }
Exemplo n.º 8
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Exemplo n.º 9
0
    override public void Land()
    {
        isInAir = false;

        enabled = false;


        handler = GameObject.FindGameObjectWithTag("GameHandler");
        GameHandlerScript hand = handler.GetComponent <GameHandlerScript>();

        hand.BlockLanded();
        hand.spawner.shooting = false;

        grid.AddBlockToGrid(this);
        blockPos = grid.FindGridPosition(this);
        int x, y;

        x = (int)(blockPos.x);
        y = (int)(blockPos.y);
        SpecialTrigger(x, y);
    }