Ejemplo n.º 1
0
    /// <summary>
    /// get the sprite according to its bubble type
    /// </summary>
    /// <returns>The bubble sprite.</returns>
    /// <param name="type">Type.</param>
    private Sprite getBubbleSprite(Bubble.Type type)
    {
        switch (type)
        {
        case Bubble.Type.Color1:
            return(_bubble_1);

        case Bubble.Type.Color2:
            return(_bubble_2);

        case Bubble.Type.Color3:
            return(_bubble_3);

        case Bubble.Type.Color4:
            return(_bubble_4);

        case Bubble.Type.Color5:
            return(_bubble_5);

        case Bubble.Type.Color6:
            return(_bubble_6);

        case Bubble.Type.Color7:
            return(_bubble_7);

        case Bubble.Type.Color8:
            return(_bubble_8);
        }

        return(_bubble_1);
    }
Ejemplo n.º 2
0
	public BubbleModel(int tileI, int tileJ){
		this.tileI = tileI;
		this.tileJ = tileJ;
		blinkingTilesI = new int[10];
		blinkingTilesJ = new int[10];
		currentBlinkingTile = 0;
		bubbleType = Bubble.Type.None;
	}
Ejemplo n.º 3
0
    private Bubble GetOneBubbleAtPosition(Vector3 position, Bubble.Type type = Bubble.Type.None)
    {
        var go = Instantiate(ball, position, Quaternion.identity) as GameObject;


        SpriteRenderer render = go.GetComponent <SpriteRenderer>();

        render.sprite = getBubbleSprite(type);

        Bubble bubble = go.GetComponent <Bubble>();

        bubble.type = type;

        return(bubble);
    }
    public void BubbleAdded(Bubble b)
    {
        currBubbles.Add(b);
        currTypes |= b.bubbleType;

        switch (b.bubbleType)
        {
        case Bubble.Type.Blue: stats.blue++; if (!validBubbles.Contains(bubbles[0]))
            {
                validBubbles.Add(bubbles[0]);
            }
            break;

        case Bubble.Type.Green: stats.green++; if (!validBubbles.Contains(bubbles[1]))
            {
                validBubbles.Add(bubbles[1]);
            }
            break;

        case Bubble.Type.Purple: stats.purple++; if (!validBubbles.Contains(bubbles[2]))
            {
                validBubbles.Add(bubbles[2]);
            }
            break;

        case Bubble.Type.Red: stats.red++; if (!validBubbles.Contains(bubbles[3]))
            {
                validBubbles.Add(bubbles[3]);
            }
            break;

        case Bubble.Type.Yellow: stats.yellow++; if (!validBubbles.Contains(bubbles[4]))
            {
                validBubbles.Add(bubbles[4]);
            }
            break;
        }

        stats.total++;
    }