Hi!
You guys won't get rid of me!I have some work to do with my game before it's done. I need to check if my piece hits the square. I don't want to mess around with anyone else's code. It will just become messy and i won't understand it.
I tested to do like this, just for a test, this is not all checks i'm gonna do, but it should work if my piece comes from the left and hits the square.
Why aint this working?Code://Check if there is a collision int check_coll( int sX, int sY, int pX, int pY ) { //Square's position int sXl = sX; int sXr = sX + 29; int sYl = sY; int sYr = sY + 29; //Piece's position int pXl = pX; int pXr = pX + 75; int pYl = pY; int pYr = pY + 148; if (sXl == pXr) { //Apply the square apply_surface( 400, 100, square, screen ); } }![]()



LinkBack URL
About LinkBacks
I have some work to do with my game before it's done. I need to check if my piece hits the square. I don't want to mess around with anyone else's code. It will just become messy and i won't understand it.



