#include #include #include "instructions.h" #include "progress.h" #include "level.h" #include "draw.h" #include "main.h" enum instruction_purpose { ABOUT_BASICS, ABOUT_TRUCKS_CARGOS, ABOUT_BUTTONS, ABOUT_DROPPOINTS, ABOUT_WHITE_TRUCKS, ABOUT_HOVERBOARDS, }; const char* instructions[INSTRUCTIONS_COUNT] = { "Use trucks to deliver cargos to houses of\0the same color.\0To draw a truck's path, hold [2nd] on it and\0use the arrow keys.\0Press [enter] once all the paths are drawn\0to start the deliveries.\0", "Trucks can carry up to three cargos\0simultaneously.\0Trucks will unstack a cargo for each\0delivery.\0", "Buttons control bridges of the same color.\0\0", "Trucks can drop cargos on drop points.\0Press [alpha] on a drop point to enable it.\0", "White trucks can deliver cargos to houses\0of any color.\0", "Hoverboards can deliver cargos to houses\0of any color.\0Hoverboards can go on the grass.\0\0", }; void instruction_show(uint8_t index) { const char* instruction; for (instruction = instructions[index]; *instruction;) { uint8_t d; level_draw(); draw_bubble(5,240-29-5,320-10,29); for (d = 0; d <= 1; ++d) { gfx_PrintStringXY(instruction, 10, 240-29 + d*12); while (*instruction++); } draw_done(); keys_wait(); } } void instructions_show(void) { uint8_t index; if (level.count.cargos) --level.count.cargos; if (level.level_index == 1) instruction_show(ABOUT_BASICS); for (index = 1; index < INSTRUCTIONS_COUNT; ++index) { if (!progress.level_instructions[index] && (&level.count.houses)[index]) progress.level_instructions[index] = level.level_index; if (progress.level_instructions[index] == level.level_index) instruction_show(index); } }