Browse Source

Spawn water like mountain

but from bottom
DricomDragon 4 years ago
parent
commit
9f7c1c0a7c
1 changed files with 2 additions and 3 deletions
  1. 2 3
      main.cpp

+ 2 - 3
main.cpp

@@ -36,7 +36,6 @@ void drawWorld(float world[HEIGHT][WIDTH][BLOC_TOTAL], SDL_Surface* tileSet[], S
 
 			SDL_BlitSurface(tileSet[indexOfMax], NULL, out, &pos);
 		}
-
 }
 
 int main()
@@ -85,10 +84,10 @@ int main()
 				world[j][i][t] = 0.0f;
 
 	// Basic water
-	const int waterLevel = 0.01f;
+	const int waterLevel = 10.0f;
 	for (int j(0); j < HEIGHT; j++)
 		for (int i(0); i < WIDTH; i++)
-			world[j][i][WATER] = waterLevel;
+			world[j][i][WATER] = waterLevel / (HEIGHT - j);
 
 	// Top mountain line
 	const int mountainLevel = 10.0f;