Esempio n. 1
0
        public BubbleSet(BubbleSetType type, Dictionary<BubbleState, Texture2D> textureList, Texture2D lineTexture, EffectHandler effectHandler, Vector2 pos1, Vector2 pos2)
        {
            this.type = type;
            this.currentState = BubbleSetState.APPEARING;
            this.handTextureList = textureList;
            this.lineTexture = lineTexture;
            this.lineAlpha = GameConfig.LINE_ALPHA;
            this.effectHandler = effectHandler;

            bubbles = new List<Bubble>();

            switch (type)
            {
                case BubbleSetType.HANDHAND:
                    Vector2 randomPoint = Randomizer.createRandomPoint();

                    //create first hand bubble
                    Bubble bubble1 = new Bubble(pos1.X, pos1.Y, handTextureList, BubbleType.HAND);
                    bubble1.setStayingDuration(GameConfig.SETBUBBLE_DURATION);
                    bubbles.Add(bubble1);

                    //create second hand bubble
                    Bubble bubble2 = new Bubble(pos2.X, pos2.Y, handTextureList, BubbleType.HAND);
                    bubble2.setStayingDuration(GameConfig.SETBUBBLE_DURATION);
                    bubbles.Add(bubble2);

                    lineRotation = (float)Math.Atan2(bubble2.yPos - bubble1.yPos, bubble2.xPos - bubble1.xPos);
                    scaleX = (float)(Math.Sqrt((Math.Pow(bubble2.xPos - bubble1.xPos, 2) + Math.Pow(bubble2.yPos - bubble1.yPos, 2))) / GameConfig.BUBBLE_WIDTH);
                    scaleVector = new Vector2(scaleX, 1.0f);
                    break;

            }
        }
Esempio n. 2
0
        public DragBubble(DragBubbleType type, Dictionary<BubbleState, Texture2D> textureList, Texture2D lineTexture, EffectHandler effectHandler, Vector2 pos1, Vector2 pos2)
        {
            this.type = type;
            this.currentState = DragBubbleState.APPEARING;
            this.handTextureList = textureList;
            this.lineTexture = lineTexture;
            this.lineAlpha = GameConfig.LINE_ALPHA;
            this.lockCount = GameConfig.LOCK_COUNT;
            this.popCount = GameConfig.DRAG_BUBBLE_POPCOUNT;
            this.effectHandler = effectHandler;

            //create first hand bubble
            bubble1 = new Bubble(pos1.X, pos1.Y, handTextureList, BubbleType.HAND);
            bubble1.setStayingDuration(GameConfig.DRAGBUBBLE_DURATION);

            //create second hand bubble
            bubble2 = new Bubble((int)pos2.X, pos2.Y, handTextureList, BubbleType.INACTIVE_STATIC_HAND);
            bubble2.setStayingDuration(GameConfig.DRAGBUBBLE_DURATION);

            radianAngle = MathUtil.getPIAngle(bubble1.pos, bubble2.pos);
            float width = MathUtil.getDistance(bubble1.pos, bubble2.pos);
            lineRectangle = new Rectangle(0, 0, (int)width, 13);

            xSpeedUnit = (float)Math.Cos(radianAngle);
            ySpeedUnit = (float)Math.Sin(radianAngle);
        }
Esempio n. 3
0
 public BubbleSet(BubbleSetType type, Dictionary<BubbleState, Texture2D> textureList, Texture2D lineTexture, EffectHandler effectHandler)
 {
     this.type = type;
     this.currentState = BubbleSetState.APPEARING;
     this.handTextureList = textureList;
     this.lineTexture = lineTexture;
     this.lineAlpha = GameConfig.LINE_ALPHA;
     this.effectHandler = effectHandler;
     createSet();
 }
Esempio n. 4
0
        public DragBubble(DragBubbleType type, Dictionary<BubbleState, Texture2D> textureList, Texture2D lineTexture, EffectHandler effectHandler, float minDistance = 50)
        {
            this.type = type;
            this.currentState = DragBubbleState.APPEARING;
            this.handTextureList = textureList;
            this.lineTexture = lineTexture;
            this.lineAlpha = GameConfig.LINE_ALPHA;
            this.lockCount = GameConfig.LOCK_COUNT;
            this.popCount = GameConfig.DRAG_BUBBLE_POPCOUNT;
            this.effectHandler = effectHandler;

            createSet(minDistance);
        }
Esempio n. 5
0
        public void Init()
        {
            bubblesOnScreen = new List<Bubble>();
            bubbleSetsOnScreen = new List<BubbleSet>();
            dragBubblesOnScreen = new List<DragBubble>();

            //interval between most recently added bubble to the next bubble
            this.bubbleSetInterval = GameConfig.BUBBLE_SET_INTERVAL;
            this.bubbleInterval = GameConfig.SOLO_BUBBLE_INTERVAL;
            this.dragBubbleInterval = GameConfig.DRAG_BUBBLE_INTERVAL;

            this.gameMode = GameSequentialSolo.SOLO_BUBBLES;

            this.soloBubblesToPop = GameConfig.SOLO_BUBBLES_TO_POP;
            this.dragBubblesToPop = GameConfig.DRAG_BUBBLES_TO_POP;
            this.setBubblesToPop = GameConfig.BUBBLE_SETS_TO_POP;

            bubbleCtr = GameConfig.SOLO_BUBBLE_INTERVAL;
            bubbleSetCtr = GameConfig.BUBBLE_SET_INTERVAL;
            dragBubbleCtr = GameConfig.DRAG_BUBBLE_INTERVAL;

            this.effectHandler = new EffectHandler();
            this.usingMouseAsInput = true;

            this.currentGame = TAPGame.SEQUENTIAL_MIXED;

            myUI = new MyUI();

            this.currentState = StageScreenStates.PREPARING;
        }