public async Task <PlayfieldState> CreatePlayfieldStateAsync(CreatePlayfieldState createPlayfieldState)
        {
            var playfieldState = new PlayfieldState(createPlayfieldState.State);

            playfieldState.GenerateBaseOptions();

            context.PlayfieldStates.Add(playfieldState);
            await context.SaveChangesAsync().ConfigureAwait(false);

            return(playfieldState);
        }
Exemplo n.º 2
0
    // Use this for initialization
    private void Start()
    {
        playfieldState        = GetComponent <PlayfieldState>();
        levelDesign           = GetComponent <LevelDesign>();
        musicSound            = GetComponent <AudioSource>();
        musicSound.volume     = Settings.musicVolume;
        gameOverSound.volume  = Settings.soundsVolume;
        countDownSound.volume = Settings.soundsVolume;
        MusicPlayer.DestroyInstance();

        if (!isRestored)
        {
            RandomGenerator();
            for (int i = 0; i < 3; i++)
            {
                GameObject tetrimino = generatedQueue.Dequeue();
                nextPieces.Add(Instantiate(tetrimino, nextPoints[i].position, Quaternion.identity));
            }
        }

        StartCoroutine(StartCountDown());
    }
Exemplo n.º 3
0
 private void Start()
 {
     playfield = PlayfieldState.instance;
     playGrid  = playfield.playGrid;
 }
Exemplo n.º 4
0
 private void Awake()
 {
     instance = this;
 }