Skip to content
Snippets Groups Projects
Commit c261456c authored by antoinemeyer5's avatar antoinemeyer5
Browse files

gestion aleatoire chute balle avant fonctione taha

parent 6664f481
No related branches found
No related tags found
No related merge requests found
...@@ -75,11 +75,17 @@ void hitBall() ...@@ -75,11 +75,17 @@ void hitBall()
{ {
freeIntList(landingPoint); freeIntList(landingPoint);
freeIntList(lastHitPoint); freeIntList(lastHitPoint);
int rx, ry; int rxMur, ryMur;
float distance; int rxFilet, ryFilet;
castSingleRay(&distance, &rx, &ry); float distanceMur;
printf("ray: %d %d\n", rx/BLOCK_SIZE, ry/BLOCK_SIZE); float distanceFilet;
printf("distance: %f\n", distance/BLOCK_SIZE); castSingleRay(&distanceMur, &distanceFilet, &rxMur, &ryMur, &rxFilet, &ryFilet);
printf("ray: x=%d y=%d\n", rx/BLOCK_SIZE, ry/BLOCK_SIZE);
printf("distance entre joueur et mur: %f\n", distanceMur/BLOCK_SIZE);
printf("distance entre joueur et filet : %f\n", distanceFilet/BLOCK_SIZE);
printf("distance entre le filet et le mur : %f", distanceMur - distanceFilet);
//tirer une valeur avec generateLandingPoint() entre distanceFilet et distanceFilet + distance entre filet et mur;
lastHitPoint = allocLastHitPoint(); lastHitPoint = allocLastHitPoint();
landingPoint = generateLandingPoint(); landingPoint = generateLandingPoint();
lastHitPoint[0] = ball.x; lastHitPoint[0] = ball.x;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment