Commit 3ca3127a authored by Ant Man's avatar Ant Man

Update range

parent b98771c2
File added
File added
......@@ -408,6 +408,7 @@ void case_actionRemove(int caseX, int caseY)
printf("invoking remove\n");
if (case_isUserPlaced(caseX, caseY)) {
Mix_PlayChannel(-1, gameData->sound[BLEEP], 0);
printf("Suppression de tour avec succes, +%d\n", tour_getPrixRevente(case_getType(caseX, caseY)));
case_removeConstruction(caseX, caseY);
printf("Porte monaie : %d \n", plateau->joueur->argent);
......
......@@ -8,6 +8,7 @@
#include <GL/glu.h>
#endif
#include <SDL/SDL_mixer.h>
#include <stdio.h>
#include "structures.h"
......
......@@ -471,12 +471,14 @@ void display_drawSquare(int fillMode)
{
glPolygonMode(GL_FRONT_AND_BACK, fillMode);
glBegin(GL_QUADS);
glBegin(GL_POLYGON);
glVertex2f(-0.5,0.5);
glVertex2f(0.5,0.5);
glVertex2f(0.5,-0.5);
glVertex2f(-0.5,-0.5);
glEnd();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
void display_drawTriangle(int fillMode)
......@@ -490,6 +492,18 @@ void display_drawTriangle(int fillMode)
glEnd();
}
void display_drawBatimentRange(int caseX, int caseY, float range)
{
glPushMatrix();
glTranslatef(caseX, caseY, 0);
glTranslatef(0.5,0.5,0);
glScalef(1.5,1.5,1);
glScalef(range, range, 1);
glColor3f(1,1,1);
display_drawSquare(GL_LINE);
glPopMatrix();
}
void display_drawTargetRange(int caseX, int caseY, float range)
{
glPushMatrix();
......@@ -770,12 +784,13 @@ void display_drawAllTargetRanges()
switch (generalType) {
case BATIMENT:
range = tour_getRange(type);
display_drawBatimentRange(caseX, caseY, range);
break;
case TOUR:
range = tour_calculPortee(plateau->tours[index_case]);
display_drawTargetRange(caseX, caseY, range);
break;
}
display_drawTargetRange(caseX, caseY, range);
glPopMatrix();
}
}
......
......@@ -26,6 +26,7 @@
#include "sprite.h"
#include <time.h>
void display_drawBatimentRange(int caseX, int caseY, float range);
void display_drawCentrale(int index_case);
void display_levelTextCopy(char texte[], int button_id);
GLuint display_initDefaultListIcon(TextureName texture_name);
......
......@@ -23,42 +23,42 @@ void sound_init()
son = Mix_LoadWAV("sound/addTower.ogg");
gameData->sound[TOWER] = son;
son = Mix_LoadWAV("sound/addCentrale.wav");
son = Mix_LoadWAV("sound/addCentrale.ogg");
gameData->sound[CENTRAL] = son;
son = Mix_LoadWAV("sound/projectile.wav");
son = Mix_LoadWAV("sound/projectile.ogg");
gameData->sound[PROJECTILE] = son;
son = Mix_LoadWAV("sound/monsterSolder.wav");
son = Mix_LoadWAV("sound/monsterSolder.ogg");
gameData->sound[SOLD] = son;
son = Mix_LoadWAV("sound/monsterGeneral.wav");
son = Mix_LoadWAV("sound/monsterGeneral.ogg");
gameData->sound[GENE] = son;
son = Mix_LoadWAV("sound/monsterHuge_Solder.wav");
son = Mix_LoadWAV("sound/monsterHuge_Solder.ogg");
gameData->sound[HSOLD] = son;
son = Mix_LoadWAV("sound/monsterBoss.wav");
son = Mix_LoadWAV("sound/monsterBoss.ogg");
gameData->sound[BOS] = son;
son = Mix_LoadWAV("sound/beginLevel.wav");
son = Mix_LoadWAV("sound/beginLevel.ogg");
gameData->sound[BEGINLEVEL] = son;
son = Mix_LoadWAV("sound/levelLose.ogg");
gameData->sound[LOSELEVEL] = son;
son = Mix_LoadWAV("sound/levelWin.wav");
son = Mix_LoadWAV("sound/levelWin.ogg");
gameData->sound[WINLEVEL] = son;
son = Mix_LoadWAV("sound/snap.wav");
son = Mix_LoadWAV("sound/snap.ogg");
gameData->sound[SNAP] = son;
son = Mix_LoadWAV("sound/hit-wood.wav");
son = Mix_LoadWAV("sound/hit-wood.ogg");
gameData->sound[HITWOOD] = son;
son = Mix_LoadWAV("sound/bleep.ogg");
gameData->sound[BLEEP] = son;
son = Mix_LoadWAV("sound/error.wav");
son = Mix_LoadWAV("sound/error.ogg");
gameData->sound[ERROR] = son;
}
......@@ -201,7 +201,6 @@ void tour_remove(Tour* tour)
}
tour_list->next = tour_list->next->next;
}
Mix_PlayChannel(-1, gameData->sound[BLEEP], 0);
free(tour);
}
......
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