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

remplir les seaux

parent cc2f6795
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,12 @@ void manageGame(){
continue;
case SDL_MOUSEBUTTONDOWN:
//clic on water
if(2 == map[mousePosition.y][mousePosition.x]){
fillWater(mousePosition.x, mousePosition.y);
}else{
pourWater(mousePosition.x, mousePosition.y);
}
break;
default:
......
......@@ -161,4 +161,10 @@ void pourWater(int x, int y){
}
}
void fillWater(int x, int y){
if(player.currentWater<player.waterMax && selectStateHover() == 1){
player.currentWater = player.currentWater + 1;
}
}
......@@ -26,5 +26,7 @@ void initPlayer();
void manageMovement();
int selectStateHover();
void pourWater(int, int);
void fillWater(int, int);
int giveCaseBelowPosition(int, int);
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment