const float largeurMin = 40;
const float largeurMax = 150;
+const float ventMax = 30;
+
const float largeurChateau = 8.5;
const float hauteurChateau = 7;
float hauteurMont;
float wnd;
-/* Retourne un nombre pseudo-aléatoire compris entre 0 et le paramètre
- * 'max' (exclus)
+/* Retourne un nombre pseudo-aléatoire compris entre le paramètre
+ * 'min' (inclus) et le paramètre 'max' (exclus)
*/
float frand(float min, float max)
{
float wtorY(const DrawingWindow& w, int wy)
{
- return -(rYMax - rYMin) * wy / (w.height - 1) - rYMax;
+ return -(rYMax - rYMin) * wy / (w.height - 1) + rYMax;
}
float hauteurMontagne(float largeur, float hauteur, float x)
{
largeurMont = frand(largeurMin, largeurMax);
hauteurMont = frand(hauteurMin, hauteurMax);
- wnd = frand(-30, 30);
+ wnd = frand(-ventMax, ventMax);
w.setBgColor("skyblue");
w.clearGraph();
dessineTerrain(w, largeurMont, hauteurMont);