Name: Student !HXEkJ/9fP6 2010-05-20 19:44
I am in need of assistance and I'm not sure if /prog/ does this sort of thing, but I'm asking anyway.
I'm currently writing my Final Project for my Java course and it is a game, a relatively simple game. The issue I'm having is collision. The point of the game is to keep your square from being hit by circles, and in the early stages of writing it, I had a detection system based on the coordinates of the start of the rectangle, and the start of the circle, plus the width and height of each, using the g2d.fillRect(x,y,w,h) and the g2d.fillOval(x,y,w,h)m however, during the course of editing, this stopped working for whatever reason.
My question basically boils down to this:
Is there a way to using the pixel colors to detect collision, something like,
if(bluePixel touches greenPixel)
collision = true;
If this is not possible, then shit.
If so, please assist me.
I'm currently writing my Final Project for my Java course and it is a game, a relatively simple game. The issue I'm having is collision. The point of the game is to keep your square from being hit by circles, and in the early stages of writing it, I had a detection system based on the coordinates of the start of the rectangle, and the start of the circle, plus the width and height of each, using the g2d.fillRect(x,y,w,h) and the g2d.fillOval(x,y,w,h)m however, during the course of editing, this stopped working for whatever reason.
My question basically boils down to this:
Is there a way to using the pixel colors to detect collision, something like,
if(bluePixel touches greenPixel)
collision = true;
If this is not possible, then shit.
If so, please assist me.