collision with fillOval

Started by
12 comments, last by ChristianFrantz 11 years, 8 months ago
Yes. Loop through balls.size().

Here's a picture of what you're doing for collision detection.
20120812163527.jpg
Advertisement
i currently have this
[source lang="java"] public Rectangle getFixedBallBounds()
{
return new Rectangle (250, 250, 20, 20);
}


public Rectangle getMainBallBounds()
{
return new Rectangle(mainBall.xpos, mainBall.ypos, 10, 10);
}


public boolean checkCollision()
{
if(mainBallRectangle.intersects(fixedBallRectangle))
{
mainBall.xspeed = 0;
mainBall.yspeed = 0;
mainBall.xpos = 100;
mainBall.ypos = 100;
}
return true;
}[/source]
but it does nothing

If you see a post from me, you can safely assume its C# and XNA :)

Rectangle constructs a rectangle whose upper-left is at the specified x and y coordinates and width and height extend from there. Make sure those are in the proper positions.

Any special reason you're using a boolean function that always returns true?
Not really i thought that this method returned a boolean value for some reason

If you see a post from me, you can safely assume its C# and XNA :)

This topic is closed to new replies.

Advertisement