towers_is_shot

This commit is contained in:
unknown
2010-08-29 14:41:27 +04:00
parent 8f9294c405
commit 26439849c8
18 changed files with 1767 additions and 2460 deletions

View File

@@ -1,254 +0,0 @@
<!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">ADeditor.pro</value>
</data>
<data>
<variable>RunConfiguration0-RunConfiguration.name</variable>
<value type="QString">ADeditor</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>
<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">2</value>
<value key="ToolChain" type="int">0</value>
<value key="buildConfiguration" type="int">2</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">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">/home/andrey/AD/aliendefender/ADeditor/ADeditor.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/andrey/AD/aliendefender/ADeditor</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</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/andrey/AD/aliendefender/ADeditor</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5VyjD99lFj,guid=cf0067cbadce72e8c9c0f05e4c74f11a</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-sQCAQN</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1112,unix/buull-eeePC:/tmp/.ICE-unix/1112</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1146</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-sQCAQN/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-QG4tiG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1282732313.174012-433654821</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">clean</value>
<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/andrey/AD/aliendefender/ADeditor</value>
<value key="cleanConfig" type="bool">true</value>
<valuelist key="makeargs" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
</valuemap>
</data>
<data>
<variable>buildconfigurations</variable>
<valuelist type="QVariantList">
<value type="QString">Debug</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>
</data>
<data>
<variable>project</variable>
<valuemap type="QVariantMap"/>
</data>
</qtcreator>

View File

@@ -1,64 +0,0 @@
<!DOCTYPE data>
<ADdata>
<aliens>
<alien flying="true" speed="0.03" imageType="31" prise="15" id="2" score="12" name="Monstr" health="150"/>
<alien flying="true" speed="0.01" imageType="-1078580008" prise="1" id="4" score="10" name="test" health="60"/>
<alien speed="0.06" imageType="1" prise="4" id="10" score="99" name="first" health="100"/>
<alien regeneration="3" speed="0.0099" imageType="1" prise="10" armor="1.5" id="12" score="99" name="MONSTR" health="99.99"/>
</aliens>
<maps>
<map width="16" imageType="1" height="16" id="1" data="AAAERHicY2BgEGAA4v///0hQgmFmAGlGcjCxZuCTHzUDuxkMDOr85JrBwKC0A8kMJlwYagYOeYgZ+NXgNwMtPEbNINIMIsynOO8DAG0r1Q0=" name="My Map" maxPlayers="2"/>
</maps>
<waves>
<wave prise="100" timeout="20000" id="1"/>
<wave prise="200" timeout="20000" id="2"/>
<wave prise="220" timeout="20000" id="3"/>
</waves>
<levels>
<level map="1" id="1" score="149859760" name="First Level"/>
</levels>
<waveParts>
<wavePart alien="10" count="4" wave="1"/>
<wavePart alien="12" count="5" wave="1"/>
<wavePart alien="10" count="10" wave="1"/>
<wavePart alien="10" count="9" wave="2"/>
<wavePart alien="10" count="1" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="12" count="4" wave="3"/>
</waveParts>
<wavesOnLevels>
<waveOnLevel wave="1" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="3" level="1"/>
</wavesOnLevels>
<splashes>
<splash speed="0.2" imageType="1" lifetime="9999" id="1" name="rocket"/>
<splash speed="0.2" imageType="1" lifetime="9999" autoControl="true" id="2" name="smart rocket"/>
<splash speed="100" imageType="2" lifetime="100" autoControl="true" id="3" name="bullet"/>
<splash speed="1" imageType="3" lifetime="10" id="4" name="bum"/>
<splash speed="0" imageType="4" lifetime="10" id="5" name="smoke"/>
</splashes>
<towers>
<tower imageType="1" radius="3" expByKill="0.1" expByShot="0.15" buildTime="50" splash="1" reload="20" id="1" name="rocket launcher" cost="30" expByDamage="0.04"/>
<tower imageType="2" radius="1.5" expByKill="0.2" expByShot="0.1" buildTime="25" splash="3" reload="5" id="2" name="gun" cost="10" expByDamage="0.1"/>
<tower imageType="1" radius="3" expByKill="0.1" expByShot="0.15" buildTime="50" splash="2" reload="20" id="3" name="rocket launcher 2" cost="30" expByDamage="0.04"/>
</towers>
<triggers>
<trigger damage="5" childAim="noAim" delParent="true" type="onDestination" id="2" name="shot"/>
<trigger damage="5" childAim="noAim" radius="1.5" delParent="true" count="1" type="onDestination" id="3" name="explosion"/>
<trigger childAim="noAim" count="1" type="onTimer" id="4" name="smoke"/>
</triggers>
<chains>
<chain tower="1" trigger="3" child="4" parent="1"/>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="2" trigger="2" parent="3"/>
<chain tower="3" trigger="3" child="4" parent="2"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
</chains>
<towersOnLevels>
<towerOnLevel tower="1" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="3" level="1"/>
</towersOnLevels>
</ADdata>

View File

@@ -1,227 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="ADdata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="aliens">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="alien" type="alienType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="maps">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="map" type="mapType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="waves">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="wave" type="waveType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="levels">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="level" type="levelType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="waveParts">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="wavePart" type="wavePartType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="wavesOnLevels">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="waveOnLevel" type="waveOnLevelType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="splashes">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="splash" type="splashType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="towers">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="tower" type="towerType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="triggers">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="trigger" type="triggerType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="chains">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="chain" type="chainType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="towersOnLevels">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="towerOnLevel" type="towerOnLevelType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="alienType">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="score" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="speed" type="xsd:float" use="required"/>
<xsd:attribute name="health" type="xsd:float" use="required"/>
<xsd:attribute name="prise" type="xsd:nonNegativeInteger" use="required"/>
<xsd:attribute name="imageType" type="xsd:integer" use="required"/>
<xsd:attribute name="armor" type="xsd:float" use="optional"/>
<xsd:attribute name="regeneration" type="xsd:float" use="optional"/>
<xsd:attribute name="flying" type="xsd:boolean" use="optional"/>
</xsd:complexType>
<xsd:complexType name="splashType">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="speed" type="xsd:float" use="required"/>
<xsd:attribute name="imageType" type="xsd:integer" use="required"/>
<xsd:attribute name="lifetime" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="autoControl" type="xsd:boolean" use="optional"/>
</xsd:complexType>
<xsd:complexType name="triggerType">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="count" type="xsd:positiveInteger" use="optional"/>
<xsd:attribute name="timer" type="xsd:positiveInteger" use="optional"/>
<xsd:attribute name="chance" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:positiveInteger">
<xsd:maxInclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="randomPosRadius" type="xsd:float" use="optional"/>
<xsd:attribute name="damage" type="xsd:float" use="optional"/>
<xsd:attribute name="radius" type="xsd:float" use="optional"/>
<xsd:attribute name="delParent" type="xsd:boolean" use="optional"/>
<xsd:attribute name="type" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="onDestination"/>
<xsd:enumeration value="onTimer"/>
<xsd:enumeration value="onAlienInRadius"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="childAim" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="noAim"/>
<xsd:enumeration value="parentAim"/>
<xsd:enumeration value="allSide"/>
<xsd:enumeration value="nearlestAlien"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="towerType">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="imageType" type="xsd:integer" use="required"/>
<xsd:attribute name="buildTime" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="cost" type="xsd:nonNegativeInteger" use="required"/>
<xsd:attribute name="splash" type="xsd:integer" use="required"/>
<xsd:attribute name="reload" type="xsd:nonNegativeInteger" use="required"/>
<xsd:attribute name="radius" type="xsd:float" use="required"/>
<xsd:attribute name="expByShot" type="xsd:float" use="optional"/>
<xsd:attribute name="expByKill" type="xsd:float" use="optional"/>
<xsd:attribute name="expByDamage" type="xsd:float" use="optional"/>
</xsd:complexType>
<xsd:complexType name="mapType">
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="maxPlayers" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="width" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="height" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="imageType" type="xsd:integer" use="required"/>
<xsd:attribute name="data" type="xsd:base64Binary" use="required"/>
</xsd:complexType>
<xsd:complexType name="morphType">
<xsd:attribute name="from" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="to" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="cost" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="expRequired" type="xsd:float" use="required"/>
</xsd:complexType>
<xsd:complexType name="upgradeType">
<xsd:attribute name="tower" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="trigger" type="xsd:positiveInteger" use="optional"/>
<xsd:attribute name="cost" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="radius" type="xsd:float" use="optional"/>
<xsd:attribute name="reload" type="xsd:positiveInteger" use="optional"/>
<xsd:attribute name="damage" type="xsd:float" use="optional"/>
<xsd:attribute name="damageRadius" type="xsd:float" use="optional"/>
</xsd:complexType>
<xsd:complexType name="wavePartType">
<xsd:attribute name="alien" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="wave" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="count" type="xsd:positiveInteger" use="required"/>
</xsd:complexType>
<xsd:complexType name="chainType">
<xsd:attribute name="tower" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="parent" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="trigger" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="child" type="xsd:positiveInteger" use="optional"/>
</xsd:complexType>
<xsd:complexType name="waveType">
<xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="timeout" type="xsd:nonNegativeInteger" use="required"/>
<xsd:attribute name="prise" type="xsd:nonNegativeInteger" use="required"/>
<!--xsd:attribute name="type" type="xsd:nonNegativeInteger" use="required"-->
</xsd:complexType>
<xsd:complexType name="waveOnLevelType">
<xsd:attribute name="level" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="wave" type="xsd:positiveInteger" use="required"/>
</xsd:complexType>
<xsd:complexType name="towerOnLevelType">
<xsd:attribute name="level" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="tower" type="xsd:positiveInteger" use="required"/>
<!--xsd:attribute name="enableWave" type="xsd:nonNegativeInteger" use="optional"-->
</xsd:complexType>
<xsd:complexType name="levelType">
<xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="map" type="xsd:nonNegativeInteger" use="required"/>
<xsd:attribute name="score" type="xsd:positiveInteger" use="required"/>
</xsd:complexType>
</xsd:schema>

View File

@@ -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<QPoint, TowerType>::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<int, AlienType>::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<int, SplashType>::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();
}
}

View File

@@ -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; i<qMin(admap->mapsize.width(),admap->mapsize.height()); i++)
// adtowers->AddTower(0,0,QPoint(i,i));
// for (int i=0; i<admap->mapsize.height();i++)
// adtowers->AddTower(1,0,QPoint(admap->mapsize.width()-2,i));
adtowers->addTower(0,1,QPoint(9,9));
for (int i=0; i<qMin(addata->map->rect().width(),addata->map->rect().height()); i++)
adtowers->addTower(0,1,QPoint(i,i));
for (int i=0; i<qMin(addata->map->rect().width(),addata->map->rect().height());i++)
adtowers->addTower(0,0,QPoint(addata->map->rect().width()-2,i));
waveInProgress = false;
startTimer(50);
}

View File

@@ -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:
};

View File

@@ -1,214 +1,113 @@
<!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">aliendefender.pro</value>
</data>
<data>
<variable>RunConfiguration0-RunConfiguration.name</variable>
<value type="QString">aliendefender</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>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<value key="QtVersionId" type="int">2</value>
<value key="ToolChain" type="int">0</value>
<value key="buildConfiguration" type="int">2</value>
<value key="EditorConfiguration.Codec" type="QByteArray">System</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-buildstep0</variable>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7vJZaf9AwI,guid=f26a2301f932cefdec6dd3bc4c79669f</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-U899U4</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1236,unix/buull-eeePC:/tmp/.ICE-unix/1236</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1270</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-U899U4/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-6T6AjI/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1283024543.354844-1194058895</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">/home/andrey/AD/aliendefender/aliendefender.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/andrey/AD/aliendefender</value>
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Настольный компьютер</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">qmake</value>
<value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
<valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7vJZaf9AwI,guid=f26a2301f932cefdec6dd3bc4c79669f</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-U899U4</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1236,unix/buull-eeePC:/tmp/.ICE-unix/1236</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1270</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-U899U4/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-6T6AjI/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1283024543.354844-1194058895</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/andrey/AD/aliendefender</value>
<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>
</data>
<data>
<variable>buildconfiguration-Debug-cleanstep0</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 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>
</data>
<data>
<variable>buildconfigurations</variable>
<valuelist type="QVariantList">
<value type="QString">Debug</value>
<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">Отладка</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">C:/Users/Andrey/Desktop/build-AD</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">9</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</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">qmake</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>
</data>
<data>
<variable>buildstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
<value key="mkspec" type="QString"></value>
<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">Релиз</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">C:/Users/Andrey/Desktop/aliendefender-build-desktop</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">9</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</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">aliendefender</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">aliendefender.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">true</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString">C:\Users\Andrey\Desktop\aliendefender</value>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap>
</data>
<data>
<variable>buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
</valuemap>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</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>
</data>
<data>
<variable>project</variable>
<valuemap type="QVariantMap"/>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">4</value>
</data>
</qtcreator>

View File

@@ -58,7 +58,6 @@
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<value key="QtVersionId" type="int">2</value>
<value key="ToolChain" type="int">0</value>
<value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">2</value>
</valuemap>
</data>
@@ -67,7 +66,7 @@
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd</value>
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7vJZaf9AwI,guid=f26a2301f932cefdec6dd3bc4c79669f</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
@@ -75,7 +74,7 @@
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-U899U4</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
@@ -86,17 +85,17 @@
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1236,unix/buull-eeePC:/tmp/.ICE-unix/1236</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1158</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh</value>
<value type="QString">SSH_AGENT_PID=1270</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-U899U4/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-6T6AjI/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1283024543.354844-1194058895</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">/home/andrey/AD/aliendefender/aliendefender.pro</value>
@@ -115,7 +114,7 @@
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd</value>
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7vJZaf9AwI,guid=f26a2301f932cefdec6dd3bc4c79669f</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
@@ -123,7 +122,7 @@
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-U899U4</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
@@ -134,17 +133,17 @@
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1236,unix/buull-eeePC:/tmp/.ICE-unix/1236</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1158</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh</value>
<value type="QString">SSH_AGENT_PID=1270</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-U899U4/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-6T6AjI/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1283024543.354844-1194058895</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
@@ -159,46 +158,6 @@
<variable>buildconfiguration-Debug-cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-5i8Go7nPio,guid=870ffe971971ceac89206f0e4c5facbd</value>
<value type="QString">DEFAULTS_PATH=/usr/share/gconf/gnome.default.path</value>
<value type="QString">DESKTOP_SESSION=gnome</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=gnome</value>
<value type="QString">GDM_KEYBOARD_LAYOUT=us</value>
<value type="QString">GDM_LANG=ru_RU.UTF-8</value>
<value type="QString">GNOME_DESKTOP_SESSION_ID=this-is-deprecated</value>
<value type="QString">GNOME_KEYRING_CONTROL=/tmp/keyring-7vXnOW</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/home/andrey</value>
<value type="QString">LANG=ru_RU.UTF-8</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator:</value>
<value type="QString">LOGNAME=andrey</value>
<value type="QString">MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path</value>
<value type="QString">ORBIT_SOCKETDIR=/tmp/orbit-andrey</value>
<value type="QString">PATH=/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games</value>
<value type="QString">PWD=/home/andrey</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SESSION_MANAGER=local/buull-eeePC:@/tmp/.ICE-unix/1124,unix/buull-eeePC:/tmp/.ICE-unix/1124</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SPEECHD_PORT=6561</value>
<value type="QString">SSH_AGENT_PID=1158</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/keyring-7vXnOW/ssh</value>
<value type="QString">USER=andrey</value>
<value type="QString">USERNAME=andrey</value>
<value type="QString">XAUTHORITY=/var/run/gdm/auth-for-andrey-HWCXAG/database</value>
<value type="QString">XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome:/etc/xdg</value>
<value type="QString">XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share/:/usr/share/</value>
<value type="QString">XDG_SESSION_COOKIE=f0649decca52f2beb55c9ea74ad1d028-1281338556.676663-803309736</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">clean</value>
<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/andrey/AD/aliendefender</value>
<value key="cleanConfig" type="bool">true</value>
<valuelist key="makeargs" type="QVariantList">
<value type="QString">clean</value>

View File

@@ -1,113 +0,0 @@
<!DOCTYPE QtCreatorProject>
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value key="EditorConfiguration.Codec" type="QByteArray">System</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Настольный компьютер</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">qmake</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">Отладка</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">C:/Users/Andrey/Desktop/aliendefender-build-desktop</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">9</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</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">qmake</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">Релиз</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">C:/Users/Andrey/Desktop/aliendefender-build-desktop</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">9</value>
<value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</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">aliendefender</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">aliendefender.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">true</value>
<value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString">C:\Users\Andrey\Desktop\aliendefender</value>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">4</value>
</data>
</qtcreator>

View File

@@ -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,30 +60,32 @@ void Aliens::update()
QList <int> missIndex;
for (QHash<int, AlienType>::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 (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)
@@ -105,6 +108,7 @@ void Aliens::update()
//gameData->curAliens.insert(al.id,al);
//qDebug() <<"alien"<< i << " path index=" << al.pathIndex << ", pos=" << al.pos;
}
}
for (int j=0; j<missIndex.size(); j++)
{
gameData->missingAliens++;

View File

@@ -151,4 +151,9 @@ inline uint qHash(const QPoint &pos)
}
inline float distance2(const QPointF &p1, const QPointF &p2)
{
return (p1.x()-p2.x())*(p1.x()-p2.x())+(p1.y()-p2.y())*(p1.y()-p2.y());
}
#endif // BASE_TYPES_H

View File

@@ -8,10 +8,10 @@
</aliens>
<maps>
<map width="16" imageType="1" height="16" id="1" data="AAAERHicY2BgEGAA4v///0hQgmFmAGlGcjCxZuCTHzUDuxkMDOr85JrBwKC0A8kMJlwYagYOeYgZ+NXgNwMtPEbNINIMIsynOO8DAG0r1Q0=" name="My Map" maxPlayers="2"/>
<map data="AAAJ3HicY2BgkGNgYBD5//+PBDGYgUGdnzh1EDOBNCM1MKlmEqNu1MxRM0fNHNxmgsobapnJwKC0Yyj5fdTMUTNHzRzaZpJgLwltMKUdxKgDADpycNA=" id="2" imageType="2" width="30" height="20" name="map2" maxPlayers="1"/>
<map width="30" imageType="2" height="20" id="2" data="AAAJ3HicY2BgkGNgYBD5//+PBDGYgUGdnzh1EDOBNCM1MKlmEqNu1MxRM0fNHNxmgsobapnJwKC0Yyj5fdTMUTNHzRzaZpJgLwltMKUdxKgDADpycNA=" name="map2" maxPlayers="1"/>
</maps>
<waves>
<wave prise="100" timeout="5" id="1"/>
<wave prise="100" timeout="10" id="1"/>
<wave prise="200" timeout="5" id="2"/>
<wave prise="220" timeout="5" id="3"/>
<wave prise="220" timeout="2" id="4"/>
@@ -24,54 +24,52 @@
<wave prise="220" timeout="5" id="11"/>
</waves>
<levels>
<level map="2" id="1" score="265630088" name="First Level"/>
<level map="2" id="1" score="258217400" name="First Level"/>
</levels>
<waveParts>
<wavePart alien="10" count="4" wave="1"/>
<wavePart alien="12" count="6" wave="1"/>
<wavePart alien="10" count="5" wave="1"/>
<wavePart alien="10" count="10" wave="1"/>
<wavePart alien="10" count="9" wave="2"/>
<wavePart alien="12" count="4" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="10" count="1" wave="3"/>
<wavePart alien="10" count="2" wave="3"/>
<wavePart alien="12" count="3" wave="3"/>
<wavePart alien="12" count="4" wave="3"/>
<wavePart alien="2" count="20" wave="4"/>
<wavePart alien="4" count="6" wave="5"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="12" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
<wavePart alien="4" count="1" wave="6"/>
<wavePart alien="10" count="1" wave="6"/>
</waveParts>
<wavesOnLevels>
<waveOnLevel wave="6" level="1"/>
<waveOnLevel wave="5" level="1"/>
<waveOnLevel wave="4" level="1"/>
<waveOnLevel wave="3" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="1" level="1"/>
<waveOnLevel wave="2" level="1"/>
<waveOnLevel wave="3" level="1"/>
<waveOnLevel wave="4" level="1"/>
<waveOnLevel wave="5" level="1"/>
<waveOnLevel wave="6" level="1"/>
</wavesOnLevels>
<splashes>
<splash speed="0.2" imageType="1" lifetime="9999" id="1" name="rocket"/>
<splash speed="0.2" imageType="1" lifetime="9999" autoControl="true" id="2" name="smart rocket"/>
<splash speed="100" imageType="2" lifetime="100" autoControl="true" id="3" name="bullet"/>
<splash speed="0.3" imageType="1" lifetime="9999" autoControl="true" id="2" name="smart rocket"/>
<splash speed="0.8" imageType="2" lifetime="100" autoControl="true" id="3" name="bullet"/>
<splash speed="1" imageType="3" lifetime="10" id="4" name="bum"/>
<splash speed="0" imageType="4" lifetime="10" id="5" name="smoke"/>
</splashes>
<towers>
<tower imageType="1" radius="3" expByKill="0.1" expByShot="0.15" buildTime="50" splash="1" reload="20" id="1" name="rocket launcher" cost="30" expByDamage="0.04"/>
<tower imageType="2" radius="1.5" expByKill="0.2" expByShot="0.1" buildTime="25" splash="3" reload="5" id="2" name="gun" cost="10" expByDamage="0.1"/>
<tower imageType="1" radius="3" expByKill="0.1" expByShot="0.15" buildTime="50" splash="2" reload="20" id="3" name="rocket launcher 2" cost="30" expByDamage="0.04"/>
<tower imageType="1" radius="10" expByKill="0.1" expByShot="0.15" buildTime="50" splash="1" reload="20" id="1" name="rocket launcher" cost="30" expByDamage="0.04"/>
<tower imageType="2" radius="5" expByKill="0.2" expByShot="0.1" buildTime="25" splash="3" reload="5" id="2" name="gun" cost="10" expByDamage="0.1"/>
<tower imageType="1" radius="10" expByKill="0.1" expByShot="0.15" buildTime="50" splash="2" reload="5" id="3" name="rocket launcher 2" cost="30" expByDamage="0.04"/>
</towers>
<triggers>
<trigger damage="5" childAim="noAim" delParent="true" type="onDestination" id="2" name="shot"/>
@@ -79,15 +77,15 @@
<trigger childAim="noAim" count="1" type="onTimer" id="4" name="smoke"/>
</triggers>
<chains>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="1" trigger="3" child="4" parent="1"/>
<chain tower="1" trigger="4" child="5" parent="1"/>
<chain tower="2" trigger="2" parent="3"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
<chain tower="3" trigger="3" child="4" parent="2"/>
<chain tower="3" trigger="4" child="5" parent="2"/>
</chains>
<towersOnLevels>
<towerOnLevel tower="3" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="1" level="1"/>
<towerOnLevel tower="2" level="1"/>
<towerOnLevel tower="3" level="1"/>
</towersOnLevels>
</ADdata>

View File

@@ -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; i<map->maxPlayers(); ++i)
gd->players.push_back(new Player(i));
QList <tbWaveOnLevel> wollist = levWaves.values(id);
if (wollist.isEmpty())
{
@@ -265,7 +268,7 @@ Game_Data * Loader::loadlevel(int id)
tbWavePart tbwpt;
QList <tbWavePart> wplist;
QList <int> alienIds;
for (int i=0; i<wollist.size(); i++)
for (int i=0; i<wollist.size(); ++i)
{
WaveType wt;
tbw = waves.value(wollist.at(i).waveId);
@@ -292,10 +295,10 @@ Game_Data * Loader::loadlevel(int id)
gd->waves.prepend(wt);
wplist.clear();
}
for (int i=0; i<gd->waves.size(); i++)
for (int i=0; i<gd->waves.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<alienIds.size(); i++)
for (int i=0; i<alienIds.size(); ++i)
{
srcAlienType salt;
tbAlien tbal = aliens.value(alienIds.at(i));
@@ -313,7 +316,7 @@ Game_Data * Loader::loadlevel(int id)
}
QList <tbTowerOnLevel> tollist = levTowers.values(id);
tbTower tbt;
for (int i=0; i<tollist.size(); i++)
for (int i=0; i<tollist.size(); ++i)
{
srcTowerType stt;
tbt = towers.value(tollist.at(i).towerId);
@@ -338,6 +341,8 @@ Game_Data * Loader::loadlevel(int id)
stt.splashes.append(sst);
int recursiveCheck = 1;
fillTowerChains(&chlist,&trigIds,&stt,tbt.splashId,0,&recursiveCheck);
for (int k=0; k<map->maxPlayers(); ++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;

30
map.cpp
View File

@@ -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<Starts.size(); i++) {
for (int j=0; j<Finishs.size(); j++) {
if (waveTrace(Starts.at(i),Finishs.at(j))<0) {
qDebug("AAAAAA");
Cells[pos.x()][pos.y()]=Player+playerId;
return false;
}
}
}
return true;
}
if (Cells[pos.x()][pos.y()]==AlienPath+playerId)
{
Cells[pos.x()][pos.y()]=PlayerTower-playerId;
bool ok=true;
for (int i=0; i<Starts.size(); i++)
for (int j=0; j<Finishs.size(); j++)
if (waveTrace(Starts.at(i),Finishs.at(j))<0) ok = false;
qDebug()<<"ok="<<ok;
if (!ok)
{
Cells[pos.x()][pos.y()]=AlienPath+playerId;
return false;
}
// bool ok=true;
// for (int i=0; i<Starts.size(); i++)
// for (int j=0; j<Finishs.size(); j++)
// if (waveTrace(Starts.at(i),Finishs.at(j))<0) ok = false;
// qDebug()<<"ok="<<ok;
// if (!ok)
// {
// Cells[pos.x()][pos.y()]=AlienPath+playerId;
// return false;
// }
//Cells[pos.x()][pos.y()]=PlayerTower-playerId;
bool * pathOK;
pathOK = new bool();

1
map.h
View File

@@ -43,6 +43,7 @@ public:
QList <QPoint> finishs() const {return Finishs;}
QVector < QVector <int> > cells() const {return Cells;}
int image() const {return imageType;}
int maxPlayers() const {return players;}
signals:
void recreateAlienPath(bool * pathOK);
public slots:

View File

@@ -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 <int> deadIndexes;
for (int i=0; i<gameData->curSplashes.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))
{
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);
spl.life++;
if (spl.life > src.lifetime)
{
deadIndexes.append(spl.id);
curDead = spl.id;
}
//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 (!isTowerSplash)
src = gameData->srcSplashes.at(spl.src);
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; j<deadIndexes.size(); j++)
//delAlien(missIndex.at(j));
delSplash(deadIndexes.at(j));
}
void Splashes::delSplash(int Id)
{
gameData->curSplashes.remove(Id);
}

View File

@@ -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<int, AlienType>::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;
}
}