escalier custom

This commit is contained in:
cyjullien1
2025-01-07 19:43:36 +01:00
parent 0c20e2ae20
commit d00f1a98a1
7 changed files with 22 additions and 11 deletions

BIN
image/button_c.png LFS Normal file

Binary file not shown.

BIN
image/wall2.png LFS

Binary file not shown.

BIN
image/wall3.png LFS

Binary file not shown.

View File

@@ -17,6 +17,7 @@
#define PLAYER_ON_TARGET 6
#define BUTTON 7
#define PLAYER_ON_BUTTON 8
#define BUTTON_CUSTOM 9
typedef struct Vecteur
{

View File

@@ -95,9 +95,9 @@ void screenDisplayGameSDL (char **tab,vect dim_tab, dis *display_user, vect *pla
break;
case WALL:
srand(seed+i*15+j*13);
int rand_int = rand() % 30;
if(rand_int==26){img = IMG_Load ("image/wall3.png");}
else if(rand_int==29){img = IMG_Load ("image/wall2.png");}
rand_int = rand() % 6;
if(rand_int==5){img = IMG_Load ("image/wall3.png");}
else if(rand_int==4){img = IMG_Load ("image/wall2.png");}
else{img = IMG_Load ("image/wall.png");}
break;
@@ -122,6 +122,9 @@ void screenDisplayGameSDL (char **tab,vect dim_tab, dis *display_user, vect *pla
case PLAYER_ON_BUTTON:
img = IMG_Load("image/player_on_button.png");
break;
case BUTTON_CUSTOM:
img = IMG_Load("image/button_c.png");
break;
}
texture

View File

@@ -117,7 +117,7 @@ char canIGoDirection (char valueOfNCase, char valueOfNPlusOneCase)
// move the box but player on a target
return 5;
}
if (valueOfNCase == BUTTON)
if (valueOfNCase == BUTTON || valueOfNCase == BUTTON_CUSTOM )
{
return 7;
}
@@ -602,7 +602,7 @@ int inEditorLoop (char **tab2d, vect *dim_tab, vect *playerPos, vect *targets,
direction.y = 0;
break;
case SDL_SCANCODE_RETURN:
if (tab2d[playerPos->x][playerPos->y] == PLAYER_ON_BUTTON)
if (tab2d[playerPos->x][playerPos->y] == PLAYER_ON_BUTTON )
return indice_button;
break;
default:

View File

@@ -114,7 +114,7 @@ char ** generatorMenu(char *name_directory, vect *size, vect *pos_player)
menu[4][i] = EMPTY;
if (i == size->y-2)
{
menu[4][i] = BUTTON;
menu[4][i] = BUTTON_CUSTOM;
}
}
@@ -125,10 +125,14 @@ char ** generatorMenu(char *name_directory, vect *size, vect *pos_player)
for (k = 1 ; k < 4; ++k)
{
if (k == 1)
if (k == 1 && j <16)
{
menu[k][j] = BUTTON;
}
else if(k == 1)
{
menu[k][j] = BUTTON_CUSTOM;
}
else
{
menu[k][j] = EMPTY;