Hi folks
So I'm developing a small game for a homework question. I have 3 classes. Apart from the main class, my drawing class draws on screen the objects for my game, like so..
public void bat(Graphics g)
{
//draw the bat
g.setColor(Color.ORANGE);
g.fillRect(batX, batY, breadth, batLength);
g.getClipBounds();
}
public void ball(Graphics g)
{
g.setColor(Color.yellow);
g.fillOval(ballX, ballY ,50,50);
g.getClipBounds();
}
and in the class that does the actions I want to tell the objects bat and ball, if you collied I send the ball off in a different direction. I know this has to do with the intersection of the objects but not sure how to do this. Anyone any tips?
Thanks in advance.