X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/graphlib.git/blobdiff_plain/c97d3f98f912c1dbaadf8309a983915d5c5d721e..3a4a595abe5221de96e80e7e926c055c47e98fb9:/chateaux/chateaux.cpp diff --git a/chateaux/chateaux.cpp b/chateaux/chateaux.cpp index c5bb60f..ee53fdb 100644 --- a/chateaux/chateaux.cpp +++ b/chateaux/chateaux.cpp @@ -166,7 +166,7 @@ void dessineExplosion(DrawingWindow& w, float rx, float ry) w.drawCircle(x, y, i); w.msleep(20); } - w.setColor("white"); + w.setColor("skyblue"); for (i = 0; i < maxray; i++) { w.drawCircle(x, y, i); w.msleep(10); @@ -201,7 +201,7 @@ void initialise(DrawingWindow& w) largeurMont = frand(largeurMin, largeurMax); hauteurMont = frand(hauteurMin, hauteurMax); wnd = frand(-30, 30); - w.setBgColor("white"); + w.setBgColor("skyblue"); w.clearGraph(); dessineTerrain(w, largeurMont, hauteurMont); dessineChateau(w, positionChateau1); @@ -241,7 +241,7 @@ int tir(DrawingWindow& w, vy += ay * dt; w.msleep(10); - w.setColor("white"); + w.setColor("skyblue"); w.fillCircle(wx, wy, 2); // w.setColor("black"); // w.drawPoint(wx, wy); @@ -286,18 +286,18 @@ int jeu1(DrawingWindow& w) } else { alpha = frand(10, 90); v0 = frand(10, 100); - std::cout << " [ " << alpha << " ; " << v0 << " ]\n"; + std::cout << " [ " << (int )alpha << "° ; " << (int )v0 << " ]\n"; } alpha = deg2rad(alpha); float x0; if (joueur == 1) { - x0 = positionChateau1 + 8; + x0 = positionChateau1 + 0.8 * largeurChateau; } else { - x0 = positionChateau2 - 8; + x0 = positionChateau2 - 0.8 * largeurChateau; alpha = PI - alpha; } - float y0 = 8; + float y0 = hauteurChateau + 1; perdant = tir(w, x0, y0, v0, alpha, x, y); dessineExplosion(w, x, y); dessineVent(w, wnd);