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); }
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); }