escalier custom
This commit is contained in:
BIN
image/button_c.png
LFS
Normal file
BIN
image/button_c.png
LFS
Normal file
Binary file not shown.
BIN
image/wall2.png
LFS
BIN
image/wall2.png
LFS
Binary file not shown.
BIN
image/wall3.png
LFS
BIN
image/wall3.png
LFS
Binary file not shown.
@@ -17,6 +17,7 @@
|
|||||||
#define PLAYER_ON_TARGET 6
|
#define PLAYER_ON_TARGET 6
|
||||||
#define BUTTON 7
|
#define BUTTON 7
|
||||||
#define PLAYER_ON_BUTTON 8
|
#define PLAYER_ON_BUTTON 8
|
||||||
|
#define BUTTON_CUSTOM 9
|
||||||
|
|
||||||
typedef struct Vecteur
|
typedef struct Vecteur
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -95,9 +95,9 @@ void screenDisplayGameSDL (char **tab,vect dim_tab, dis *display_user, vect *pla
|
|||||||
break;
|
break;
|
||||||
case WALL:
|
case WALL:
|
||||||
srand(seed+i*15+j*13);
|
srand(seed+i*15+j*13);
|
||||||
int rand_int = rand() % 30;
|
rand_int = rand() % 6;
|
||||||
if(rand_int==26){img = IMG_Load ("image/wall3.png");}
|
if(rand_int==5){img = IMG_Load ("image/wall3.png");}
|
||||||
else if(rand_int==29){img = IMG_Load ("image/wall2.png");}
|
else if(rand_int==4){img = IMG_Load ("image/wall2.png");}
|
||||||
else{img = IMG_Load ("image/wall.png");}
|
else{img = IMG_Load ("image/wall.png");}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -122,6 +122,9 @@ void screenDisplayGameSDL (char **tab,vect dim_tab, dis *display_user, vect *pla
|
|||||||
case PLAYER_ON_BUTTON:
|
case PLAYER_ON_BUTTON:
|
||||||
img = IMG_Load("image/player_on_button.png");
|
img = IMG_Load("image/player_on_button.png");
|
||||||
break;
|
break;
|
||||||
|
case BUTTON_CUSTOM:
|
||||||
|
img = IMG_Load("image/button_c.png");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
texture
|
texture
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ char canIGoDirection (char valueOfNCase, char valueOfNPlusOneCase)
|
|||||||
// move the box but player on a target
|
// move the box but player on a target
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
if (valueOfNCase == BUTTON)
|
if (valueOfNCase == BUTTON || valueOfNCase == BUTTON_CUSTOM )
|
||||||
{
|
{
|
||||||
return 7;
|
return 7;
|
||||||
}
|
}
|
||||||
@@ -602,7 +602,7 @@ int inEditorLoop (char **tab2d, vect *dim_tab, vect *playerPos, vect *targets,
|
|||||||
direction.y = 0;
|
direction.y = 0;
|
||||||
break;
|
break;
|
||||||
case SDL_SCANCODE_RETURN:
|
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;
|
return indice_button;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ char ** generatorMenu(char *name_directory, vect *size, vect *pos_player)
|
|||||||
menu[4][i] = EMPTY;
|
menu[4][i] = EMPTY;
|
||||||
if (i == size->y-2)
|
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)
|
for (k = 1 ; k < 4; ++k)
|
||||||
{
|
{
|
||||||
if (k == 1)
|
if (k == 1 && j <16)
|
||||||
{
|
{
|
||||||
menu[k][j] = BUTTON;
|
menu[k][j] = BUTTON;
|
||||||
}
|
}
|
||||||
|
else if(k == 1)
|
||||||
|
{
|
||||||
|
menu[k][j] = BUTTON_CUSTOM;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
menu[k][j] = EMPTY;
|
menu[k][j] = EMPTY;
|
||||||
|
|||||||
Reference in New Issue
Block a user