Ejemplo n.º 1
0
        public bool TrySpawnBlock()
        {
            if (NextBlock == null)
            {
                NextBlock = CreateRandomBlock();
            }

            if (_levelPhysics.CheckOverlappingLevelBlocks(NextBlock.Position, NextBlock.Rotation, NextBlock.Shape))
            {
                return(false);
            }

            _blockStorage.AddBlock(NextBlock);
            NextBlock = CreateRandomBlock();
            OnNextBlockChange?.Invoke();
            OnBlockSpawned?.Invoke();

            return(true);
        }
Ejemplo n.º 2
0
 public void spawnNext()
 {
     spawner.spawnNext();
     OnBlockSpawned?.Invoke(spawner.getNext());
 }