Exemple #1
0
 public void newGame()
 {
     Points.resetPoints();
     managerBlocks.removeAllBlocks();
     controllerSettings.SetActive(false);
     managerArena.resetArena();
     nextBlock.randNew();
     Level.reset();
     endGame.gameObject.SetActive(false);
 }
Exemple #2
0
    public void pushBlock()
    {
        if (!startTile.GetComponent <ArenaTile>().isEmpty)
        {
            endGame.activate(Points.getPoints());                                               //Game lost condition
        }
        else
        {
            GameObject buffer = Instantiate(nextBlock.getBlock()) as GameObject;
            buffer.transform.SetParent(transform);
            buffer.transform.SetAsLastSibling();
            buffer.transform.localScale    = new Vector3(1, 1, 1);
            buffer.transform.localPosition = startTile.transform.localPosition;

            buffer.GetComponent <Block>().enabled = true;
            buffer.GetComponent <Block>().setSpeed(fallTimer - Level.getSpeedChange(), moveDownMultiplier);
            nextBlock.randNew();
        }
    }