Show def name of fighter, and display left and right arrows when selecting a new fighter.
This commit is contained in:
parent
4d4a1fa236
commit
a42a87efa5
|
@ -37,6 +37,8 @@ static HudMessage *hudMessageTail;
|
||||||
static SDL_Texture *targetPointer;
|
static SDL_Texture *targetPointer;
|
||||||
static SDL_Texture *targetCircle;
|
static SDL_Texture *targetCircle;
|
||||||
static SDL_Texture *smallFighter;
|
static SDL_Texture *smallFighter;
|
||||||
|
static SDL_Texture *arrowLeft;
|
||||||
|
static SDL_Texture *arrowRight;
|
||||||
static int numMessages;
|
static int numMessages;
|
||||||
static int healthWarning;
|
static int healthWarning;
|
||||||
static char *gunName[] = {"", "Particle Cannon", "Plasma Cannon", "Laser Cannon", "Mag Cannon"};
|
static char *gunName[] = {"", "Particle Cannon", "Plasma Cannon", "Laser Cannon", "Mag Cannon"};
|
||||||
|
@ -51,6 +53,8 @@ void initHud(void)
|
||||||
targetPointer = getTexture("gfx/hud/targetPointer.png");
|
targetPointer = getTexture("gfx/hud/targetPointer.png");
|
||||||
targetCircle = getTexture("gfx/hud/targetCircle.png");
|
targetCircle = getTexture("gfx/hud/targetCircle.png");
|
||||||
smallFighter = getTexture("gfx/hud/smallFighter.png");
|
smallFighter = getTexture("gfx/hud/smallFighter.png");
|
||||||
|
arrowLeft = getTexture("gfx/widgets/optionsLeft.png");
|
||||||
|
arrowRight = getTexture("gfx/widgets/optionsRight.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
void doHud(void)
|
void doHud(void)
|
||||||
|
@ -374,6 +378,14 @@ static void drawPlayerSelect(void)
|
||||||
blit(targetCircle, player->x - battle.camera.x, player->y - battle.camera.y, 1);
|
blit(targetCircle, player->x - battle.camera.x, player->y - battle.camera.y, 1);
|
||||||
|
|
||||||
drawText(SCREEN_WIDTH / 2, 500, 28, TA_CENTER, colors.white, "SELECT NEW FIGHTER");
|
drawText(SCREEN_WIDTH / 2, 500, 28, TA_CENTER, colors.white, "SELECT NEW FIGHTER");
|
||||||
|
|
||||||
|
if (player->health > 0)
|
||||||
|
{
|
||||||
|
drawText(SCREEN_WIDTH / 2, 540, 20, TA_CENTER, colors.white, "%s (%d%% / %d%%)", player->defName, getPercent(player->health, player->maxHealth), getPercent(player->shield, player->maxShield));
|
||||||
|
}
|
||||||
|
|
||||||
|
blit(arrowLeft, (SCREEN_WIDTH / 2) - 200, 520, 1);
|
||||||
|
blit(arrowRight, (SCREEN_WIDTH / 2) + 200, 520, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetHud(void)
|
void resetHud(void)
|
||||||
|
|
|
@ -32,6 +32,7 @@ extern float getAngle(int x1, int y1, int x2, int y2);
|
||||||
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
|
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
|
||||||
extern int getDistance(int x1, int y1, int x2, int y2);
|
extern int getDistance(int x1, int y1, int x2, int y2);
|
||||||
extern void drawRadar(void);
|
extern void drawRadar(void);
|
||||||
|
extern int getPercent(float current, float total);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Battle battle;
|
extern Battle battle;
|
||||||
|
|
Loading…
Reference in New Issue