message menu + planes
This commit is contained in:
parent
74042d2c9e
commit
06ef441421
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 109 KiB |
|
@ -7,8 +7,16 @@
|
|||
|
||||
void display_background(const int background)
|
||||
{
|
||||
/**
|
||||
* 1 - map
|
||||
* 2 - navigation menu
|
||||
* 3 - info menu
|
||||
* 4 - grid
|
||||
* 5 - display message
|
||||
* 6 - upgrade menu
|
||||
**/
|
||||
extern const bopti_image_t img_bground;
|
||||
dsubimage(0, 0, &img_bground, 0, 65 * (background - 1), 128, 64, DIMAGE_NONE);
|
||||
dsubimage(0, 0, &img_bground, 0, 224 * (background - 1), 396, 224, DIMAGE_NONE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -116,7 +124,7 @@ void display_mutation(const int table[4][8], const struct cursor c, const int mu
|
|||
extern bopti_image_t img_cursor;
|
||||
|
||||
dclear(C_WHITE);
|
||||
display_background(5);
|
||||
display_background(4);
|
||||
for (int i = 0 ; i < 4 ; i++)
|
||||
{
|
||||
for (int j = 0 ; j < 8; j++)
|
||||
|
@ -140,7 +148,7 @@ void display_mutation_buy(const struct cursor c, const int mutation_menu, const
|
|||
|
||||
dclear(C_WHITE);
|
||||
|
||||
display_background(4);
|
||||
display_background(3);
|
||||
dsubimage(3, 21, &img_mutations, 16 * (mutation_menu - 1), 16 * (id - 1), 15, 15, DIMAGE_NONE);
|
||||
|
||||
dprint(47, 25, C_BLACK, mutation_data->name);
|
||||
|
@ -165,7 +173,7 @@ void display_mutation_description(const char *name, const char *description, con
|
|||
|
||||
dclear(C_WHITE);
|
||||
|
||||
display_background(8);
|
||||
display_background(6);
|
||||
dsubimage(3, 21, &img_mutations, 16 * (mutation_menu - 1), 16 * (id - 1), 15, 15, DIMAGE_NONE);
|
||||
dprint(47, 25, C_BLACK, name);
|
||||
|
||||
|
@ -189,10 +197,10 @@ void display_message(char *msg)
|
|||
int decalage = 0;
|
||||
|
||||
dclear(C_WHITE);
|
||||
display_background(7);
|
||||
display_background(5);
|
||||
for (int i = 0; i < 5; i ++)
|
||||
{
|
||||
dtext_opt(54, 6 * i + 4, C_BLACK, C_WHITE, 0, 0, msg + decalage, 11);
|
||||
dtext_opt(150, 6 * i + 4, C_BLACK, C_WHITE, 0, 0, msg + decalage, 11);
|
||||
|
||||
int offset = 0;
|
||||
while (msg[decalage + offset] != '\0') offset += 1;
|
||||
|
|
18
src/main.c
18
src/main.c
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Project name ......: Plague
|
||||
Version ...........: 1.3.9
|
||||
Last modification .: 8 June 2021
|
||||
Last modification .: 30 June 2021
|
||||
|
||||
code and assets provided with licence :
|
||||
GNU General Public Licence v3.0
|
||||
|
@ -39,11 +39,11 @@ int main(void)
|
|||
title_screen();
|
||||
|
||||
// Game statistics
|
||||
struct plane plane_1 = {22, 20, 2, 84, 20, 22, 20, 0};
|
||||
struct plane plane_2 = {34, 20, 3, 34, 44, 34, 20, 0};
|
||||
struct plane plane_3 = {68, 44, 1, 68, 20, 68, 44, 0};
|
||||
struct plane plane_4 = {104, 20, 3, 104, 50, 104, 20, 0};
|
||||
struct plane plane_5 = {68, 44, 4, 34, 44, 68, 44, 0};
|
||||
struct plane plane_1 = {81, 49, 2, 308, 49, 81, 49, 0};
|
||||
struct plane plane_2 = {115, 49, 3, 115, 119, 115, 49, 0};
|
||||
struct plane plane_3 = {224, 119, 1, 224, 49, 224, 119, 0};
|
||||
struct plane plane_4 = {224, 141, 2, 337, 141, 224, 141, 0};
|
||||
struct plane plane_5 = {224, 119, 4, 115, 119, 224, 119, 0};
|
||||
|
||||
|
||||
struct game current_game =
|
||||
|
@ -67,7 +67,7 @@ int main(void)
|
|||
|
||||
.planes = {&plane_1, &plane_2, &plane_3, &plane_4, &plane_5, NULL},
|
||||
|
||||
.grid = {64, 128, NULL},
|
||||
.grid = {224, 396, NULL},
|
||||
};
|
||||
|
||||
// Allocate memory
|
||||
|
@ -169,10 +169,10 @@ int main_loop(struct game *current_game)
|
|||
|
||||
// Special actions : quit and manage mutations
|
||||
if (background == -1) end = 1;
|
||||
if (background == 5)
|
||||
if (background == 4)
|
||||
{
|
||||
mutation_select(current_game, mutation_menu);
|
||||
background = 3;
|
||||
background = 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue