diff --git a/ADeditor/ADeditor.pro.user.1.3 b/ADeditor/ADeditor.pro.user.1.3
deleted file mode 100644
index 0d3bdbf..0000000
--- a/ADeditor/ADeditor.pro.user.1.3
+++ /dev/null
@@ -1,254 +0,0 @@
-
-
-
- RunConfiguration0-BaseEnvironmentBase
- 2
-
-
- RunConfiguration0-CommandLineArguments
-
-
-
- RunConfiguration0-ProFile
- ADeditor.pro
-
-
- RunConfiguration0-RunConfiguration.name
- ADeditor
-
-
- RunConfiguration0-UseDyldImageSuffix
- false
-
-
- RunConfiguration0-UseTerminal
- false
-
-
- RunConfiguration0-UserEnvironmentChanges
-
-
-
- RunConfiguration0-UserSetName
- false
-
-
- RunConfiguration0-UserSetWorkingDirectory
- false
-
-
- RunConfiguration0-UserWorkingDirectory
-
-
-
- RunConfiguration0-type
- Qt4ProjectManager.Qt4RunConfiguration
-
-
- activeRunConfiguration
- 0
-
-
- activebuildconfiguration
- Debug
-
-
- buildConfiguration-Debug
-
- Debug
- 2
- 0
- 2
-
-
-
- buildconfiguration-Debug-buildstep0
-
- Debug
-
- DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a
- DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
- DESKTOP_SESSION=gnome
- DISPLAY=:0.0
- GDMSESSION=gnome
- GDM_KEYBOARD_LAYOUT=us
- GDM_LANG=ru_RU.UTF-8
- GNOME_DESKTOP_SESSION_ID=this-is-deprecated
- GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN
- GTK_MODULES=canberra-gtk-module
- HOME=/home/andrey
- LANG=ru_RU.UTF-8
- LD_LIBRARY_PATH=/usr/lib/qtcreator:
- LOGNAME=andrey
- MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
- ORBIT_SOCKETDIR=/tmp/orbit-andrey
- PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
- PWD=/home/andrey
- QTDIR=/usr/share/qt4
- SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112
- SHELL=/bin/bash
- SPEECHD_PORT=6561
- SSH_AGENT_PID=1146
- SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh
- USER=andrey
- USERNAME=andrey
- XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database
- XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
- XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
- XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821
-
-
- /home/andrey/AD/aliendefender/ADeditor/ADeditor.pro
- -spec
- linux-g++
- -r
- CONFIG+=debug
-
- /usr/bin/qmake-qt4
- false
- /home/andrey/AD/aliendefender/ADeditor
-
-
-
- buildconfiguration-Debug-buildstep1
-
- Debug
-
- DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a
- DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
- DESKTOP_SESSION=gnome
- DISPLAY=:0.0
- GDMSESSION=gnome
- GDM_KEYBOARD_LAYOUT=us
- GDM_LANG=ru_RU.UTF-8
- GNOME_DESKTOP_SESSION_ID=this-is-deprecated
- GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN
- GTK_MODULES=canberra-gtk-module
- HOME=/home/andrey
- LANG=ru_RU.UTF-8
- LD_LIBRARY_PATH=/usr/lib/qtcreator:
- LOGNAME=andrey
- MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
- ORBIT_SOCKETDIR=/tmp/orbit-andrey
- PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
- PWD=/home/andrey
- QTDIR=/usr/share/qt4
- SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112
- SHELL=/bin/bash
- SPEECHD_PORT=6561
- SSH_AGENT_PID=1146
- SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh
- USER=andrey
- USERNAME=andrey
- XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database
- XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
- XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
- XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821
-
- false
-
- -w
-
- /usr/bin/make
- true
- /home/andrey/AD/aliendefender/ADeditor
-
-
-
- buildconfiguration-Debug-cleanstep0
-
- Debug
-
- DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a
- DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
- DESKTOP_SESSION=gnome
- DISPLAY=:0.0
- GDMSESSION=gnome
- GDM_KEYBOARD_LAYOUT=us
- GDM_LANG=ru_RU.UTF-8
- GNOME_DESKTOP_SESSION_ID=this-is-deprecated
- GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN
- GTK_MODULES=canberra-gtk-module
- HOME=/home/andrey
- LANG=ru_RU.UTF-8
- LD_LIBRARY_PATH=/usr/lib/qtcreator:
- LOGNAME=andrey
- MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
- ORBIT_SOCKETDIR=/tmp/orbit-andrey
- PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
- PWD=/home/andrey
- QTDIR=/usr/share/qt4
- SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112
- SHELL=/bin/bash
- SPEECHD_PORT=6561
- SSH_AGENT_PID=1146
- SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh
- USER=andrey
- USERNAME=andrey
- XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database
- XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
- XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
- XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821
-
- true
-
- clean
- -w
-
- /usr/bin/make
- true
- /home/andrey/AD/aliendefender/ADeditor
- true
-
- clean
-
-
-
-
- buildconfigurations
-
- Debug
-
-
-
- buildstep0
-
-
-
-
-
-
- buildstep1
-
-
-
-
-
- buildsteps
-
- trolltech.qt4projectmanager.qmake
- trolltech.qt4projectmanager.make
-
-
-
- cleanstep0
-
-
- true
-
-
-
- cleansteps
-
- trolltech.qt4projectmanager.make
-
-
-
- defaultFileEncoding
- System
-
-
- project
-
-
-
diff --git a/ADeditor/mainwindow.ui b/ADeditor/mainwindow.ui
index 635189e..d473d22 100644
--- a/ADeditor/mainwindow.ui
+++ b/ADeditor/mainwindow.ui
@@ -1489,3 +1489,4 @@
+
diff --git a/ADeditor/schema.xml b/ADeditor/schema.xml
deleted file mode 100644
index 40f1986..0000000
--- a/ADeditor/schema.xml
+++ /dev/null
@@ -1,227 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/ad_graphics.cpp b/ad_graphics.cpp
index e1e35e3..fcf527b 100644
--- a/ad_graphics.cpp
+++ b/ad_graphics.cpp
@@ -11,7 +11,7 @@ AD_Graphics::AD_Graphics(AD_Core *adcore, QWidget *parent) : QGraphicsView(paren
setAlignment(Qt::AlignLeft | Qt::AlignTop);
scene = new QGraphicsScene();
setScene(scene);
- //setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
+ setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
//setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
//setDragMode(RubberBandDrag);
//gsw = new QGraphicsWidget();
@@ -55,10 +55,10 @@ void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
pen.setColor(Qt::black);
brush.setColor(Qt::black);
}
- if (cel <= Map::PlayerTower && cel !=Map::Wall) {
- pen.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
- brush.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
- }
+// if (cel <= Map::PlayerTower && cel !=Map::Wall) {
+// pen.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
+// brush.setColor(QColor(cel%255,(cel*100)%255,(cel+100)%255));
+// }
// if (cel >= Map::PlayerAlien) {
// pen.setColor(Qt::yellow);
// brush.setColor(Qt::yellow);
@@ -72,6 +72,23 @@ void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
p->drawRect(i*cellSize,j*cellSize,cellSize,cellSize);
}
}
+ for (QHash::iterator i = data->curTowers.begin(); i != data->curTowers.end(); ++i) {
+ //qDebug() << "draw alien";
+ //p->rotate(-90);
+ //p->scale(cellSize, cellSize);
+ //p->translate(rec.width()/2, rec.height()/2);
+ //p->rotate(-90);
+ //p->translate(-rec.height()/2, -rec.width()/2);
+ QBrush brush;
+ brush.setColor(Qt::darkGreen);
+ brush.setStyle(Qt::DiagCrossPattern);
+ p->translate((*i).pos * cellSize+QPointF(10,10));
+ p->rotate((*i).angle);
+ p->setPen(QColor(0,0,0,0));
+ p->setBrush(brush);
+ p->drawRect(QRect(-10,-10,20,20));
+ p->resetTransform();
+ }
for (QHash::iterator i = data->curAliens.begin(); i != data->curAliens.end(); ++i) {
//qDebug() << "draw alien";
//p->rotate(-90);
@@ -84,6 +101,23 @@ void AD_Graphics::drawBackground(QPainter * p, const QRectF & )
p->drawImage(QRect(-20,-20,40,40), images[itAliens][0]->at(0));
p->resetTransform();
}
+ for (QHash::iterator i = data->curSplashes.begin(); i != data->curSplashes.end(); ++i) {
+ //qDebug() << "draw alien";
+ //p->rotate(-90);
+ //p->scale(cellSize, cellSize);
+ //p->translate(rec.width()/2, rec.height()/2);
+ //p->rotate(-90);
+ //p->translate(-rec.height()/2, -rec.width()/2);
+ QBrush brush;
+ brush.setColor(Qt::red);
+ brush.setStyle(Qt::SolidPattern);
+ p->translate((*i).pos * cellSize+QPointF(10,10));
+ p->rotate((*i).angle);
+ p->setBrush(brush);
+ p->setPen(QColor(0,0,0,0));
+ p->drawEllipse(QPoint(),5,5);
+ p->resetTransform();
+ }
}
diff --git a/adcore.cpp b/adcore.cpp
index 444d359..3618daf 100644
--- a/adcore.cpp
+++ b/adcore.cpp
@@ -20,13 +20,15 @@ AD_Core::AD_Core(QObject *parent) :
adtowers = new Towers(addata);
adsplashes = new Splashes(addata);
connect(addata->map,SIGNAL(recreateAlienPath(bool*)),adaliens,SLOT(retrace(bool*)));
+ connect(adtowers,SIGNAL(shot(srcSplashType,int,TowerType)),adsplashes,SLOT(addSplash(srcSplashType,int,TowerType)));
// adaliens->addAlien(0);
// adaliens->AddAlien(0);
// adaliens->AddAlien(0);
-// for (int i=0; imapsize.width(),admap->mapsize.height()); i++)
-// adtowers->AddTower(0,0,QPoint(i,i));
-// for (int i=0; imapsize.height();i++)
-// adtowers->AddTower(1,0,QPoint(admap->mapsize.width()-2,i));
+ adtowers->addTower(0,1,QPoint(9,9));
+ for (int i=0; imap->rect().width(),addata->map->rect().height()); i++)
+ adtowers->addTower(0,1,QPoint(i,i));
+ for (int i=0; imap->rect().width(),addata->map->rect().height());i++)
+ adtowers->addTower(0,0,QPoint(addata->map->rect().width()-2,i));
waveInProgress = false;
startTimer(50);
}
diff --git a/adcore.h b/adcore.h
index b20b8d7..6e93294 100644
--- a/adcore.h
+++ b/adcore.h
@@ -12,7 +12,7 @@ class AD_Core : public QThread
{
Q_OBJECT
public:
- explicit AD_Core(QObject *parent = 0);
+ explicit AD_Core(QObject *parent = 0);
Game_Data * addata;
Aliens * adaliens;
Towers * adtowers;
@@ -29,7 +29,7 @@ private:
public slots:
void next();
void nextWave();
- void addTower(QPoint pos) {adtowers->addTower(0, 0, pos);};
+ //void addTower(QPoint pos) {adtowers->addTower(0, 0, pos);};
signals:
};
diff --git a/aliendefender.pro.user b/aliendefender.pro.user
index 71a2fb1..7122a0f 100644
--- a/aliendefender.pro.user
+++ b/aliendefender.pro.user
@@ -1,214 +1,113 @@
- RunConfiguration0-BaseEnvironmentBase
- 2
-
-
- RunConfiguration0-CommandLineArguments
-
-
-
- RunConfiguration0-ProFile
- aliendefender.pro
-
-
- RunConfiguration0-RunConfiguration.name
- aliendefender
-
-
- RunConfiguration0-UseDyldImageSuffix
- false
-
-
- RunConfiguration0-UseTerminal
- false
-
-
- RunConfiguration0-UserEnvironmentChanges
-
-
-
- RunConfiguration0-UserSetName
- false
-
-
- RunConfiguration0-UserSetWorkingDirectory
- false
-
-
- RunConfiguration0-UserWorkingDirectory
-
-
-
- RunConfiguration0-type
- Qt4ProjectManager.Qt4RunConfiguration
-
-
- activeRunConfiguration
+ ProjectExplorer.Project.ActiveTarget
0
- activebuildconfiguration
- Debug
-
-
- buildConfiguration-Debug
+ ProjectExplorer.Project.EditorSettings
- Debug
- 2
- 0
- 2
+ System
- buildconfiguration-Debug-buildstep0
+ ProjectExplorer.Project.Target.0
- Debug
-
- DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7vJZaf9AwI,guid=f26a2301f932cefdec6dd3bc4c79669f
- DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
- DESKTOP_SESSION=gnome
- DISPLAY=:0.0
- GDMSESSION=gnome
- GDM_KEYBOARD_LAYOUT=us
- GDM_LANG=ru_RU.UTF-8
- GNOME_DESKTOP_SESSION_ID=this-is-deprecated
- GNOME_KEYRING_CONTROL=/tmp/keyring-U899U4
- GTK_MODULES=canberra-gtk-module
- HOME=/home/andrey
- LANG=ru_RU.UTF-8
- LD_LIBRARY_PATH=/usr/lib/qtcreator:
- LOGNAME=andrey
- MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
- ORBIT_SOCKETDIR=/tmp/orbit-andrey
- PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
- PWD=/home/andrey
- QTDIR=/usr/share/qt4
- SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1236,unix/buull-eeePC:/tmp/.ICE-unix/1236
- SHELL=/bin/bash
- SPEECHD_PORT=6561
- SSH_AGENT_PID=1270
- SSH_AUTH_SOCK=/tmp/keyring-U899U4/ssh
- USER=andrey
- USERNAME=andrey
- XAUTHORITY=/var/run/gdm/auth-for-andrey-6T6AjI/database
- XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
- XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
- XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1283024543.354844-1194058895
-
-
- /home/andrey/AD/aliendefender/aliendefender.pro
- -spec
- linux-g++
- -r
- CONFIG+=debug
-
- /usr/bin/qmake-qt4
- false
- /home/andrey/AD/aliendefender
+ Настольный компьютер
+ Qt4ProjectManager.Target.DesktopTarget
+ 0
+ 0
+
+
+ qmake
+ QtProjectManager.QMakeBuildStep
+
+
+
+ Сборка
+ Qt4ProjectManager.MakeStep
+ false
+
+
+
+ 2
+
+ Сборка
+ Qt4ProjectManager.MakeStep
+ true
+
+ clean
+
+
+
+ 1
+ false
+
+ Отладка
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 2
+ C:/Users/Andrey/Desktop/build-AD
+ 9
+ 2
+ true
+
+
+
+ qmake
+ QtProjectManager.QMakeBuildStep
+
+
+
+ Сборка
+ Qt4ProjectManager.MakeStep
+ false
+
+
+
+ 2
+
+ Сборка
+ Qt4ProjectManager.MakeStep
+ true
+
+ clean
+
+
+
+ 1
+ false
+
+ Релиз
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+ C:/Users/Andrey/Desktop/aliendefender-build-desktop
+ 9
+ 2
+ true
+
+ 2
+
+ aliendefender
+ Qt4ProjectManager.Qt4RunConfiguration
+ 2
+
+ aliendefender.pro
+ false
+ false
+
+ false
+ true
+ C:\Users\Andrey\Desktop\aliendefender
+
+ 1
- buildconfiguration-Debug-buildstep1
-
- Debug
-
- DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7vJZaf9AwI,guid=f26a2301f932cefdec6dd3bc4c79669f
- DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
- DESKTOP_SESSION=gnome
- DISPLAY=:0.0
- GDMSESSION=gnome
- GDM_KEYBOARD_LAYOUT=us
- GDM_LANG=ru_RU.UTF-8
- GNOME_DESKTOP_SESSION_ID=this-is-deprecated
- GNOME_KEYRING_CONTROL=/tmp/keyring-U899U4
- GTK_MODULES=canberra-gtk-module
- HOME=/home/andrey
- LANG=ru_RU.UTF-8
- LD_LIBRARY_PATH=/usr/lib/qtcreator:
- LOGNAME=andrey
- MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
- ORBIT_SOCKETDIR=/tmp/orbit-andrey
- PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
- PWD=/home/andrey
- QTDIR=/usr/share/qt4
- SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1236,unix/buull-eeePC:/tmp/.ICE-unix/1236
- SHELL=/bin/bash
- SPEECHD_PORT=6561
- SSH_AGENT_PID=1270
- SSH_AUTH_SOCK=/tmp/keyring-U899U4/ssh
- USER=andrey
- USERNAME=andrey
- XAUTHORITY=/var/run/gdm/auth-for-andrey-6T6AjI/database
- XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
- XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
- XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1283024543.354844-1194058895
-
- false
-
- -w
-
- /usr/bin/make
- true
- /home/andrey/AD/aliendefender
-
+ ProjectExplorer.Project.TargetCount
+ 1
- buildconfiguration-Debug-cleanstep0
-
- Debug
- true
-
- clean
-
-
-
-
- buildconfigurations
-
- Debug
-
-
-
- buildstep0
-
-
-
-
-
-
- buildstep1
-
-
-
-
-
- buildsteps
-
- trolltech.qt4projectmanager.qmake
- trolltech.qt4projectmanager.make
-
-
-
- cleanstep0
-
-
- true
-
-
-
- cleansteps
-
- trolltech.qt4projectmanager.make
-
-
-
- defaultFileEncoding
- System
-
-
- project
-
+ ProjectExplorer.Project.Updater.FileVersion
+ 4
diff --git a/aliendefender.pro.user.1.3 b/aliendefender.pro.user.1.3
index d841b83..71a2fb1 100644
--- a/aliendefender.pro.user.1.3
+++ b/aliendefender.pro.user.1.3
@@ -58,7 +58,6 @@
Debug
2
0
-
2
@@ -67,7 +66,7 @@
Debug
- DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd
+ DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7vJZaf9AwI,guid=f26a2301f932cefdec6dd3bc4c79669f
DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
DESKTOP_SESSION=gnome
DISPLAY=:0.0
@@ -75,7 +74,7 @@
GDM_KEYBOARD_LAYOUT=us
GDM_LANG=ru_RU.UTF-8
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
- GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW
+ GNOME_KEYRING_CONTROL=/tmp/keyring-U899U4
GTK_MODULES=canberra-gtk-module
HOME=/home/andrey
LANG=ru_RU.UTF-8
@@ -86,17 +85,17 @@
PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PWD=/home/andrey
QTDIR=/usr/share/qt4
- SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124
+ SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1236,unix/buull-eeePC:/tmp/.ICE-unix/1236
SHELL=/bin/bash
SPEECHD_PORT=6561
- SSH_AGENT_PID=1158
- SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh
+ SSH_AGENT_PID=1270
+ SSH_AUTH_SOCK=/tmp/keyring-U899U4/ssh
USER=andrey
USERNAME=andrey
- XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database
+ XAUTHORITY=/var/run/gdm/auth-for-andrey-6T6AjI/database
XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
- XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736
+ XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1283024543.354844-1194058895
/home/andrey/AD/aliendefender/aliendefender.pro
@@ -115,7 +114,7 @@
Debug
- DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd
+ DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7vJZaf9AwI,guid=f26a2301f932cefdec6dd3bc4c79669f
DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
DESKTOP_SESSION=gnome
DISPLAY=:0.0
@@ -123,7 +122,7 @@
GDM_KEYBOARD_LAYOUT=us
GDM_LANG=ru_RU.UTF-8
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
- GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW
+ GNOME_KEYRING_CONTROL=/tmp/keyring-U899U4
GTK_MODULES=canberra-gtk-module
HOME=/home/andrey
LANG=ru_RU.UTF-8
@@ -134,17 +133,17 @@
PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PWD=/home/andrey
QTDIR=/usr/share/qt4
- SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124
+ SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1236,unix/buull-eeePC:/tmp/.ICE-unix/1236
SHELL=/bin/bash
SPEECHD_PORT=6561
- SSH_AGENT_PID=1158
- SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh
+ SSH_AGENT_PID=1270
+ SSH_AUTH_SOCK=/tmp/keyring-U899U4/ssh
USER=andrey
USERNAME=andrey
- XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database
+ XAUTHORITY=/var/run/gdm/auth-for-andrey-6T6AjI/database
XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
- XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736
+ XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1283024543.354844-1194058895
false
@@ -159,46 +158,6 @@
buildconfiguration-Debug-cleanstep0
Debug
-
- DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd
- DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
- DESKTOP_SESSION=gnome
- DISPLAY=:0.0
- GDMSESSION=gnome
- GDM_KEYBOARD_LAYOUT=us
- GDM_LANG=ru_RU.UTF-8
- GNOME_DESKTOP_SESSION_ID=this-is-deprecated
- GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW
- GTK_MODULES=canberra-gtk-module
- HOME=/home/andrey
- LANG=ru_RU.UTF-8
- LD_LIBRARY_PATH=/usr/lib/qtcreator:
- LOGNAME=andrey
- MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
- ORBIT_SOCKETDIR=/tmp/orbit-andrey
- PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
- PWD=/home/andrey
- QTDIR=/usr/share/qt4
- SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124
- SHELL=/bin/bash
- SPEECHD_PORT=6561
- SSH_AGENT_PID=1158
- SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh
- USER=andrey
- USERNAME=andrey
- XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database
- XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg
- XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/
- XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736
-
- true
-
- clean
- -w
-
- /usr/bin/make
- true
- /home/andrey/AD/aliendefender
true
clean
diff --git a/aliendefender.pro.user.2.2pre1 b/aliendefender.pro.user.2.2pre1
deleted file mode 100644
index b421708..0000000
--- a/aliendefender.pro.user.2.2pre1
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- System
-
-
-
- ProjectExplorer.Project.Target.0
-
- Настольный компьютер
- Qt4ProjectManager.Target.DesktopTarget
- 0
- 0
-
-
- qmake
- QtProjectManager.QMakeBuildStep
-
-
-
- Сборка
- Qt4ProjectManager.MakeStep
- false
-
-
-
- 2
-
- Сборка
- Qt4ProjectManager.MakeStep
- true
-
- clean
-
-
-
- 1
- false
-
- Отладка
- Qt4ProjectManager.Qt4BuildConfiguration
- 2
- C:/Users/Andrey/Desktop/aliendefender-build-desktop
- 9
- 2
- true
-
-
-
- qmake
- QtProjectManager.QMakeBuildStep
-
-
-
- Сборка
- Qt4ProjectManager.MakeStep
- false
-
-
-
- 2
-
- Сборка
- Qt4ProjectManager.MakeStep
- true
-
- clean
-
-
-
- 1
- false
-
- Релиз
- Qt4ProjectManager.Qt4BuildConfiguration
- 0
- C:/Users/Andrey/Desktop/aliendefender-build-desktop
- 9
- 2
- true
-
- 2
-
- aliendefender
- Qt4ProjectManager.Qt4RunConfiguration
- 2
-
- aliendefender.pro
- false
- false
-
- false
- true
- C:\Users\Andrey\Desktop\aliendefender
-
- 1
-
-
-
- ProjectExplorer.Project.TargetCount
- 1
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 4
-
-
diff --git a/aliens.cpp b/aliens.cpp
index 63e1ed1..35a4a03 100644
--- a/aliens.cpp
+++ b/aliens.cpp
@@ -23,6 +23,7 @@ void Aliens::addAlien(int srcId)
al.pos = QPointF(gameData->map->starts().at(qrand()%gameData->map->starts().size()));
al.path = gameData->map->createPath(al.pos.toPoint(),al.finish);
al.pathIndex = 1;
+ al.angle = 180.0f*(- std::atan2( al.pos.x() - al.path.at(al.pathIndex).x(),al.pos.y() - al.path.at(al.pathIndex).y()))/M_PI;
al.animIndex = 0.f;
if (al.path.isEmpty()) qFatal("ERROR create path");
//qDebug() << al.path;
@@ -59,33 +60,35 @@ void Aliens::update()
QList missIndex;
for (QHash::iterator i = gameData->curAliens.begin(); i != gameData->curAliens.end(); ++i)
{
- AlienType al = (*i);
+ //AlienType al = (*i);
//qDebug() << i;
//if (al.health < 0) emit AlienKill();
- float tmpdx,tmpdy,angl,arctg = 0;
- tmpdx = (*i).pos.x() - (*i).path.at((*i).pathIndex).x();
- tmpdy = (*i).pos.y() - (*i).path.at((*i).pathIndex).y();
- while (std::sqrt(tmpdx*tmpdx +tmpdy*tmpdy) < 2*(*i).speed)
+ float angl,arctg = 0;
+ int curMiss = -1;
+ while (distance2((*i).pos, (*i).path.at((*i).pathIndex)) < (*i).speed*(*i).speed)
{
(*i).pathIndex++;
if ((*i).pathIndex >= (*i).path.size())
{
qDebug() << tr("Missing aliens = %1!").arg(gameData->missingAliens);
missIndex.push_back((*i).id);
+ curMiss = (*i).id;
break;
}
/*{
PathIndex = 0;
position = game->start*game->cellsize;
}*/
- tmpdx = (*i).pos.x() - (*i).path.at((*i).pathIndex).x();
- tmpdy = (*i).pos.y() - (*i).path.at((*i).pathIndex).y();
+ // tmpdx = (*i).pos.x() - (*i).path.at((*i).pathIndex).x();
+ // tmpdy = (*i).pos.y() - (*i).path.at((*i).pathIndex).y();
//qDebug() << "next";
}
- arctg = std::atan2(tmpdx,tmpdy);
- //if (tmpdy < 0) arctg=arctg+M_PI;
- angl = 180.0f*(-arctg)/M_PI;
- /*if (PathIndex > 1)
+ if (curMiss < 0)
+ {
+ arctg = std::atan2((*i).pos.x() - (*i).path.at((*i).pathIndex).x(),(*i).pos.y() - (*i).path.at((*i).pathIndex).y());
+ //if (tmpdy < 0) arctg=arctg+M_PI;
+ angl = 180.0f*(-arctg)/M_PI;
+ /*if (PathIndex > 1)
{
if ((Position.angle-angl < -5 || Position.angle-angl > 5) && angl < 175 && angl > -175)
{
@@ -95,15 +98,16 @@ void Aliens::update()
else Position.angle = angl;
}
else*/
- (*i).angle = angl;
- //qDebug() << "[" << PathIndex << ";" << PicIndex << "]" << "angle:" << Position.angle << "arctg:" << arctg << "Pos:" << Position.pnt;
- (*i).pos.setX((*i).pos.x()
- -(*i).speed*std::sin(arctg));
- (*i).pos.setY((*i).pos.y()
- -(*i).speed*std::cos(arctg));
- //return true;
- //gameData->curAliens.insert(al.id,al);
- //qDebug() <<"alien"<< i << " path index=" << al.pathIndex << ", pos=" << al.pos;
+ (*i).angle = angl;
+ //qDebug() << "[" << PathIndex << ";" << PicIndex << "]" << "angle:" << Position.angle << "arctg:" << arctg << "Pos:" << Position.pnt;
+ (*i).pos.setX((*i).pos.x()
+ -(*i).speed*std::sin(arctg));
+ (*i).pos.setY((*i).pos.y()
+ -(*i).speed*std::cos(arctg));
+ //return true;
+ //gameData->curAliens.insert(al.id,al);
+ //qDebug() <<"alien"<< i << " path index=" << al.pathIndex << ", pos=" << al.pos;
+ }
}
for (int j=0; j
-
+
-
+
@@ -24,54 +24,52 @@
-
+
-
-
-
+
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
@@ -79,15 +77,15 @@
-
+
-
+
-
-
+
+
diff --git a/loader.cpp b/loader.cpp
index 89d01d3..88662b5 100644
--- a/loader.cpp
+++ b/loader.cpp
@@ -254,7 +254,10 @@ Game_Data * Loader::loadlevel(int id)
qDebug() << tr("Loading level %1 ...").arg(levels.value(id).name);
tbMap tbm = maps.value(levels.value(id).mapId);
Map * map = new Map(tbm.data,tbm.size,tbm.name,tbm.maxPlayers,tbm.imgType);
+ //int maxPlayers = map->maxPlayers();
Game_Data * gd = new Game_Data(map);
+ for (int i=0; imaxPlayers(); ++i)
+ gd->players.push_back(new Player(i));
QList wollist = levWaves.values(id);
if (wollist.isEmpty())
{
@@ -265,7 +268,7 @@ Game_Data * Loader::loadlevel(int id)
tbWavePart tbwpt;
QList wplist;
QList alienIds;
- for (int i=0; iwaves.prepend(wt);
wplist.clear();
}
- for (int i=0; iwaves.size(); i++)
+ for (int i=0; iwaves.size(); ++i)
qDebug() << tr("load wave #%1 prise=%2 timeout=%3").arg(i+1).arg(gd->waves.at(i).prise).arg(gd->waves.at(i).timeout) << gd->waves.at(i).types << gd->waves.at(i).counts;
wollist.clear();
- for (int i=0; i tollist = levTowers.values(id);
tbTower tbt;
- for (int i=0; imaxPlayers(); ++k)
+ gd->players[k]->srcTowers.append(stt);
qDebug() << tr("Tower %1 trig=%2 splash=%3").arg(stt.name).arg(stt.triggers.size()).arg(stt.splashes.size()) << tr("chain lenght %1").arg(recursiveCheck);
}
return gd;
diff --git a/map.cpp b/map.cpp
index 6617504..1e35539 100644
--- a/map.cpp
+++ b/map.cpp
@@ -80,27 +80,37 @@ void Map::removeAliensPath()
bool Map::addTowerOnMap(int playerId, QPoint pos)
{
+ qDebug() << pos;
if (playerId < 0 || playerId > players) return false;
QRect r(QPoint(),mapSize);
if (!r.contains(pos)) return false;
if (Cells[pos.x()][pos.y()]==Player+playerId)
{
Cells[pos.x()][pos.y()]=PlayerTower-playerId;
+ for (int i=0; i finishs() const {return Finishs;}
QVector < QVector > cells() const {return Cells;}
int image() const {return imageType;}
+ int maxPlayers() const {return players;}
signals:
void recreateAlienPath(bool * pathOK);
public slots:
diff --git a/splashes.cpp b/splashes.cpp
index 7e05c45..4d4e3ef 100644
--- a/splashes.cpp
+++ b/splashes.cpp
@@ -11,6 +11,7 @@ Splashes::Splashes(Game_Data *gd, QObject *parent) :
bool Splashes::addSplash(int srcId, QPointF pos)
{
+ qFatal("don't use this function addSplash(int srcId, QPointF pos)");
if (srcId < 0 || srcId >= gameData->srcSplashes.size())
{
qCritical("ERROR out of splashes range");
@@ -52,11 +53,11 @@ void Splashes::addSplash(srcSplashType src, int index, TowerType tw)
spl.TowerId = tw.pos;
if (!gameData->curAliens.contains(tw.aim))
qFatal("Error finding splash aim! Tower has nvalid aim!");
+ spl.destination = gameData->curAliens.value(tw.aim).pos;
if (src.autoControl)
spl.AlienId = tw.aim;
else
spl.AlienId = -1;
- spl.destination = gameData->curAliens.value(tw.aim).pos;
spl.angle = tw.angle;
spl.pos = tw.pos; // FIXME: pos not in center or left-angle of tower
spl.imgType = src.imgType;
@@ -76,26 +77,59 @@ void Splashes::addSplash(srcSplashType src, int index, TowerType tw)
void Splashes::update()
{
+ QList deadIndexes;
for (int i=0; icurSplashes.size(); i++)
{
+ int curDead = -1;
+ float arctg,angl;
SplashType spl = gameData->curSplashes.values().at(i);
- bool isTowerSplash = false;
+ //bool isTowerSplash = false;
srcSplashType src;
TowerType tw;
- if (gameData->map->rect().contains(spl.TowerId))
+ tw = gameData->curTowers.value(spl.TowerId);
+ src = gameData->players.at(tw.PlayerId)->srcTowers.at(tw.src).splashes.at(spl.src);
+ spl.life++;
+ if (spl.life > src.lifetime)
{
- if (gameData->curTowers.contains(spl.TowerId))
- {
- tw = gameData->curTowers.value(spl.TowerId);
- src = gameData->players.at(tw.PlayerId)->srcTowers.at(tw.src).splashes.at(spl.src);
- isTowerSplash = true;
- } else {
- spl.TowerId = QPoint(-1,-1);
- }
+ deadIndexes.append(spl.id);
+ curDead = spl.id;
}
- if (!isTowerSplash)
- src = gameData->srcSplashes.at(spl.src);
+ //isTowerSplash = true;
+ //if (!isTowerSplash)
+ // src = gameData->srcSplashes.at(spl.src);
+
+
+ if (distance2(spl.pos, spl.destination) < src.speed*src.speed)
+ {
+ deadIndexes.push_back(spl.id);
+ curDead = spl.id;
+ }
+ if (curDead < 0)
+ {
+ arctg = std::atan2(spl.pos.x() - spl.destination.x(),spl.pos.y() - spl.destination.y());
+ //if (tmpdy < 0) arctg=arctg+M_PI;
+ angl = 180.0f*(-arctg)/M_PI;
+
+ spl.angle = angl;
+
+ spl.pos.setX(spl.pos.x()
+ -src.speed*std::sin(arctg));
+ spl.pos.setY(spl.pos.y()
+ -src.speed*std::cos(arctg));
+ }
+
+
// TODO: calculate new angle and pos....
// TODO: activate trigger and more...
+ gameData->curSplashes.insert(spl.id,spl);
}
+ for (int j=0; jcurSplashes.remove(Id);
}
diff --git a/towers.cpp b/towers.cpp
index 531fe21..a1fdb1d 100644
--- a/towers.cpp
+++ b/towers.cpp
@@ -34,7 +34,8 @@ bool Towers::addTower(int playerId, int srcId, QPoint pos)
if (gameData->map->addTowerOnMap(playerId,pos))
{
tw.pos = pos;
- gameData->map->printMap();
+ qDebug() << "tw" << pos;
+ //gameData->map->printMap();
gameData->curTowers.insert(tw.pos,tw);
return true;
}
@@ -56,20 +57,28 @@ void Towers::update()
if ((*i).build < stw.buildTime)
{
(*i).build++;
+ qDebug() << "building tower ..." << (*i).build;
} else {
+ if (!(gameData->curAliens.contains((*i).aim)))
+ (*i).aim = -1;
+ else
+ {
+ if (distance2((*i).pos,gameData->curAliens.value((*i).aim).pos) > stw.radius*stw.radius)
+ (*i).aim = -1;
+ }
if (gameData->players.at((*i).PlayerId)->selectAlienId > 0)
{
AlienType al = gameData->curAliens.value(gameData->players.at((*i).PlayerId)->selectAlienId);
- float dist = (al.pos.x() - (*i).pos.x())*(al.pos.x() - (*i).pos.x()) + (al.pos.y() - (*i).pos.y())*(al.pos.y() - (*i).pos.y());
- if (dist < stw.radius) (*i).aim = al.id;
+ if (distance2(al.pos, (*i).pos) < stw.radius*stw.radius) (*i).aim = al.id;
}
if ((*i).aim < 0)
{
for (QHash::iterator j = gameData->curAliens.begin(); j != gameData->curAliens.end(); ++j)
{
- float dist = ((*j).pos.x() - (*i).pos.x())*((*j).pos.x() - (*i).pos.x()) + ((*j).pos.y() - (*i).pos.y())*((*j).pos.y() - (*i).pos.y());
- if (dist < stw.radius) (*i).aim = (*j).id;
- else (*i).aim = -1;
+ float dist = distance2((*i).pos, (*j).pos);
+ //qDebug() << "dist=" << dist << "radius=" << stw.radius*stw.radius;
+ if (dist < stw.radius*stw.radius) (*i).aim = (*j).id;
+ //else (*i).aim = -1;
}
}
// TODO: rotate tower to aim
@@ -78,8 +87,13 @@ void Towers::update()
else
{
if ((*i).aim > 0)
+ {
+ (*i).reload = 0;
emit shot(stw.splashes.at(0), 0, (*i));
+ qDebug("shot!");
+ }
}
}
+ qDebug() << "aim=" << (*i).aim;
}
}