Commit 201597d5 authored by ewen.madec's avatar ewen.madec

fix repetories

parent 5ffbb499
......@@ -190,7 +190,7 @@ void Graphic_diceRolling(Player *attacker, Player *defender, Node *originNode, N
const int screenWidth = 1700;
const int screenHeight = 800;
Image texture = LoadImage("diceRolling.png");
Image texture = LoadImage("resources/diceRolling.png");
ImageResize(&(texture), 100, 800);
Texture2D diceTexture = LoadTextureFromImage(texture);
......@@ -200,8 +200,8 @@ void Graphic_diceRolling(Player *attacker, Player *defender, Node *originNode, N
sprintf(whoseTurnToAttack, "%s ", attacker->name);
char *whoseTurnToDefend = malloc(20 * sizeof(char));
sprintf(whoseTurnToDefend, "%s ", defender->name);
Rectangle skipAnimation = {screenWidth / 2 - 125, 200, 190, 50};
Rectangle skipResult = {screenWidth / 2 - 105, 200, 150, 50};
Rectangle skipAnimation = {screenWidth / 2 - 225, 200, 190, 50};
Rectangle skipResult = {screenWidth / 2 - 205, 200, 150, 50};
Vector2 *positionDiceAttacker = malloc(20 * sizeof(Vector2));
Vector2 *positionDiceDefender = malloc(20 * sizeof(Vector2));
......@@ -253,10 +253,10 @@ void Graphic_diceRolling(Player *attacker, Player *defender, Node *originNode, N
DrawTextEx(*font, whoseTurnToAttack, (Vector2){250, 100}, 40.0, 3.0, attacker->color);
DrawTextEx(*font, whoseTurnToDefend, (Vector2){screenWidth - 700, 100}, 40.0, 3.0, defender->color);
DrawTextEx(*font, " attacker", (Vector2){250, 150}, 30.0, 3.0, attacker->color);
DrawTextEx(*font, " defender", (Vector2){screenWidth - 700, 150}, 30.0, 3.0, defender->color);
DrawTextEx(*font, " attacker", (Vector2){225, 150}, 30.0, 3.0, attacker->color);
DrawTextEx(*font, " defender", (Vector2){screenWidth - 725, 150}, 30.0, 3.0, defender->color);
DrawRectangleRec(skipAnimation, BLUE);
DrawTextEx(*font, "Skip Animation", (Vector2){screenWidth / 2 - 115, 210}, 18.0, 3.0, BLACK);
DrawTextEx(*font, "Skip Animation", (Vector2){screenWidth / 2 - 215, 210}, 18.0, 3.0, BLACK);
for (int i = 0; i < nbOfAttackers; i++)
{
DrawTextureRec(diceTexture, frameRec, positionDiceAttacker[i], WHITE);
......@@ -279,7 +279,7 @@ void Graphic_diceRolling(Player *attacker, Player *defender, Node *originNode, N
framesCounter++;
frameExit++;
if (frameExit == 300)
if (frameExit == 350)
endDisplayResult = true;
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
{
......@@ -304,10 +304,10 @@ void Graphic_diceRolling(Player *attacker, Player *defender, Node *originNode, N
DrawTextEx(*font, whoseTurnToAttack, (Vector2){250, 100}, 40.0, 3.0, attacker->color);
DrawTextEx(*font, whoseTurnToDefend, (Vector2){screenWidth - 700, 100}, 40.0, 3.0, defender->color);
DrawTextEx(*font, " attacker", (Vector2){250, 150}, 30.0, 3.0, attacker->color);
DrawTextEx(*font, " defender", (Vector2){screenWidth - 700, 150}, 30.0, 3.0, defender->color);
DrawTextEx(*font, " attacker", (Vector2){225, 150}, 30.0, 3.0, attacker->color);
DrawTextEx(*font, " defender", (Vector2){screenWidth - 725, 150}, 30.0, 3.0, defender->color);
DrawRectangleRec(skipResult, BLUE);
DrawTextEx(*font, "Skip Result", (Vector2){screenWidth / 2 - 100, 210}, 18.0, 3.0, BLACK);
DrawTextEx(*font, "Skip Result", (Vector2){screenWidth / 2 - 200, 210}, 18.0, 3.0, BLACK);
for (int i = 0; i < nbOfAttackers; i++)
{
switch (listOfDices[i])
......@@ -392,11 +392,13 @@ void Graphic_diceRolling(Player *attacker, Player *defender, Node *originNode, N
{
if (listOfDices[index] > listOfDices[index + attackersCount])
{
DrawTextEx(*font, "Defenders lose a soldier", (Vector2){screenWidth / 2 - MeasureTextEx(*font, "Defenders lose a soldier", 50.0, 3.0).x / 2 - 50, 600}, 50.0, 3.0, BLACK);
DrawTextEx(*font, defender->name, (Vector2){screenWidth / 2 - 300, 600}, 50.0, 3.0, BLACK);
DrawTextEx(*font, " lose a soldier", (Vector2){screenWidth / 2 -300 + MeasureTextEx(*font, defender->name, 50.0, 3.0).x , 600}, 50.0, 3.0, defender->color);
}
else
{
DrawTextEx(*font, "Attackers lose a soldier", (Vector2){screenWidth / 2 - MeasureTextEx(*font, "Attackers lose a soldier", 50.0, 3.0).x / 2 - 50, 600}, 50.0, 3.0, BLACK);
DrawTextEx(*font, attacker->name, (Vector2){screenWidth / 2 - 300, 600}, 50.0, 3.0, BLACK);
DrawTextEx(*font, " lose a soldier", (Vector2){screenWidth / 2 - 300 + MeasureTextEx(*font, attacker->name, 50.0, 3.0).x , 600}, 50.0, 3.0, attacker->color);
}
}
......
......@@ -47,7 +47,7 @@ int main(int nbArg, char ** arg)
InitWindow(screenWidth, screenHeight, "NetWorld basic viewer");
SetTargetFPS(targetFPS);
Font gameFont = LoadFont("GAMERIA.ttf");
Font gameFont = LoadFont("resources/GAMERIA.ttf");
// Main game loop
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment