<!DOCTYPE QtCreatorProject>
<qtcreator>
<data>
- <variable>RunConfiguration0-BaseEnvironmentBase</variable>
- <value type="int">2</value>
- </data>
- <data>
- <variable>RunConfiguration0-CommandLineArguments</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-ProFile</variable>
- <value type="QString">Bug_Attack.pro</value>
- </data>
- <data>
- <variable>RunConfiguration0-RunConfiguration.name</variable>
- <value type="QString">Bug_Attack</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseDyldImageSuffix</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UseTerminal</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserEnvironmentChanges</variable>
- <valuelist type="QVariantList"/>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetName</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserSetWorkingDirectory</variable>
- <value type="bool">false</value>
- </data>
- <data>
- <variable>RunConfiguration0-UserWorkingDirectory</variable>
- <value type="QString"></value>
- </data>
- <data>
- <variable>RunConfiguration0-type</variable>
- <value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
- </data>
- <data>
- <variable>activeRunConfiguration</variable>
+ <variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
- <variable>activebuildconfiguration</variable>
- <value type="QString">Debug</value>
- </data>
- <data>
- <variable>buildConfiguration-Debug</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
- <value key="QtVersionId" type="int">0</value>
- <value key="ToolChain" type="int">0</value>
- <value key="addQDumper" type=""></value>
- <value key="buildConfiguration" type="int">2</value>
- </valuemap>
- </data>
- <data>
- <variable>buildConfiguration-Release</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- <value key="QtVersionId" type="int">0</value>
- <value key="addQDumper" type=""></value>
- <value key="buildConfiguration" type="int">0</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
- <valuelist key="abstractProcess.Environment" type="QVariantList">
- <value type="QString">COLORTERM=gnome-terminal</value>
- <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-4ATZ8FsiM4,guid=b3b5e8064b425952320809474de0d837</value>
- <value type="QString">DEFAULTS_PATH=/usr/share/gconf/wmii.default.path</value>
- <value type="QString">DESKTOP_SESSION=wmii</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">DVDCSS_CACHE=/home/karim/.dvdcss/</value>
- <value type="QString">DVDCSS_METHOD=key</value>
- <value type="QString">DVDCSS_RAW_DEVICE=/dev/rdvd</value>
- <value type="QString">DVDCSS_VERBOSE=0</value>
- <value type="QString">EDITOR=emacs -nw</value>
- <value type="QString">GDMSESSION=wmii</value>
- <value type="QString">GDM_KEYBOARD_LAYOUT=fr oss</value>
- <value type="QString">GDM_LANG=fr_FR.utf8</value>
- <value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-lbcNed</value>
- <value type="QString">GNOME_KEYRING_PID=1553</value>
- <value type="QString">GROUP=karim</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/home/karim</value>
- <value type="QString">HOST=darkstar</value>
- <value type="QString">HOSTTYPE=i486-linux</value>
- <value type="QString">LANG=fr_FR.utf8</value>
- <value type="QString">LANGUAGE=</value>
- <value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LESS=-Q</value>
- <value type="QString">LOGNAME=karim</value>
- <value type="QString">MACHTYPE=i486</value>
- <value type="QString">MANDATORY_PATH=/usr/share/gconf/wmii.mandatory.path</value>
- <value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-karim</value>
- <value type="QString">OSTYPE=linux</value>
- <value type="QString">PATH=/usr/bin:/home/karim/proglangs/go/bin:/home/karim/usrbin:/home/karim/proglangs/go/bin:/home/karim/usrbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
- <value type="QString">PWD=/home/karim/Documents/Cours/LO21/projet/Bug_Attack</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">REMOTEHOST=</value>
- <value type="QString">SHELL=/bin/tcsh</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SPEECHD_PORT=7560</value>
- <value type="QString">SSH_AGENT_PID=1606</value>
- <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-WHnVlH1571/agent.1571</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=karim</value>
- <value type="QString">USERNAME=karim</value>
- <value type="QString">VENDOR=intel</value>
- <value type="QString">VISUALWORKS=/home/karim/vw7.7.1nc</value>
- <value type="QString">WINDOWID=35651588</value>
- <value type="QString">WMII_9MENU=wmii9menu -font 'fixed' -nf '#888888' -nb '#222222' -sf '#ffffff' -sb '#285577' -br '#4c7899'</value>
- <value type="QString">WMII_ADDRESS=unix!/tmp/ns.karim.:0/wmii</value>
- <value type="QString">WMII_CONFPATH=/home/karim/.wmii-3.5:/etc/X11/wmii-3.5</value>
- <value type="QString">WMII_FOCUSCOLORS=#ffffff #285577 #4c7899</value>
- <value type="QString">WMII_FONT=fixed</value>
- <value type="QString">WMII_MENU=dmenu -b -fn 'fixed' -nf '#888888' -nb '#222222' -sf '#ffffff' -sb '#285577'</value>
- <value type="QString">WMII_NORMCOLORS=#888888 #222222 #333333</value>
- <value type="QString">WMII_NS_DIR=/tmp/ns.karim.:0</value>
- <value type="QString">WMII_TERM=x-terminal-emulator</value>
- <value type="QString">XAUTHORITY=/var/run/gdm/auth-for-karim-ZS7TdS/database</value>
- <value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-wmii:/etc/xdg</value>
- <value type="QString">XDG_SESSION_COOKIE=8d773db3cd1c3e1862d910494c27a514-1306581046.982572-757318715</value>
- <value type="QString">no_proxy=0.0.0.0, 127.0.0.1, localhost</value>
- </valuelist>
- <valuelist key="abstractProcess.arguments" type="QVariantList">
- <value type="QString">/home/karim/Documents/Cours/LO21/projet/Bug_Attack/Bug_Attack.pro</value>
- <value type="QString">-spec</value>
- <value type="QString">linux-g++</value>
- <value type="QString">-r</value>
- <value type="QString">CONFIG+=debug</value>
- </valuelist>
- <value key="abstractProcess.command" type="QString">/usr/bin/qmake-qt4</value>
- <value key="abstractProcess.enabled" type="bool">false</value>
- <value key="abstractProcess.workingDirectory" type="QString">/home/karim/Documents/Cours/LO21/projet/Bug_Attack</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Debug-buildstep1</variable>
+ <variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
- <valuelist key="abstractProcess.Environment" type="QVariantList">
- <value type="QString">COLORTERM=gnome-terminal</value>
- <value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-4ATZ8FsiM4,guid=b3b5e8064b425952320809474de0d837</value>
- <value type="QString">DEFAULTS_PATH=/usr/share/gconf/wmii.default.path</value>
- <value type="QString">DESKTOP_SESSION=wmii</value>
- <value type="QString">DISPLAY=:0.0</value>
- <value type="QString">DVDCSS_CACHE=/home/karim/.dvdcss/</value>
- <value type="QString">DVDCSS_METHOD=key</value>
- <value type="QString">DVDCSS_RAW_DEVICE=/dev/rdvd</value>
- <value type="QString">DVDCSS_VERBOSE=0</value>
- <value type="QString">EDITOR=emacs -nw</value>
- <value type="QString">GDMSESSION=wmii</value>
- <value type="QString">GDM_KEYBOARD_LAYOUT=fr oss</value>
- <value type="QString">GDM_LANG=fr_FR.utf8</value>
- <value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-lbcNed</value>
- <value type="QString">GNOME_KEYRING_PID=1553</value>
- <value type="QString">GROUP=karim</value>
- <value type="QString">GTK_MODULES=canberra-gtk-module</value>
- <value type="QString">HOME=/home/karim</value>
- <value type="QString">HOST=darkstar</value>
- <value type="QString">HOSTTYPE=i486-linux</value>
- <value type="QString">LANG=fr_FR.utf8</value>
- <value type="QString">LANGUAGE=</value>
- <value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
- <value type="QString">LESS=-Q</value>
- <value type="QString">LOGNAME=karim</value>
- <value type="QString">MACHTYPE=i486</value>
- <value type="QString">MANDATORY_PATH=/usr/share/gconf/wmii.mandatory.path</value>
- <value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-karim</value>
- <value type="QString">OSTYPE=linux</value>
- <value type="QString">PATH=/usr/bin:/home/karim/proglangs/go/bin:/home/karim/usrbin:/home/karim/proglangs/go/bin:/home/karim/usrbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
- <value type="QString">PWD=/home/karim/Documents/Cours/LO21/projet/Bug_Attack</value>
- <value type="QString">QTDIR=/usr/share/qt4</value>
- <value type="QString">REMOTEHOST=</value>
- <value type="QString">SHELL=/bin/tcsh</value>
- <value type="QString">SHLVL=2</value>
- <value type="QString">SPEECHD_PORT=7560</value>
- <value type="QString">SSH_AGENT_PID=1606</value>
- <value type="QString">SSH_AUTH_SOCK=/tmp/ssh-WHnVlH1571/agent.1571</value>
- <value type="QString">TERM=xterm</value>
- <value type="QString">USER=karim</value>
- <value type="QString">USERNAME=karim</value>
- <value type="QString">VENDOR=intel</value>
- <value type="QString">VISUALWORKS=/home/karim/vw7.7.1nc</value>
- <value type="QString">WINDOWID=35651588</value>
- <value type="QString">WMII_9MENU=wmii9menu -font 'fixed' -nf '#888888' -nb '#222222' -sf '#ffffff' -sb '#285577' -br '#4c7899'</value>
- <value type="QString">WMII_ADDRESS=unix!/tmp/ns.karim.:0/wmii</value>
- <value type="QString">WMII_CONFPATH=/home/karim/.wmii-3.5:/etc/X11/wmii-3.5</value>
- <value type="QString">WMII_FOCUSCOLORS=#ffffff #285577 #4c7899</value>
- <value type="QString">WMII_FONT=fixed</value>
- <value type="QString">WMII_MENU=dmenu -b -fn 'fixed' -nf '#888888' -nb '#222222' -sf '#ffffff' -sb '#285577'</value>
- <value type="QString">WMII_NORMCOLORS=#888888 #222222 #333333</value>
- <value type="QString">WMII_NS_DIR=/tmp/ns.karim.:0</value>
- <value type="QString">WMII_TERM=x-terminal-emulator</value>
- <value type="QString">XAUTHORITY=/var/run/gdm/auth-for-karim-ZS7TdS/database</value>
- <value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-wmii:/etc/xdg</value>
- <value type="QString">XDG_SESSION_COOKIE=8d773db3cd1c3e1862d910494c27a514-1306581046.982572-757318715</value>
- <value type="QString">no_proxy=0.0.0.0, 127.0.0.1, localhost</value>
- </valuelist>
- <value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
- <valuelist key="abstractProcess.arguments" type="QVariantList">
- <value type="QString">-w</value>
- </valuelist>
- <value key="abstractProcess.command" type="QString">/usr/bin/make</value>
- <value key="abstractProcess.enabled" type="bool">true</value>
- <value key="abstractProcess.workingDirectory" type="QString">/home/karim/Documents/Cours/LO21/projet/Bug_Attack</value>
+ <value key="EditorConfiguration.Codec" type="QByteArray">System</value>
</valuemap>
</data>
<data>
- <variable>buildconfiguration-Debug-cleanstep0</variable>
+ <variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
- <value key="cleanConfig" type="bool">true</value>
- <valuelist key="makeargs" type="QVariantList">
- <value type="QString">clean</value>
- </valuelist>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
+ <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
+ <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
+ <valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/clement/Projects/Bug_Attack-build-desktop</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+ <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+ </valuemap>
+ <valuemap key="ProjectExplorer.BuildConfiguration.BuildStep.1" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
+ <valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+ <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+ <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.BuildConfiguration.CleanStepsCount" type="int">1</value>
+ <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+ <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Release</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/clement/Projects/Bug_Attack-build-desktop</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">2</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+ <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
+ <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
+ <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Bug_Attack</value>
+ <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">Bug_Attack.pro</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
+ <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetName" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
+ <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
+ </valuemap>
+ <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap>
</data>
<data>
- <variable>buildconfiguration-Release-buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfiguration-Release-cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
- </valuemap>
- </data>
- <data>
- <variable>buildconfigurations</variable>
- <valuelist type="QVariantList">
- <value type="QString">Debug</value>
- <value type="QString">Release</value>
- </valuelist>
- </data>
- <data>
- <variable>buildstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
- <value key="mkspec" type="QString"></value>
- </valuemap>
- </data>
- <data>
- <variable>buildstep1</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
- </valuemap>
- </data>
- <data>
- <variable>buildsteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.qmake</value>
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>cleanstep0</variable>
- <valuemap type="QVariantMap">
- <value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
- <value key="clean" type="bool">true</value>
- </valuemap>
- </data>
- <data>
- <variable>cleansteps</variable>
- <valuelist type="QVariantList">
- <value type="QString">trolltech.qt4projectmanager.make</value>
- </valuelist>
- </data>
- <data>
- <variable>defaultFileEncoding</variable>
- <value type="QByteArray">System</value>
+ <variable>ProjectExplorer.Project.TargetCount</variable>
+ <value type="int">1</value>
</data>
<data>
- <variable>project</variable>
- <valuemap type="QVariantMap"/>
+ <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+ <value type="int">4</value>
</data>
</qtcreator>
-#include <iostream>
-#include <typeinfo>
#include <math.h>
#include "defenser.h"
#include "projectile.h"
+#include <iostream>
/**
* DEFENSER
:Entity(posx,posy),_level(level),_map(map)
{
this->setIsSelected(true); // Appel à la méthode pour rafraichir l'affichage
+ // Met le compteur interne à 0 et relie le FPS au tir
+ _shootTimerStep = 0;
+ // QObject::connect(&map->gameTimer,SIGNAL(timeout()), this,SLOT(shootTarget()));
}
this->updateStats();
}
+void Defenser::advance(int phase) {
+ if(!phase)
+ return;
+
+ // Détection des ennemis aux alentours
+ QList<Enemy*> enemies = _map->getEnemyList();
+
+ QList<Enemy*>::iterator i;
+
+ // Recherche des ennemis de la map (tire sur tous les types d'ennemis)
+ for(i = enemies.begin() ; i != enemies.end() ; ++i) {
+
+ float targetX = (*i)->x();
+ float targetY = (*i)->y();
+
+ if( (_targetType | (*i)->getType()) == _targetType &&
+ sqrt(pow(fabs(this->x()-16 - targetX - ((*i)->getSize()-1)*16),2)
+ +pow(fabs(this->y()-16 - targetY - ((*i)->getSize()-1)*16),2)
+ ) <= _range)
+ {
+ // Si le défenseur ne tirait pas encore
+ if(!_isShooting) {
+ this->setIsShooting(true); // Modification via la méthode pour les effets visuels
+ }
+ // Actualise la position de la cible
+ this->setTarget(targetX+(*i)->getSize()*16,targetY+(*i)->getSize()*16);
+ // Tire
+ this->shootTarget();
+
+ return; // On vise la première cible rencontrée
+
+ } // end distanceTest
+
+ } //eof
+ // Si aucun monstre n'a été rencontré
+ this->setIsShooting(false); // Modification via la méthode pour les effets visuels
+
+} // eom
+
+QRectF Defenser::boundingRect(void) const {
+ return QRectF(-32,-32,_range,_range);
+}
+
+void Defenser::setTarget(float targetX,float targetY) {
+ // Sauvegarde la position de la cible courante
+ _targetX = targetX;
+ _targetY = targetY;
+}
void Defenser::setIsShooting(bool state) {
}
+bool Defenser::isShooting(void) const { return _isShooting;}
+
+// On considère que par défaut seules trois améliorations sont possibles
+// Cette méthode est néanmoins virtuelle pour cas particulier(s)
+bool Defenser::isLevelMax(void) const { return _level==3; }
+
/**
* PISTOLET A EAU
**/
: Defenser(posx,posy,level,map)
{
// Type de cible
- _target = TYPE::T_RAMPANT & TYPE::T_VOLANT;
- _shootTimerStep = 0;
- _rate = 4 - _level/2;
+ _targetType = DEFAULT_TARGET_TYPE;
// Caractéristiques
this->updateStats();
-
- QObject::connect(&map->gameTimer,SIGNAL(timeout()), this,SLOT(shootTarget()));
}
int WaterGun::getCost(int level) const{
if(level == -1) level = _level;
switch(level) {
- case 1: return 8;
- case 2: return 20;
- default: return 45;
+ case 1: return BASIC_COST;
+ case 2: return INTERMEDIATE_COST;
+ default: return HIGHEST_COST;
}
}
return infos;
}
-bool WaterGun::isShooting(void) const { return _isShooting;}
-
-bool WaterGun::isLevelMax(void) const { return _level==3; }
void WaterGun::updateStats(void) {
}
-QRectF WaterGun::boundingRect(void) const {
- return QRectF(-32,-32,_range,_range);
+
+void WaterGun::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
+
+ // Si la tourelle est selectionnée, on dessine un halo autour
+ if(_isSelected) {
+ painter->setBrush(QBrush(Qt::yellow));
+ painter->drawRect(-2,-2,36,36);
+ }
+
+ // Dessine la tourelle
+ painter->setBrush(QBrush(Qt::blue));
+ painter->drawRect(0,0,32,32);
+
+ // Dessine la portée de la tourelle
+ painter->setBrush(QBrush(Qt::blue,Qt::NoBrush));
+ painter->drawEllipse((-_range/32)*16+16,(-_range/32)*16+16,_range,_range);
}
-void WaterGun::setTarget(float targetX,float targetY) {
- // Sauvegarde la position de la cible courante
- _targetX = targetX;
- _targetY = targetY;
+void WaterGun::shootTarget(void) {
+ if (!isShooting())
+ return;
+
+ _shootTimerStep+= 1;
+
+ if (_shootTimerStep < (GAME::FPS / _rate))
+ return;
+
+ _shootTimerStep = 0;
+
+ // Créé un nouveau projectile au niveau du centre de la tourelle
+ Projectile* shot = new ProjectileWater(this->x()+14,this->y()+14,_targetX,_targetY,_power, _map);
+ _map->addItem(shot);
+
}
-void WaterGun::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
+
+/**
+* LANCE PIERRE
+**/
+
+Slingshot::Slingshot(int posx,int posy,int level,Map* map)
+ : Defenser(posx,posy,level,map)
+{
+ // Type de cible
+ _targetType = DEFAULT_TARGET_TYPE;
+ _shootTimerStep = 0;
+ // Caractéristiques
+ this->updateStats();
+}
+
+int Slingshot::getCost(int level) const{
+
+ // Si aucune valeur en argument, alors on affiche le coût du niveau courant
+ if(level == -1) level = _level;
+
+ switch(level) {
+ case 1: return BASIC_COST;
+ case 2: return INTERMEDIATE_COST;
+ default: return HIGHEST_COST;
+ }
+}
+
+QString Slingshot::getInfos(void) const {
+
+ // Infos générales
+ QString infos = "Lance-pierres de niveau ";
+ infos+= QString::number(_level);
+ // Amélioration
+ if(!this->isLevelMax()) {
+ infos+= "\n- Amelioration : ";
+ infos+= QString::number(this->getCost(_level+1));
+ }
+ // Revente
+ infos+= "\n- Revente : ";
+ infos+= QString::number(this->getCost(_level)/2);
+
+ return infos;
+}
+
+
+
+void Slingshot::updateStats(void) {
+
+ _range = (3.0f + _level/2.0f)*32.0f;
+ _rate = 1;
+ _power = 10 * _level * sqrt(_level); // level ^ 1.5
+
+}
+
+
+
+void Slingshot::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
// Si la tourelle est selectionnée, on dessine un halo autour
if(_isSelected) {
}
// Dessine la tourelle
- painter->setBrush(QBrush(Qt::red));
+ painter->setBrush(QBrush(Qt::gray));
painter->drawRect(0,0,32,32);
// Dessine la portée de la tourelle
painter->drawEllipse((-_range/32)*16+16,(-_range/32)*16+16,_range,_range);
}
-void WaterGun::advance(int phase) {
- if(!phase)
+void Slingshot::shootTarget(void) {
+ if (!isShooting())
return;
- // Détection des ennemis aux alentours
- QList<Enemy*> enemies = _map->getEnemyList();
+ _shootTimerStep+= 1;
- QList<Enemy*>::iterator i;
+ if (_shootTimerStep < (GAME::FPS / _rate))
+ return;
- // Recherche des ennemis de la map (tire sur tous les types d'ennemis)
- for(i = enemies.begin() ; i != enemies.end() ; ++i) {
+ _shootTimerStep = 0;
- float targetX = (*i)->x();
- float targetY = (*i)->y();
+ // Créé un nouveau projectile au niveau du centre de la tourelle
+ Projectile* shot = new ProjectileStone(this->x()+14,this->y()+14,_targetX,_targetY,_power, _map);
+ _map->addItem(shot);
- if(sqrt(pow(fabs(this->x()-16 - targetX - ((*i)->getSize()-1)*16),2)
- +pow(fabs(this->y()-16 - targetY - ((*i)->getSize()-1)*16),2)
- ) <= _range)
- {
- // Si le défenseur ne tirait pas encore
- if(!_isShooting) {
- this->setIsShooting(true); // Modification via la méthode pour les effets visuels
- }
- // Actualise la position de la cible
- this->setTarget(targetX+(*i)->getSize()*16,targetY+(*i)->getSize()*16);
+}
- return; // On vise la première cible rencontrée
- } // end distanceTest
+/**
+* PAINTBALL
+**/
- } //eof
- // Si aucun monstre n'a été rencontré
- this->setIsShooting(false); // Modification via la méthode pour les effets visuels
+Paintball::Paintball(int posx,int posy,int level,Map* map)
+ : Defenser(posx,posy,level,map)
+{
+ // Type de cible
+ _targetType = DEFAULT_TARGET_TYPE;
+ _shootTimerStep = 0;
+ // Caractéristiques
+ this->updateStats();
+}
-} // eom
+int Paintball::getCost(int level) const{
-void WaterGun::shootTarget(void) {
+ // Si aucune valeur en argument, alors on affiche le coût du niveau courant
+ if(level == -1) level = _level;
+
+ switch(level) {
+ case 1: return BASIC_COST;
+ case 2: return INTERMEDIATE_COST;
+ default: return HIGHEST_COST;
+ }
+}
+
+QString Paintball::getInfos(void) const {
+
+ // Infos générales
+ QString infos = "Paint-ball de niveau ";
+ infos+= QString::number(_level);
+ // Amélioration
+ if(!this->isLevelMax()) {
+ infos+= "\n- Amelioration : ";
+ infos+= QString::number(this->getCost(_level+1));
+ }
+ // Revente
+ infos+= "\n- Revente : ";
+ infos+= QString::number(this->getCost(_level)/2);
+
+ return infos;
+}
+
+
+
+void Paintball::updateStats(void) {
+
+ _range = (4.0f + _level/2.0f)*32.0f;
+ _rate = 2;
+ _power = 4 * _level * sqrt(_level); // level ^ 1.5
+
+}
+
+
+
+void Paintball::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
+
+ // Si la tourelle est selectionnée, on dessine un halo autour
+ if(_isSelected) {
+ painter->setBrush(QBrush(Qt::yellow));
+ painter->drawRect(-2,-2,36,36);
+ }
+
+ // Dessine la tourelle
+ painter->setBrush(QBrush(Qt::white));
+ painter->drawRect(0,0,32,32);
+
+ // Dessine la portée de la tourelle
+ painter->setBrush(QBrush(Qt::blue,Qt::NoBrush));
+ painter->drawEllipse((-_range/32)*16+16,(-_range/32)*16+16,_range,_range);
+}
+
+void Paintball::shootTarget(void) {
if (!isShooting())
return;
- _shootTimerStep+= 1; /* pas très sur de ça */
+ _shootTimerStep+= 1;
if (_shootTimerStep < (GAME::FPS / _rate))
return;
_shootTimerStep = 0;
// Créé un nouveau projectile au niveau du centre de la tourelle
- Projectile* shot = new Projectile(this->x()+14,this->y()+14,_targetX,_targetY,5,_power, _map);
+ Projectile* shot = new ProjectilePaintball(this->x()+14,this->y()+14,_targetX,_targetY,_power, _map);
_map->addItem(shot);
}
+
+
+/**
+* PAINTBALL
+**/
+
+Bowling::Bowling(int posx,int posy,int level,Map* map)
+ : Defenser(posx,posy,level,map)
+{
+ // Type de cible
+ _targetType = DEFAULT_TARGET_TYPE;
+ _shootTimerStep = 0;
+ // Caractéristiques
+ this->updateStats();
+}
+
+int Bowling::getCost(int level) const{
+
+ // Si aucune valeur en argument, alors on affiche le coût du niveau courant
+ if(level == -1) level = _level;
+
+ switch(level) {
+ case 1: return BASIC_COST;
+ case 2: return INTERMEDIATE_COST;
+ default: return HIGHEST_COST;
+ }
+}
+
+QString Bowling::getInfos(void) const {
+
+ // Infos générales
+ QString infos = "Joueur de petanque de niveau ";
+ infos+= QString::number(_level);
+ // Amélioration
+ if(!this->isLevelMax()) {
+ infos+= "\n- Amelioration : ";
+ infos+= QString::number(this->getCost(_level+1));
+ }
+ // Revente
+ infos+= "\n- Revente : ";
+ infos+= QString::number(this->getCost(_level)/2);
+
+ return infos;
+}
+
+
+
+void Bowling::updateStats(void) {
+
+ _range = (3.0f + _level/2.0f)*32.0f;
+ _rate = 0.5;
+ _power = 15 * _level * sqrt(_level); // level ^ 1.5
+
+}
+
+
+
+void Bowling::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
+
+ // Si la tourelle est selectionnée, on dessine un halo autour
+ if(_isSelected) {
+ painter->setBrush(QBrush(Qt::yellow));
+ painter->drawRect(-2,-2,36,36);
+ }
+
+ // Dessine la tourelle
+ painter->setBrush(QBrush(Qt::black));
+ painter->drawRect(0,0,32,32);
+
+ // Dessine la portée de la tourelle
+ painter->setBrush(QBrush(Qt::blue,Qt::NoBrush));
+ painter->drawEllipse((-_range/32)*16+16,(-_range/32)*16+16,_range,_range);
+}
+
+void Bowling::shootTarget(void) {
+ if (!isShooting())
+ return;
+
+ _shootTimerStep+= 1;
+
+ if (_shootTimerStep < (GAME::FPS / _rate))
+ return;
+
+ _shootTimerStep = 0;
+
+ // Créé un nouveau projectile au niveau du centre de la tourelle
+ Projectile* shot = new ProjectileBowling(this->x()+14,this->y()+14,_targetX,_targetY,_power, _map);
+ _map->addItem(shot);
+
+}
+
+
+
+
+
#ifndef DEFENSER_H
#define DEFENSER_H
-#include <QTimer>
#include "map.h"
#include "entity.h"
virtual int getCost(int level = -1) const = 0;
virtual QString getInfos(void) const = 0;
void increaseLevel(void);
- virtual bool isLevelMax(void) const = 0;
bool isSelected(void) const;
+ virtual bool isLevelMax(void) const;
void setIsShooting(bool state);
+ void setTarget(float targetX,float targetY);
+ QRectF boundingRect(void) const;
+ bool isShooting(void) const;
protected:
virtual void updateStats(void) = 0;
+ virtual void advance(int phase);
+ virtual void shootTarget(void) = 0;
int _shootTimerStep;
int _level;
- int _target; // combinaison de TYPE::ENTITY
+ int _targetType; // combinaison de TYPE::ENTITY
float _rate;
float _range;
int _power;
{
Q_OBJECT
+ void shootTarget(void);
+
public:
+
+ static const int DEFAULT_TARGET_TYPE = TYPE::T_RAMPANT | TYPE::T_VOLANT;
+ static const int BASIC_COST = 8;
+ static const int INTERMEDIATE_COST = 20;
+ static const int HIGHEST_COST = 45;
+
WaterGun(int posx,int posy,int level,Map* map);
int getCost(int level = -1) const;
- QString getInfos(void) const;
- bool isShooting(void) const;
- bool isLevelMax(void) const;
+ QString getInfos(void) const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
- void setTarget(float targetX,float targetY);
- QRectF boundingRect(void) const;
- static int getBasicCost(void) { return 8; }
+ static int getBasicCost(void) { return BASIC_COST; }
+
protected:
- void advance(int phase);
void updateStats(void);
+};
+
+/**
+* LANCE PIERRE
+**/
+
+
+class Slingshot : public Defenser
+{
+ Q_OBJECT
-public slots:
void shootTarget(void);
+public:
+
+ static const int DEFAULT_TARGET_TYPE = TYPE::T_VOLANT;
+ static const int BASIC_COST = 12;
+ static const int INTERMEDIATE_COST = 25;
+ static const int HIGHEST_COST = 60;
+
+ Slingshot(int posx,int posy,int level,Map* map);
+ int getCost(int level = -1) const;
+ QString getInfos(void) const;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
+ static int getBasicCost(void) { return BASIC_COST; }
+
+protected:
+ void updateStats(void);
};
+/**
+* PAINTBALL
+**/
+
+
+class Paintball : public Defenser
+{
+ Q_OBJECT
+
+ void shootTarget(void);
+
+public:
+
+ static const int DEFAULT_TARGET_TYPE = TYPE::T_RAMPANT | TYPE::T_VOLANT;
+ static const int BASIC_COST = 12;
+ static const int INTERMEDIATE_COST = 25;
+ static const int HIGHEST_COST = 60;
+
+ Paintball(int posx,int posy,int level,Map* map);
+ int getCost(int level = -1) const;
+ QString getInfos(void) const;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
+ static int getBasicCost(void) { return BASIC_COST; }
+
+protected:
+ void updateStats(void);
+};
+
+/**
+* PETANQUE
+**/
+
+
+class Bowling : public Defenser
+{
+ Q_OBJECT
+
+ void shootTarget(void);
+
+public:
+
+ static const int DEFAULT_TARGET_TYPE = TYPE::T_RAMPANT;
+ static const int BASIC_COST = 15;
+ static const int INTERMEDIATE_COST = 40;
+ static const int HIGHEST_COST = 80;
+
+ Bowling(int posx,int posy,int level,Map* map);
+ int getCost(int level = -1) const;
+ QString getInfos(void) const;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
+ static int getBasicCost(void) { return BASIC_COST; }
+
+protected:
+ void updateStats(void);
+};
#endif // DEFENSER_H
Enemy::Enemy(Map* map,int posx,int posy, float size):Entity(posx,posy),_map(map),_size(size){
// Positionne l'ennemi bien au centre du chemin
this->setPos(this->x() - (_size-1)*16,this->y() - (_size-1)*16);
+ // Désactive tout malus
+ _malusCounter = 0;
// Repertorie cet ennemi depuis la map
_map->addEnemy(this);
int Enemy::getResistance(void) const { return _resistance; }
TYPE::ENTITY Enemy::getType(void) const { return _type; }
+void Enemy::setSpeedMalus(float percent, int seconds) {
+ _malusCounter = GAME::FPS * seconds;
+ if(percent >= 0 && percent <= 1)
+ _speedMalus = percent; // Applique un pourcentage réducteur
+ else
+ _speedMalus = 0; // Par défaut on arrête l'ennemi
+}
+
+
float Enemy::getSize(void) const { return _size; }
void Enemy::hurt(int damages){
// Si ses HP sont tombés à zéro, on le détruit
if(_hp <= 0) {
// Indique que la mort est provoquée par le joueur
- emit killedByPlayer(this->getResistance()); // TODO choisir le gain
+ emit killedByPlayer(this->getSize()); // TODO choisir le gain
// Retire de l'indexation de la map
emit enemyDestroyed(this);
return;
- // Déplacement normal
+ /// Déplacement
+ // Calcul d'éventuels malus
+ float speedMalus = 1; // Si aucun malus, cette valeur restera à 1, soit aucune modification
+ if(_malusCounter > 0) {
+ _malusCounter--;
+ speedMalus = _speedMalus;
+ }
+
+ // Recherche de la direction à suivre
QPointF dirVect = currentTile.getDirection();
- float new_x = this->x() + _speed*dirVect.x();
- float new_y = this->y() + _speed*dirVect.y();
+ // Application de la vitesse
+ float new_x = this->x() + _speed*dirVect.x()*speedMalus;
+ float new_y = this->y() + _speed*dirVect.y()*speedMalus;
this->setPos(new_x,new_y);
Cafard::Cafard(Map* map,int posx,int posy, float size):Enemy(map,posx,posy,size)
{
// Données du cafard
- _type = TYPE::T_RAMPANT;
+ _type = DEFAULT_TYPE;
_hp = 10*size*size;
_hpMax = _hp;
_resistance = 5*size*size;
Fourmi::Fourmi(Map* map,int posx,int posy, float size):Enemy(map,posx,posy,size)
{
// Données de la fourmi
- _type = TYPE::T_RAMPANT;
+ _type = DEFAULT_TYPE;
_hp = 5*size*size;
_hpMax = _hp;
_resistance = size*size;
Guepe::Guepe(Map* map,int posx,int posy, float size):Enemy(map,posx,posy,size)
{
// Données de la guepe
- _type = TYPE::T_VOLANT;
+ _type = DEFAULT_TYPE;
_hp = 7*size*size;
_hpMax = _hp;
_resistance = 4*size*size;
Moustique::Moustique(Map* map,int posx,int posy, float size):Enemy(map,posx,posy,size)
{
// Données du moustique
- _type = TYPE::T_VOLANT;
+ _type = DEFAULT_TYPE;
_hp = 6*size*size;
_hpMax = _hp;
// Images et animations
for(int i = 0; i < 2; ++i) {
- QPixmap* animTemp = new QPixmap("./media/textures/ennemies/guepe" + QString::number(i+1) + ".png");
+ QPixmap* animTemp = new QPixmap("./media/textures/ennemies/moustique" + QString::number(i+1) + ".png");
*animTemp = animTemp->scaled(size*32,size*32);
_animPixmap.push_back(animTemp);
}
TYPE::ENTITY getType(void) const;
float getSize(void) const;
virtual void hurt(int damages);
-
+ void setSpeedMalus(float percent,int seconds);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
QRectF boundingRect(void) const;
int _hpMax;
int _resistance;
float _speed;
+
+ // Malus
+ float _speedMalus;
+ int _malusCounter;
+
TYPE::ENTITY _type;
virtual void advance(int phase);
public:
+
+ const static TYPE::ENTITY DEFAULT_TYPE = TYPE::T_RAMPANT;
+
Cafard(Map* map,int posx,int posy, float size);
void hurt(int damages);
public:
+
+ const static TYPE::ENTITY DEFAULT_TYPE = TYPE::T_RAMPANT;
+
Fourmi(Map* map,int posx,int posy, float size);
void hurt(int damages);
public:
+
+ const static TYPE::ENTITY DEFAULT_TYPE = TYPE::T_VOLANT;
+
Guepe(Map* map,int posx,int posy, float size);
void hurt(int damages);
public:
+
+ const static TYPE::ENTITY DEFAULT_TYPE = TYPE::T_VOLANT;
+
Moustique(Map* map,int posx,int posy, float size);
void hurt(int damages);
_waveTimerStep = 0;
// Vérifie s'il reste des vagues à produire
- if(_mapWaves.empty()){
+ if(_mapWaves.empty()){
+ if(_currentMap->getEnemyList().empty()) {
+
+ //!-- BLOC DE FIN DE PARTIE : Victoire
+ QMessageBox msgBox;
+ msgBox.setText("Fin de partie");
+ msgBox.setInformativeText("Vous avez gagné.");
+
+ QPushButton *restartButton = msgBox.addButton(tr("Rejouer"), QMessageBox::ActionRole);
+ QPushButton *quitButton = msgBox.addButton(tr("Quitter"), QMessageBox::ActionRole);
+ msgBox.exec();
+
+ if (msgBox.clickedButton() == (QAbstractButton *) restartButton) {
+
+ } else if (msgBox.clickedButton() == (QAbstractButton *) quitButton) {
+ exit(0);
+ }
+ // FIN DU BLOC --!
+
+
+ }
return;
}
#define ENEMYFACTORY_H
#include <QList>
-#include <QTimer>
#include <QString>
#include "map.h"
/**
* Initialisation des données du joueur
**/
- _player = new Player(999,10);
+ _player = new Player(22,10);
/**
* Création et chargement de la map
/// Boutons de choix de tourelle
// . Pistolet à eau
QObject::connect(ui->turretButton_PistoletAEau,SIGNAL(pressed()),_player,SLOT(setTurretChoice1()));
- QObject::connect(_player,SIGNAL(setTurret1ButtonDisabled(bool)),this->ui->turretButton_PistoletAEau,SLOT(setDisabled(bool)));
-
+ QObject::connect(_player,SIGNAL(setTurret1ButtonDisabled(bool)),ui->turretButton_PistoletAEau,SLOT(setDisabled(bool)));
+ // . Lance-pierres
+ QObject::connect(ui->turretButton_LancePierres,SIGNAL(pressed()),_player,SLOT(setTurretChoice2()));
+ QObject::connect(_player,SIGNAL(setTurret2ButtonDisabled(bool)),ui->turretButton_LancePierres,SLOT(setDisabled(bool)));
+ // . Paintball
+ QObject::connect(ui->turretButton_Paintball,SIGNAL(pressed()),_player,SLOT(setTurretChoice3()));
+ QObject::connect(_player,SIGNAL(setTurret3ButtonDisabled(bool)),ui->turretButton_Paintball,SLOT(setDisabled(bool)));
+ // . Pétanque
+ QObject::connect(ui->turretButton_Petanque,SIGNAL(pressed()),_player,SLOT(setTurretChoice4()));
+ QObject::connect(_player,SIGNAL(setTurret4ButtonDisabled(bool)),ui->turretButton_Petanque,SLOT(setDisabled(bool)));
// Demande d'informations sur une tourelle
QObject::connect(_sceneMap,SIGNAL(turretInfosRequest(QString)),ui->turretInfoLabel,SLOT(setText(QString)));
// Création du menu de choix de la tourelle
QMenu myMenu(this);
QAction* createTurret1 = myMenu.addAction("Pistolet a eau");
- myMenu.addAction("-- turret 2 --");
- myMenu.addAction("-- turret 3 --");
- myMenu.addAction("-- turret 4 --");
+ QAction* createTurret2 = myMenu.addAction("Lance-pierres");
+ QAction* createTurret3 = myMenu.addAction("Paintball");
+ QAction* createTurret4 = myMenu.addAction("Petanque");
myMenu.addAction("-- turret 5 --");
// On regarde si un choix a été effectué et si la case est libre pour la pose d'une tourelle
// TODO CHANGER ADD TURRET
if(selectedItem == createTurret1)
_sceneMap->addTurretAt(TYPE::PISTOLET_A_EAU,mousePos.x(),mousePos.y());
+ else if(selectedItem == createTurret2)
+ _sceneMap->addTurretAt(TYPE::LANCE_PIERRES,mousePos.x(),mousePos.y());
+ else if(selectedItem == createTurret3)
+ _sceneMap->addTurretAt(TYPE::PAINTBALL,mousePos.x(),mousePos.y());
+ else if(selectedItem == createTurret4)
+ _sceneMap->addTurretAt(TYPE::PETANQUE,mousePos.x(),mousePos.y());
}
}
<string>Pistolet à eau</string>
</property>
</widget>
+ <widget class="QPushButton" name="turretButton_LancePierres">
+ <property name="geometry">
+ <rect>
+ <x>130</x>
+ <y>30</y>
+ <width>98</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Lance-pierres</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="turretButton_Paintball">
+ <property name="geometry">
+ <rect>
+ <x>20</x>
+ <y>60</y>
+ <width>98</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>PaintBall</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="turretButton_Petanque">
+ <property name="geometry">
+ <rect>
+ <x>130</x>
+ <y>60</y>
+ <width>98</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Pétanque</string>
+ </property>
+ </widget>
</widget>
</item>
<item>
int i;
for(i = 0; i < _enemies.length() ; ++i) {
- if(_enemies[i] == ptr){
+ if(_enemies[i] == ptr) {
std::cout << "OMG je suis mort" << std::endl;
_enemies.removeAt(i);
// QObject::disconnect(ptr);
}
break;
+ // Lance-pierres
+ case TYPE::LANCE_PIERRES:
+ if(_player->payMoney(Slingshot::getBasicCost()))
+ {
+ enoughMoney = true;
+ newTurret = new Slingshot(((int)(mx/32))*32,
+ ((int)(my/32))*32,
+ 1,
+ this);
+ }
+ break;
+
+ // Paintball
+ case TYPE::PAINTBALL:
+ if(_player->payMoney(Paintball::getBasicCost()))
+ {
+ enoughMoney = true;
+ newTurret = new Paintball(((int)(mx/32))*32,
+ ((int)(my/32))*32,
+ 1,
+ this);
+ }
+ break;
+
+ // Pétanque
+ case TYPE::PETANQUE:
+ if(_player->payMoney(Bowling::getBasicCost()))
+ {
+ enoughMoney = true;
+ newTurret = new Bowling(((int)(mx/32))*32,
+ ((int)(my/32))*32,
+ 1,
+ this);
+ }
+ break;
+
// Type inconnu ~ erreur
default:
break;
// Désactive les boutons de tourelle
emit disableTurretUpgradeButton(true);
emit disableTurretSellButton(true);
+ // Met à jour l'affichage
+ this->update();
break;
}
// Si l'upgrade est maximale, on désactive le bouton d'upgrade
if(_turrets[i]->isLevelMax())
emit disableTurretUpgradeButton(true);
+
+ // Met à jour l'affichage
+ this->update();
}
break;
}
#include <QFile>
#include <QList>
+#include <QTimer>
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
#include <QMouseEvent>
// Fait perdre des vies au joueur
// ... et le compteur est notifié
_lives-=livesLost;
- if(_lives < 0)
+ if(_lives <= 0){
_lives = 0;
+ //!-- BLOC DE FIN DE PARTIE : Victoire
+ QMessageBox msgBox;
+ msgBox.setText("Fin de partie");
+ msgBox.setInformativeText("Vous avez perdu...");
+ QPushButton *restartButton = msgBox.addButton(tr("Rejouer"), QMessageBox::ActionRole);
+ QPushButton *quitButton = msgBox.addButton(tr("Quitter"), QMessageBox::ActionRole);
+ msgBox.exec();
+ if (msgBox.clickedButton() == (QAbstractButton *) restartButton) {
+
+ }
+ else if (msgBox.clickedButton() == (QAbstractButton *) quitButton)
+ exit(0);
+ // FIN DU BLOC --!
+ }
+
emit livesValueChanged(_lives);
}
case TYPE::PISTOLET_A_EAU :
emit setTurret1ButtonDisabled(false);
break;
+ case TYPE::LANCE_PIERRES :
+ emit setTurret2ButtonDisabled(false);
+ break;
+ case TYPE::PAINTBALL:
+ emit setTurret3ButtonDisabled(false);
+ break;
+ case TYPE::PETANQUE:
+ emit setTurret4ButtonDisabled(false);
+ break;
default:
break;
}
case TYPE::PISTOLET_A_EAU:
emit setTurret1ButtonDisabled(true);
break;
+ case TYPE::LANCE_PIERRES:
+ emit setTurret2ButtonDisabled(true);
+ break;
+ case TYPE::PAINTBALL:
+ emit setTurret3ButtonDisabled(true);
+ break;
+ case TYPE::PETANQUE:
+ emit setTurret4ButtonDisabled(true);
+ break;
default:
break;
}
}
void Player::setTurretChoice1(){this->setTurretChoice(TYPE::PISTOLET_A_EAU);}
+void Player::setTurretChoice2(){this->setTurretChoice(TYPE::LANCE_PIERRES);}
+void Player::setTurretChoice3(){this->setTurretChoice(TYPE::PAINTBALL);}
+void Player::setTurretChoice4(){this->setTurretChoice(TYPE::PETANQUE);}
#ifndef PLAYER_H
#define PLAYER_H
+#include <QMessageBox>
#include <QObject>
#include "types.h"
void loseLives(int livesLost);
void turretSold(int money);
void setTurretChoice1();
+ void setTurretChoice2();
+ void setTurretChoice3();
+ void setTurretChoice4();
signals:
void moneyValueChanged(int);
void livesValueChanged(int);
void setTurret1ButtonDisabled(bool);
+ void setTurret2ButtonDisabled(bool);
+ void setTurret3ButtonDisabled(bool);
+ void setTurret4ButtonDisabled(bool);
void turretSelected();
};
#include "map.h"
#include "projectile.h"
-Projectile::Projectile(float posX, float posY, float targetX, float targetY, float speed, int damages, Map* map)
- : Entity(posX,posY),_speed(speed),_damages(damages),_targetX(targetX),_targetY(targetY)
+/**
+* PROJECTILE
+**/
+
+Projectile::Projectile(float posX, float posY, float targetX, float targetY, int damages, Map* map)
+ : Entity(posX,posY),_damages(damages),_targetX(targetX),_targetY(targetY)
{
// Calcul du vecteur de déplacement du point (posX,posY) vers (targetX,targetY)
// .. Nb : on calcule ici le vecteur normalisé pour appliquer ensuite la vitesse propre à l'objet
return QRectF(0,0,5,5);
}
-void Projectile::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
+void Projectile::advance(int phase) {
+
+ if(!phase)
+ return;
+
+ // Collision avec ennemi
+ // . Recherche des ennemis de la map
+ QList<Enemy*> entities = _map->getEnemyList();
+ QList<Enemy*>::iterator i;
+ for(i = entities.begin(); i < entities.end() ; ++i) {
+ if(((*i)->getType() | _targetType) == _targetType &&
+ this->collidesWithItem(*i,Qt::IntersectsItemBoundingRect)){
+ // On retire le projectile de la scène
+ this->scene()->removeItem(this);
+ // Inflige des domages au monstre
+ Enemy *e = *i;
+ e->hurt(_damages);
+ return;
+ }
+ }
+
+
+
+ // Déplacement du projectile selon le vecteur de déplacement et la vitesse
+ float newx = this->x() + _speed*_movementVect.x();
+ float newy = this->y() + _speed*_movementVect.y();
+
+ // std::cout << "I'm still alive mothafucka" << std::endl;
+
+ // Si le projectile est en dehors de l'écran, on le supprime
+ if(newx < 0 || newx > 512 || newy < 0 || newy > 512){
+ _map->removeItem(this); // TODO VERIFIER Semble faire un appel à delete() de l'objet
+ return;
+ }
+ this->setPos(newx,newy);
+
+}
+
+/**
+* PROJECTILE WATER
+**/
+
+ProjectileWater::ProjectileWater(float posX,float posY,float targetX,float targetY,int damages, Map *map)
+ :Projectile(posX,posY,targetX,targetY,damages,map){
+ _targetType = DEFAULT_TARGET_TYPE;
+ _speed = DEFAULT_SPEED;
+}
+void ProjectileWater::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
+ // Dessine le projectile
painter->setBrush(QBrush(Qt::cyan));
- // Dessine la tourelle
painter->drawRect(0,0,5,5);
+}
+/**
+* PROJECTILE WATER
+**/
+ProjectileStone::ProjectileStone(float posX,float posY,float targetX,float targetY,int damages, Map *map)
+ :Projectile(posX,posY,targetX,targetY,damages,map){
+ _targetType = DEFAULT_TARGET_TYPE;
+ _speed = DEFAULT_SPEED;
}
-void Projectile::advance(int phase) {
+void ProjectileStone::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
+ // Dessine le projectile
+ painter->setBrush(QBrush(Qt::gray));
+ painter->drawRect(0,0,5,5);
+}
+
+
+/**
+* PROJECTILE PAINT BALL
+**/
+
+ProjectilePaintball::ProjectilePaintball(float posX,float posY,float targetX,float targetY,int damages, Map *map)
+ :Projectile(posX,posY,targetX,targetY,damages,map){
+ _targetType = DEFAULT_TARGET_TYPE;
+ _speed = DEFAULT_SPEED;
+}
+
+void ProjectilePaintball::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
+ // Dessine le projectile
+ painter->setBrush(QBrush(Qt::green));
+ painter->drawRect(0,0,5,5);
+}
+
+void ProjectilePaintball::advance(int phase) {
if(!phase)
return;
QList<Enemy*> entities = _map->getEnemyList();
QList<Enemy*>::iterator i;
for(i = entities.begin(); i < entities.end() ; ++i) {
- if(this->collidesWithItem(*i,Qt::IntersectsItemBoundingRect)){
+ if( ((*i)->getType() | _targetType) == _targetType
+ && this->collidesWithItem(*i,Qt::IntersectsItemBoundingRect)){
// On retire le projectile de la scène
this->scene()->removeItem(this);
- // Inflige des dommages au monstre
+ // Inflige des domages au monstre
Enemy *e = *i;
e->hurt(_damages);
+ // Ralenti également le monstre pendant 4 secondes
+ e->setSpeedMalus(0.5f,4);
+ return;
+ }
+ }
+
+
+
+ // Déplacement du projectile selon le vecteur de déplacement et la vitesse
+ float newx = this->x() + _speed*_movementVect.x();
+ float newy = this->y() + _speed*_movementVect.y();
+
+ // std::cout << "I'm still alive mothafucka" << std::endl;
+
+ // Si le projectile est en dehors de l'écran, on le supprime
+ if(newx < 0 || newx > 512 || newy < 0 || newy > 512){
+ _map->removeItem(this); // TODO VERIFIER Semble faire un appel à delete() de l'objet
+ return;
+ }
+ this->setPos(newx,newy);
+
+}
+
+
+/**
+* PROJECTILE BOWLING
+**/
+
+ProjectileBowling::ProjectileBowling(float posX,float posY,float targetX,float targetY,int damages, Map *map)
+ :Projectile(posX,posY,targetX,targetY,damages,map){
+ _targetType = DEFAULT_TARGET_TYPE;
+ _speed = DEFAULT_SPEED;
+}
+
+void ProjectileBowling::paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) {
+ // Dessine le projectile
+ painter->setBrush(QBrush(Qt::black));
+ painter->drawRect(0,0,5,5);
+}
+
+
+
+/**
+* Dommages de zone :
+* Les dommages de bases sont calculés de la sorte :
+* 15 * niveau ^ 1.5
+* Les dommages de zone sont calculés de la sorte :
+* 10 * niveau ^ 1.5
+* Afin d'économiser en calculs, on se base sur les dommages de base, multipliés par 10/15.
+**/
+void ProjectileBowling::advance(int phase) {
+
+ if(!phase)
+ return;
+
+ // Collision avec ennemi
+ // . Recherche des ennemis de la map
+ QList<Enemy*> entities = _map->getEnemyList();
+ QList<Enemy*>::iterator i;
+ for(i = entities.begin(); i < entities.end() ; ++i) {
+ if( ((*i)->getType() | _targetType) == _targetType &&
+ this->collidesWithItem(*i,Qt::IntersectsItemBoundingRect)) {
+
+
+ // Inflige des dommages à la cible...
+ Enemy *e = *i;
+ e->hurt(_damages);
+
+ // ... puis on recherche des ennemis à une case de distance qui seront également blessés
+ for(int j = 0 ; j < entities.size() ; ++j) {
+
+ float targetX = entities[j]->x();
+ float targetY = entities[j]->y();
+
+ if(entities[j] != e && sqrt(pow(fabs(this->x()-16 - targetX - ((*i)->getSize()-1)*16),2)
+ +pow(fabs(this->y()-16 - targetY - ((*i)->getSize()-1)*16),2)
+ ) <= 32)
+ {
+ entities[j]->hurt(_damages*10/15);
+ }
+
+ }
+ // On retire le projectile de la scène
+ this->scene()->removeItem(this);
+
return;
}
}
#include "entity.h"
#include "map.h"
+/**
+* PROJECTILE
+**/
class Map;
class Projectile : public Entity
{
+protected:
+
float _speed;
int _damages;
float _targetX;
float _targetY;
+ int _targetType; // Combinaison de TYPE::ENTITY
QPointF _movementVect;
Map* _map;
virtual void advance(int phase);
public:
+ Projectile(float posX,float posY,float targetX,float targetY,int damages, Map *map);
QRectF boundingRect() const;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*) = 0;
+
+
+
+};
+
+
+/**
+* PROJECTILE WATER
+**/
+
+class ProjectileWater : public Projectile {
+
+public:
+
+ // Caractéristiques
+ static const float DEFAULT_SPEED = 4;
+ static const int DEFAULT_TARGET_TYPE = TYPE::T_RAMPANT | TYPE::T_VOLANT;
+
+ ProjectileWater(float posX,float posY,float targetX,float targetY,int damages, Map *map);
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
+
+};
+
+
+/**
+* PROJECTILE STONE
+**/
+
+class ProjectileStone : public Projectile {
+
+public:
+
+ // Caractéristiques
+ static const float DEFAULT_SPEED = 2.5;
+ static const int DEFAULT_TARGET_TYPE = TYPE::T_VOLANT;
+
+
+ ProjectileStone(float posX,float posY,float targetX,float targetY,int damages, Map *map);
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
+
+};
+
+/**
+* PROJECTILE PAINT BALL
+**/
+class ProjectilePaintball : public Projectile {
+
+ // Méthode redéfinie pour l'effet spécial
+ void advance(int phase);
+
+public:
+
+ // Caractéristiques
+ static const float DEFAULT_SPEED = 3;
+ static const int DEFAULT_TARGET_TYPE = TYPE::T_RAMPANT | TYPE::T_VOLANT;
+
+
+ ProjectilePaintball(float posX,float posY,float targetX,float targetY,int damages, Map *map);
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
+
+};
+
+/**
+* PROJECTILE BOWLING
+**/
+class ProjectileBowling : public Projectile {
+
+ // Méthode redéfinie pour l'effet spécial
+ void advance(int phase);
+
+public:
+
+ // Caractéristiques
+ static const float DEFAULT_SPEED = 2;
+ static const int DEFAULT_TARGET_TYPE = TYPE::T_RAMPANT | TYPE::T_VOLANT;
- Projectile(float posX,float posY,float targetX,float targetY,float speed,int damages, Map *map);
+ ProjectileBowling(float posX,float posY,float targetX,float targetY,int damages, Map *map);
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *,QWidget*);
};
typedef enum { NORTH = 1 , SOUTH = 2 , EAST = 4 , WEST = 8, GOAL = 32, UP = 128 } DIRECTION;
typedef enum { T_RAMPANT = 1, T_VOLANT = 2 } ENTITY;
typedef enum { CAFARD , FOURMI , GUEPE , MOUSTIQUE } ENEMY;
-typedef enum { NONE, PISTOLET_A_EAU } TURRET;
+typedef enum { NONE, PISTOLET_A_EAU, LANCE_PIERRES, PAINTBALL, PETANQUE } TURRET;
};