The functions seems to not work in my program.
I post some screenshots and the code:
SMaterial grp_ball_collision; //Sprite for the collision of the ball (the ball is a Tanim)
grp_ball_collision.Texture1 = driver->getTexture("graphics/ball_collision.bmp");
driver->makeColorKeyTexture(grp_ball_collision.Texture1,position2d<s32>(1,1));
TAnimImage* grp_player_head_stand_n = new TAnimImage(driver);
TAnimImage* grp_player_head_stand_ne = new TAnimImage(driver);
grp_player_head_stand_ne->Load(add_head,PLAYER_W*1,PLAYER_H*0,PLAYER_W*1,PLAYER_H*1,PLAYER_W*1,PLAYER_H*1);
grp_player_head_stand_ne->setSpeed(70);
//This is the code for loading head of the player in Nord-Est direction. Of course in my program there are 8 of them (Nord; Nord-Est; Est; Sud-Est; ....) -> then the right image become the grp_actual_player_head (that is in the collision code)
//....
//....
//Code for the collision
if (CheckPixelCollide (grp_ball_collision , ball.pos_x , ball.pos_y , grp_actual_player_head, My_Player.pos_x , My_Player.pos_y) )
{
My_Player.possess_ball=true;
ball.possessed=true;
ball.shooted=false;
}
Screenshots:
As you can see the collision work in vertical positions:
1: now the player is extremely near the ball, but doesn't touch
2: Now he have touched with only one pixel the ball and he take possess of the ball
But see it:
1: the player is near the ball, but with some distance
2: The player come forward the ball and...He doesn't touch it but it take possess of the ball!!!!
There is also the sprites of the ball_collision and of the player head
![Image](http://img489.imageshack.us/img489/5014/head2pp.th.png)