private void Form1_MouseClick(object sender, MouseEventArgs e) { if (!levelsDoc.currentLevel.hasClicked) { levelsDoc.currentLevel.hasClicked = true; bigBall = new BigBall(e.Location, Color.Black); bigBall.isSet = true; levelsDoc.currentLevel.bigBall = bigBall; levelsDoc.currentLevel.bigBall.increaseRadius(); } Invalidate(true); }
/*public void DrawFirst(Graphics g) * { * Brush b = new SolidBrush(Color.Black); * g.FillEllipse(b, Center.X - radius, Center.Y - radius, radius * 2, radius * 2); * b.Dispose(); * }*/ /*public bool isColliding(SmallBall ball) * { * double distance = (Center.X - ball.Center.X) * (Center.X - ball.Center.X) + (Center.Y - ball.Center.Y) * (Center.Y - ball.Center.Y); * bool smallBigImpact = this.bigBall && !ball.bigBall; //mora tekovnoto topce da bide golemo, a drugoto malo za da se dobijat poeni * return distance <= (radius + ball.radius) * (radius + ball.radius) && smallBigImpact; * } */ public bool isCollidingBig(BigBall bigBall) { if (bigBall != null) { double distanceBigBall = (Center.X - bigBall.Center.X) * (Center.X - bigBall.Center.X) + (Center.Y - bigBall.Center.Y) * (Center.Y - bigBall.Center.Y); return(distanceBigBall <= (radius + bigBall.RADIUS) * (radius + bigBall.RADIUS)); } else { return(false); } }