예제 #1
0
    public void advanceBlockState()
    {
        switch (blockState)
        {
        case Level.SPRITE.HIDDEN:
        {
            blockState            = Level.SPRITE.QUESTION;
            spriteRenderer.sprite = Level.instance.sprites[Level.SPRITE.QUESTION];
        }
        break;

        case Level.SPRITE.QUESTION:
        {
            blockState            = Level.SPRITE.FLAG;
            spriteRenderer.sprite = Level.instance.sprites[Level.SPRITE.FLAG];
        }
        break;

        case Level.SPRITE.FLAG:
        {
            blockState            = Level.SPRITE.HIDDEN;
            spriteRenderer.sprite = Level.instance.sprites[Level.SPRITE.HIDDEN];
        }
        break;
        }
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     spriteRenderer = gameObject.GetComponent <SpriteRenderer>();
     isPlayable     = true;
     mineCount      = 0;
     hasMine        = false;
     blockState     = Level.SPRITE.HIDDEN;
 }
예제 #3
0
 //reveal mines count
 public void revealMineCount()
 {
     if (mineCount == 0)
     {
         spriteRenderer.sprite = Level.instance.sprites[Level.SPRITE.REVEALED];
     }
     else if (!hasMine)
     {
         Level.SPRITE spriteType = (Level.SPRITE)mineCount;
         spriteRenderer.sprite = Level.instance.sprites[spriteType];
     }
 }
예제 #4
0
 private void showLoseSprite()
 {
     if (hasMine)
     {
         spriteRenderer.sprite = Level.instance.sprites[Level.SPRITE.MINELOST];
     }
     else if (mineCount == 0)
     {
         spriteRenderer.sprite = Level.instance.sprites[Level.SPRITE.REVEALEDLOST];
     }
     else
     {
         Level.SPRITE spriteType = (Level.SPRITE)(40 + mineCount);
         spriteRenderer.sprite = Level.instance.sprites[spriteType];
     }
 }
예제 #5
0
 private void showPlaySprite()
 {
     if (hasMine)
     {
         spriteRenderer.sprite = Level.instance.sprites[Level.SPRITE.MINEWON];
     }
     else if (mineCount == 0)
     {
         spriteRenderer.sprite = Level.instance.sprites[Level.SPRITE.REVEALEDPLAY];
     }
     else
     {
         Level.SPRITE spriteType = (Level.SPRITE)mineCount;
         spriteRenderer.sprite = Level.instance.sprites[spriteType];
     }
 }