Hey everyone,
Im creating a puyo puyo game,
At the moment i seem to be stuck, im trying to implement collision detection by checking if a particular point(s) is being occupied by a puyo or not.
If it is when the next puyo tries to fit into that same position it wont be able to due to another puyo being there "collision". So far ive specified two locations on my board and if they are not equal to null then when a puyo falls within those two points i have a print statement which displays "it works".
But after this the other puyo(s) fall like in "Tetris" and from here i have no idea where to go.
How i would check this new puyo against the puyo that has already fallen and now resides at the bottom of the board, and have it stop on top of it?
I appreciate any help and advice that anyone can provide. Here is the code i have so far:
CODE
// Check to see if the position located at p1 and p2 is holding a set of puyo's.
public boolean positionEmpty()
{
p1 = puyolist[0][11];
p2 = puyolist[1][11];
if((p1 != null) && (p2 != null)){
System.out.println("it works");
}
return true;
}
This post has been edited by Riz 01: 2 Nov, 2009 - 11:59 AM