[Orxonox-commit 4558] r9229 - in code/branches/presentation2012: . data/levels data/levels/includes data/levels/templates data/overlays src/modules src/modules/towerdefense src/modules/towerdefense/Spielfeld Blender src/modules/towerdefense/tower src/orxonox/controllers src/orxonox/worldentities
decapitb at orxonox.net
decapitb at orxonox.net
Wed May 23 13:07:30 CEST 2012
Author: decapitb
Date: 2012-05-23 13:07:29 +0200 (Wed, 23 May 2012)
New Revision: 9229
Added:
code/branches/presentation2012/.project
code/branches/presentation2012/data/levels/includes/towerWeaponSettings.oxi
code/branches/presentation2012/data/levels/templates/tower.oxt
code/branches/presentation2012/data/levels/towerDefense.oxw
code/branches/presentation2012/data/overlays/towerdefenseHUD.oxo
code/branches/presentation2012/src/modules/towerdefense/
code/branches/presentation2012/src/modules/towerdefense/CMakeLists.txt
code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/
code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/OgreXMLConverter.log
code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml
code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Spielfeld.blend
code/branches/presentation2012/src/modules/towerdefense/TDEnemy.h
code/branches/presentation2012/src/modules/towerdefense/Tower.cc
code/branches/presentation2012/src/modules/towerdefense/Tower.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefense.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefense.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefensePrereqs.h
code/branches/presentation2012/src/modules/towerdefense/tower/
code/branches/presentation2012/src/modules/towerdefense/tower/Tower.blend
code/branches/presentation2012/src/modules/towerdefense/tower/Tower.material
code/branches/presentation2012/src/modules/towerdefense/tower/Tower.mesh
code/branches/presentation2012/src/modules/towerdefense/towerdefensereadme.txt
Removed:
code/branches/presentation2012/src/modules/towerdefense/CMakeLists.txt
code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/
code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/OgreXMLConverter.log
code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml
code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Spielfeld.blend
code/branches/presentation2012/src/modules/towerdefense/TDEnemy.h
code/branches/presentation2012/src/modules/towerdefense/Tower.cc
code/branches/presentation2012/src/modules/towerdefense/Tower.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefense.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefense.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.cc
code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.h
code/branches/presentation2012/src/modules/towerdefense/TowerDefensePrereqs.h
code/branches/presentation2012/src/modules/towerdefense/tower/
code/branches/presentation2012/src/modules/towerdefense/tower/Tower.blend
code/branches/presentation2012/src/modules/towerdefense/tower/Tower.material
code/branches/presentation2012/src/modules/towerdefense/tower/Tower.mesh
code/branches/presentation2012/src/modules/towerdefense/towerdefensereadme.txt
Modified:
code/branches/presentation2012/
code/branches/presentation2012/data/levels/emptyLevel.oxw
code/branches/presentation2012/data/levels/portals.oxw
code/branches/presentation2012/data/levels/teamDeathMatch.oxw
code/branches/presentation2012/data/levels/templates/spaceshipPirate.oxt
code/branches/presentation2012/data/levels/theTimeMachine.oxw
code/branches/presentation2012/src/modules/CMakeLists.txt
code/branches/presentation2012/src/orxonox/controllers/FormationController.cc
code/branches/presentation2012/src/orxonox/controllers/WaypointController.cc
code/branches/presentation2012/src/orxonox/worldentities/WorldEntity.cc
Log:
merged towerdefense
Property changes on: code/branches/presentation2012
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacegate:9030-9215
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/tetris:8100-8563
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
/code/trunk:9189-9204
+ /code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/newlevel2012:9033-9228
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacegate:9030-9215
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/tetris:8100-8563
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
/code/trunk:9189-9204
Copied: code/branches/presentation2012/.project (from rev 9228, code/branches/newlevel2012/.project)
===================================================================
--- code/branches/presentation2012/.project (rev 0)
+++ code/branches/presentation2012/.project 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Orxonox-Source at newlevel2012</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Modified: code/branches/presentation2012/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/presentation2012/data/levels/emptyLevel.oxw 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/data/levels/emptyLevel.oxw 2012-05-23 11:07:29 UTC (rev 9229)
@@ -22,6 +22,7 @@
</templates>
<?lua include("includes/notifications.oxi") ?>
+
<Scene
ambientlight = "0.8, 0.8, 0.8"
skybox = "Orxonox/Starbox"
@@ -29,7 +30,8 @@
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
<SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff2 />
-
+
+
</Scene>
</Level>
Copied: code/branches/presentation2012/data/levels/includes/towerWeaponSettings.oxi (from rev 9228, code/branches/newlevel2012/data/levels/includes/towerWeaponSettings.oxi)
===================================================================
--- code/branches/presentation2012/data/levels/includes/towerWeaponSettings.oxi (rev 0)
+++ code/branches/presentation2012/data/levels/includes/towerWeaponSettings.oxi 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,55 @@
+ <weaponslots>
+ <WeaponSlot position="-15.0,-1.5,0" />
+ <WeaponSlot position=" 15.0,-1.5,0" />
+ <WeaponSlot position=" 0, 0,0" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+ <WeaponSet firemode=2 />
+ <WeaponSet firemode=3 />
+ </weaponsets>
+ <weapons>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
+ <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
+ </links>
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,0" scale=20/>
+ <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" scale=20 />
+ <Model mesh="hs-w01_reduced.mesh" roll="45" pitch="-76" yaw="-45" position="-1.5,1,200" scale=20 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0.005 damage=31.4159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=314.159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+ </Weapon>
+
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" />
+ <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+ </Weapon>
+ <Weapon>
+ <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ </Weapon>
+
+ </WeaponPack>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+ </links>
+ <!--Weapon>
+ <EnergyDrink mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare"muzzleoffset="2,-0.2,-1" />
+ </Weapon-->
+ </WeaponPack>
+ </weapons>
\ No newline at end of file
Modified: code/branches/presentation2012/data/levels/portals.oxw
===================================================================
--- code/branches/presentation2012/data/levels/portals.oxw 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/data/levels/portals.oxw 2012-05-23 11:07:29 UTC (rev 9229)
@@ -28,7 +28,7 @@
<Template name=PortalDefault>
<PortalEndPoint>
<attached>
- <Billboard material="Portals/Default" />
+ <Model mesh="Spacegate.mesh" yaw="90"/>
</attached>
</PortalEndPoint>
</Template>
Modified: code/branches/presentation2012/data/levels/teamDeathMatch.oxw
===================================================================
--- code/branches/presentation2012/data/levels/teamDeathMatch.oxw 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/data/levels/teamDeathMatch.oxw 2012-05-23 11:07:29 UTC (rev 9229)
@@ -24,7 +24,7 @@
<Scene
ambientlight = "0.7, 0.6, 0.6"
- skybox = "Orxonox/skypanoramagen1"
+ skybox = "Orxonox/creeper1"
>
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
Modified: code/branches/presentation2012/data/levels/templates/spaceshipPirate.oxt
===================================================================
--- code/branches/presentation2012/data/levels/templates/spaceshipPirate.oxt 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/data/levels/templates/spaceshipPirate.oxt 2012-05-23 11:07:29 UTC (rev 9229)
@@ -34,11 +34,12 @@
linearDamping = 0.7
angularDamping = 0.9999999
>
+
<engines>
<MultiStateEngine position=" 0, 0, 0" template=spaceshippirateengine />
</engines>
<attached>
- <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=4 mesh="pirate.mesh" />
+ <Model position="0,0,0" yaw=90 pitch=-90 roll=0 scale=20 mesh="pirate.mesh" />
<BlinkingBillboard position=" 12.7,-3.8,0" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 />
<BlinkingBillboard position="-12.7,-3.8,0" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 phase="90"/>
<BlinkingBillboard position=" 8.7,-0.5,2.5" material="Examples/Flare" colour="1.0, 1.0, 1" amplitude=0.04 frequency=1 quadratic=1 phase="30"/>
Copied: code/branches/presentation2012/data/levels/templates/tower.oxt (from rev 9228, code/branches/newlevel2012/data/levels/templates/tower.oxt)
===================================================================
--- code/branches/presentation2012/data/levels/templates/tower.oxt (rev 0)
+++ code/branches/presentation2012/data/levels/templates/tower.oxt 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,40 @@
+<Template name=tower>
+ <Tower
+
+
+ explosionchunks = 6
+
+ reloadrate = 1
+ reloadwaittime = 1
+
+ collisionType = "dynamic"
+ team = 2
+
+
+ >
+
+
+
+ <controller>
+ <WaypointPatrolController alertnessradius=10000 team=5>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=20 position=" 700, 200, 100" />
+ </waypoints>
+ </WaypointPatrolController>
+ </controller>
+
+
+ <attached>
+ <Model position="0,0,0" scale=45 mesh="Tower.mesh" />
+ </attached>
+
+ <!--collisionShapes>
+
+ </collisionShapes-->
+
+<?lua
+ include("../includes/towerWeaponSettings.oxi")
+?>
+ </Tower>
+</Template>
+
Modified: code/branches/presentation2012/data/levels/theTimeMachine.oxw
===================================================================
--- code/branches/presentation2012/data/levels/theTimeMachine.oxw 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/data/levels/theTimeMachine.oxw 2012-05-23 11:07:29 UTC (rev 9229)
@@ -58,6 +58,28 @@
</SpaceShip>
</Template>
+<Template name=spaceshipassffengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2
+
+ speedfront = 150
+ speedback = 50
+ speedleftright = 50
+ speedupdown = 50
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+
+ accelerationfront = 500
+ accelerationbrake = 500
+ accelerationback = 125
+ accelerationleftright = 125
+ accelerationupdown = 125
+ >
+
+ </MultiStateEngine>
+</Template>
+
<!--*****************************************************************************************************************************************************************************************-->
<Level
Copied: code/branches/presentation2012/data/levels/towerDefense.oxw (from rev 9228, code/branches/newlevel2012/data/levels/towerDefense.oxw)
===================================================================
--- code/branches/presentation2012/data/levels/towerDefense.oxw (rev 0)
+++ code/branches/presentation2012/data/levels/towerDefense.oxw 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,137 @@
+<!-- TODO: Update the level's image-->
+
+<!-- See TowerDefenseReadme.txt for Information on this file -->
+
+<LevelInfo
+ name = "Tower Defense"
+ description = "Defend your Spacestation from incoming waves."
+ tags = "gametype"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("towerdefenseHUD.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/tower.oxt")
+?>
+
+<!-- Specify the position of the camera -->
+<Template name=centerpointmarkcamera defaults=0>
+ <Pawn>
+ <camerapositions>
+ <CameraPosition position="0,0,2000"/>
+ </camerapositions>
+ </Pawn>
+</Template>
+
+<!-- Loads a mesh to mark the center-->
+<Template name=centerpointmark>
+ <Pawn camerapositiontemplate=centerpointmarkcamera>
+ <attached>
+ <Model position="0,0,0" mesh="cylinder.mesh" scale3D="1,1,1" /> <!-- the camera is attached to this -->
+ </attached>
+ </Pawn>
+</Template>
+
+
+<!-- Template for a tower EDIT: new towertemplate is included with "templates/tower" -->
+<!--Template name=towertemplate>
+ <Tower>
+ <attached>
+ <Model position="0,0,0" scale=0.25 mesh="Tower_ME.mesh" />
+ </attached>
+ </Tower>
+</Template-->
+
+
+
+
+
+<Level gametype = "TowerDefense">
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ >
+
+ <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+
+ <!-- Spawns the camera, attached to a crate -->
+ <SpawnPoint team=0 position="0,0,0" spawnclass=Pawn pawndesign=centerpointmark />
+ <!--TeamSpawnPoint team=1 position="-7,7,4" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff /-->
+
+ <!--SpawnPoint team=1 position="0,0,10" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /-->
+ <!--SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /-->
+
+ <SpaceShip position="-700,-500, 100" lookat="0,0,0" scale=2 team=1 >
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WaypointController accuracy=60>
+ <waypoints>
+ <!-- 1,3 10,3 10,11, 13,11 -->
+ <Model mesh="cube.mesh" scale=20 position="-700,-500, 100" />
+ <Model mesh="cube.mesh" scale=20 position=" 200,-500, 100" />
+ <Model mesh="cube.mesh" scale=20 position=" 200, 300, 100" />
+ <Model mesh="cube.mesh" scale=20 position=" 500, 300, 100" />
+ </waypoints>
+ </WaypointController>
+ </controller>
+ </SpaceShip>
+
+
+ <!--invisible entity to attach towers to, since playfield is static and towers are dynamic-->
+ <StaticEntity position=0,0,0>
+
+ <attached>
+ <Model position="-50,-50,0" mesh="Playfield_ME.mesh" scale=80 />
+ <!--Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /--> <!-- Only temporary needed to help align the collisionshape -->
+ <!-- This was used to mark the playfield, let's let it be here for now -->
+ <!--Model position="-8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+ <!--Model position="-8,-8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+ <!--Model position="8,-8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+ <!--Model position="8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /-->
+ </attached>
+ <collisionShapes> <!-- The collisionshape forbids other worldentities that have a collisionShape to fly through it.
+
+ TODO: Find correct size for the collisionshape; since a collisionShape is invisible
+ I added the crate wich currently has the same dimensions as the collisionshape.
+ You have to adjust the crate's scale3D as well as the collisionshape's halfExtens to
+ find the proper shape. -->
+ <BoxCollisionShape position="0,0,0" halfExtents="400,400,100" />
+ </collisionShapes>
+ </StaticEntity>
+
+
+
+
+ <!-- PlayField -->
+ <TowerDefenseCenterpoint
+ name=towerdefensecenter
+ width=16
+ height=16
+ tileScale=100
+ towerTemplate=tower
+ position="0,0,0"
+ direction="0,0,0"
+ collisionType=dynamic
+ mass=100000>
+
+ </TowerDefenseCenterpoint>
+
+ </Scene>
+</Level>
+
Copied: code/branches/presentation2012/data/overlays/towerdefenseHUD.oxo (from rev 9228, code/branches/newlevel2012/data/overlays/towerdefenseHUD.oxo)
===================================================================
--- code/branches/presentation2012/data/overlays/towerdefenseHUD.oxo (rev 0)
+++ code/branches/presentation2012/data/overlays/towerdefenseHUD.oxo 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,16 @@
+<Template name="TowerDefenseHUD">
+ <OverlayGroup name="TowerDefenseHUD" scale = "1, 1">
+ <OverlayText
+ position = "0.05, 0.05"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.05
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+
+ caption = "Hello World"
+ />
+
+
+ </OverlayGroup>
+</Template>
Modified: code/branches/presentation2012/src/modules/CMakeLists.txt
===================================================================
--- code/branches/presentation2012/src/modules/CMakeLists.txt 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/CMakeLists.txt 2012-05-23 11:07:29 UTC (rev 9229)
@@ -37,3 +37,4 @@
ADD_SUBDIRECTORY(tetris)
ADD_SUBDIRECTORY(weapons)
ADD_SUBDIRECTORY(docking)
+ADD_SUBDIRECTORY(towerdefense)
Deleted: code/branches/presentation2012/src/modules/towerdefense/CMakeLists.txt
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/CMakeLists.txt 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/CMakeLists.txt 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,17 +0,0 @@
-SET_SOURCE_FILES(TOWERDEFENSE_SRC_FILES
- TowerDefense.cc
- Tower.cc
- TowerDefenseCenterpoint.cc
- TowerDefenseHUDController.cc
- TowerDefensePlayerStats.cc
-
-)
-
-ORXONOX_ADD_LIBRARY(TowerDefense
- MODULE
- FIND_HEADER_FILES
- LINK_LIBRARIES
- orxonox
- overlays
- SOURCE_FILES ${TOWERDEFENSE_SRC_FILES}
-)
Copied: code/branches/presentation2012/src/modules/towerdefense/CMakeLists.txt (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/CMakeLists.txt)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/CMakeLists.txt (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/CMakeLists.txt 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,17 @@
+SET_SOURCE_FILES(TOWERDEFENSE_SRC_FILES
+ TowerDefense.cc
+ Tower.cc
+ TowerDefenseCenterpoint.cc
+ TowerDefenseHUDController.cc
+ TowerDefensePlayerStats.cc
+
+)
+
+ORXONOX_ADD_LIBRARY(TowerDefense
+ MODULE
+ FIND_HEADER_FILES
+ LINK_LIBRARIES
+ orxonox
+ overlays
+ SOURCE_FILES ${TOWERDEFENSE_SRC_FILES}
+)
Deleted: code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/OgreXMLConverter.log
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/Spielfeld Blender/OgreXMLConverter.log 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/OgreXMLConverter.log 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,31 +0,0 @@
-15:38:46: Creating resource group General
-15:38:46: Creating resource group Internal
-15:38:46: Creating resource group Autodetect
-15:38:46: Registering ResourceManager for type Mesh
-15:38:46: Registering ResourceManager for type Material
-15:38:46: Registering ResourceManager for type Skeleton
-15:38:46: XMLMeshSerializer reading mesh data from /home/mentzerf/mentzerf-extra-0/newlevel2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml...
-15:38:46: Reading submeshes...
-15:38:46: Reading geometry...
-15:38:46: Geometry done...
-15:38:46: Submeshes done.
-15:38:46: XMLMeshSerializer import successful.
-15:38:46: Reorganising vertex buffers to automatic layout..
-15:38:46: MeshSerializer writing mesh data to /home/mentzerf/mentzerf-extra-0/newlevel2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh...
-15:38:46: File header written.
-15:38:46: Writing mesh data...
-15:38:46: Writing submesh...
-15:38:46: Exporting submesh texture aliases...
-15:38:46: Submesh texture aliases exported.
-15:38:46: Submesh exported.
-15:38:46: Exporting bounds information....
-15:38:46: Bounds information exported.
-15:38:46: Exporting submesh name table...
-15:38:46: Submesh name table exported.
-15:38:46: Exporting edge lists...
-15:38:46: Edge lists exported
-15:38:46: Mesh data exported.
-15:38:46: MeshSerializer export successful.
-15:38:46: Unregistering ResourceManager for type Skeleton
-15:38:46: Unregistering ResourceManager for type Material
-15:38:46: Unregistering ResourceManager for type Mesh
Copied: code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/OgreXMLConverter.log (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/Spielfeld Blender/OgreXMLConverter.log)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/OgreXMLConverter.log (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/OgreXMLConverter.log 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,31 @@
+15:38:46: Creating resource group General
+15:38:46: Creating resource group Internal
+15:38:46: Creating resource group Autodetect
+15:38:46: Registering ResourceManager for type Mesh
+15:38:46: Registering ResourceManager for type Material
+15:38:46: Registering ResourceManager for type Skeleton
+15:38:46: XMLMeshSerializer reading mesh data from /home/mentzerf/mentzerf-extra-0/newlevel2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml...
+15:38:46: Reading submeshes...
+15:38:46: Reading geometry...
+15:38:46: Geometry done...
+15:38:46: Submeshes done.
+15:38:46: XMLMeshSerializer import successful.
+15:38:46: Reorganising vertex buffers to automatic layout..
+15:38:46: MeshSerializer writing mesh data to /home/mentzerf/mentzerf-extra-0/newlevel2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh...
+15:38:46: File header written.
+15:38:46: Writing mesh data...
+15:38:46: Writing submesh...
+15:38:46: Exporting submesh texture aliases...
+15:38:46: Submesh texture aliases exported.
+15:38:46: Submesh exported.
+15:38:46: Exporting bounds information....
+15:38:46: Bounds information exported.
+15:38:46: Exporting submesh name table...
+15:38:46: Submesh name table exported.
+15:38:46: Exporting edge lists...
+15:38:46: Edge lists exported
+15:38:46: Mesh data exported.
+15:38:46: MeshSerializer export successful.
+15:38:46: Unregistering ResourceManager for type Skeleton
+15:38:46: Unregistering ResourceManager for type Material
+15:38:46: Unregistering ResourceManager for type Mesh
Deleted: code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,144 +0,0 @@
-<mesh>
- <submeshes>
- <submesh material="PlayField" usesharedvertices="false">
- <faces count="12">
- <face v1="0" v2="1" v3="3"/>
- <face v1="1" v2="2" v3="3"/>
- <face v1="4" v2="5" v3="7"/>
- <face v1="5" v2="6" v3="7"/>
- <face v1="8" v2="9" v3="11"/>
- <face v1="9" v2="10" v3="11"/>
- <face v1="12" v2="13" v3="15"/>
- <face v1="13" v2="14" v3="15"/>
- <face v1="16" v2="17" v3="19"/>
- <face v1="17" v2="18" v3="19"/>
- <face v1="20" v2="21" v3="23"/>
- <face v1="21" v2="22" v3="23"/>
- </faces>
- <geometry vertexcount="24">
- <vertexbuffer positions="true" normals="true" texture_coords="1" texture_coord_dimensions_0="2">
- <vertex>
- <position x="10.000000" y="10.000000" z="-1.000000"/>
- <normal x="0.000000" y="-0.000000" z="-1.000000"/>
- <texcoord u="0.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="10.000000" y="-10.000000" z="-1.000000"/>
- <normal x="0.000000" y="-0.000000" z="-1.000000"/>
- <texcoord u="1.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="-10.000000" z="-1.000000"/>
- <normal x="0.000000" y="-0.000000" z="-1.000000"/>
- <texcoord u="1.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="10.000000" z="-1.000000"/>
- <normal x="0.000000" y="-0.000000" z="-1.000000"/>
- <texcoord u="0.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="10.000000" y="9.999999" z="1.000000"/>
- <normal x="0.000000" y="0.000000" z="1.000000"/>
- <texcoord u="1.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="10.000000" z="1.000000"/>
- <normal x="0.000000" y="0.000000" z="1.000000"/>
- <texcoord u="1.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="-10.000000" z="1.000000"/>
- <normal x="0.000000" y="0.000000" z="1.000000"/>
- <texcoord u="0.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="9.999999" y="-10.000000" z="1.000000"/>
- <normal x="0.000000" y="0.000000" z="1.000000"/>
- <texcoord u="0.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="10.000000" y="10.000000" z="-1.000000"/>
- <normal x="1.000000" y="-0.000000" z="-0.000000"/>
- <texcoord u="0.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="10.000000" y="9.999999" z="1.000000"/>
- <normal x="1.000000" y="-0.000000" z="-0.000000"/>
- <texcoord u="1.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="9.999999" y="-10.000000" z="1.000000"/>
- <normal x="1.000000" y="-0.000000" z="-0.000000"/>
- <texcoord u="1.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="10.000000" y="-10.000000" z="-1.000000"/>
- <normal x="1.000000" y="-0.000000" z="-0.000000"/>
- <texcoord u="0.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="10.000000" y="-10.000000" z="-1.000000"/>
- <normal x="0.000000" y="-1.000000" z="0.000000"/>
- <texcoord u="0.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="9.999999" y="-10.000000" z="1.000000"/>
- <normal x="0.000000" y="-1.000000" z="0.000000"/>
- <texcoord u="1.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="-10.000000" z="1.000000"/>
- <normal x="0.000000" y="-1.000000" z="0.000000"/>
- <texcoord u="1.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="-10.000000" z="-1.000000"/>
- <normal x="0.000000" y="-1.000000" z="0.000000"/>
- <texcoord u="0.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="-10.000000" z="-1.000000"/>
- <normal x="-1.000000" y="0.000000" z="0.000000"/>
- <texcoord u="0.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="-10.000000" z="1.000000"/>
- <normal x="-1.000000" y="0.000000" z="0.000000"/>
- <texcoord u="1.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="10.000000" z="1.000000"/>
- <normal x="-1.000000" y="0.000000" z="0.000000"/>
- <texcoord u="1.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="10.000000" z="-1.000000"/>
- <normal x="-1.000000" y="0.000000" z="0.000000"/>
- <texcoord u="0.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="10.000000" y="9.999999" z="1.000000"/>
- <normal x="0.000000" y="1.000000" z="0.000000"/>
- <texcoord u="0.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="10.000000" y="10.000000" z="-1.000000"/>
- <normal x="0.000000" y="1.000000" z="0.000000"/>
- <texcoord u="1.000000" v="1.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="10.000000" z="-1.000000"/>
- <normal x="0.000000" y="1.000000" z="0.000000"/>
- <texcoord u="1.000000" v="0.000000"/>
- </vertex>
- <vertex>
- <position x="-10.000000" y="10.000000" z="1.000000"/>
- <normal x="0.000000" y="1.000000" z="0.000000"/>
- <texcoord u="0.000000" v="0.000000"/>
- </vertex>
- </vertexbuffer>
- </geometry>
- </submesh>
- </submeshes>
-</mesh>
Copied: code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Playfield_ME.mesh.xml 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,144 @@
+<mesh>
+ <submeshes>
+ <submesh material="PlayField" usesharedvertices="false">
+ <faces count="12">
+ <face v1="0" v2="1" v3="3"/>
+ <face v1="1" v2="2" v3="3"/>
+ <face v1="4" v2="5" v3="7"/>
+ <face v1="5" v2="6" v3="7"/>
+ <face v1="8" v2="9" v3="11"/>
+ <face v1="9" v2="10" v3="11"/>
+ <face v1="12" v2="13" v3="15"/>
+ <face v1="13" v2="14" v3="15"/>
+ <face v1="16" v2="17" v3="19"/>
+ <face v1="17" v2="18" v3="19"/>
+ <face v1="20" v2="21" v3="23"/>
+ <face v1="21" v2="22" v3="23"/>
+ </faces>
+ <geometry vertexcount="24">
+ <vertexbuffer positions="true" normals="true" texture_coords="1" texture_coord_dimensions_0="2">
+ <vertex>
+ <position x="10.000000" y="10.000000" z="-1.000000"/>
+ <normal x="0.000000" y="-0.000000" z="-1.000000"/>
+ <texcoord u="0.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="10.000000" y="-10.000000" z="-1.000000"/>
+ <normal x="0.000000" y="-0.000000" z="-1.000000"/>
+ <texcoord u="1.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="-10.000000" z="-1.000000"/>
+ <normal x="0.000000" y="-0.000000" z="-1.000000"/>
+ <texcoord u="1.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="10.000000" z="-1.000000"/>
+ <normal x="0.000000" y="-0.000000" z="-1.000000"/>
+ <texcoord u="0.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="10.000000" y="9.999999" z="1.000000"/>
+ <normal x="0.000000" y="0.000000" z="1.000000"/>
+ <texcoord u="1.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="10.000000" z="1.000000"/>
+ <normal x="0.000000" y="0.000000" z="1.000000"/>
+ <texcoord u="1.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="-10.000000" z="1.000000"/>
+ <normal x="0.000000" y="0.000000" z="1.000000"/>
+ <texcoord u="0.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="9.999999" y="-10.000000" z="1.000000"/>
+ <normal x="0.000000" y="0.000000" z="1.000000"/>
+ <texcoord u="0.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="10.000000" y="10.000000" z="-1.000000"/>
+ <normal x="1.000000" y="-0.000000" z="-0.000000"/>
+ <texcoord u="0.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="10.000000" y="9.999999" z="1.000000"/>
+ <normal x="1.000000" y="-0.000000" z="-0.000000"/>
+ <texcoord u="1.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="9.999999" y="-10.000000" z="1.000000"/>
+ <normal x="1.000000" y="-0.000000" z="-0.000000"/>
+ <texcoord u="1.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="10.000000" y="-10.000000" z="-1.000000"/>
+ <normal x="1.000000" y="-0.000000" z="-0.000000"/>
+ <texcoord u="0.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="10.000000" y="-10.000000" z="-1.000000"/>
+ <normal x="0.000000" y="-1.000000" z="0.000000"/>
+ <texcoord u="0.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="9.999999" y="-10.000000" z="1.000000"/>
+ <normal x="0.000000" y="-1.000000" z="0.000000"/>
+ <texcoord u="1.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="-10.000000" z="1.000000"/>
+ <normal x="0.000000" y="-1.000000" z="0.000000"/>
+ <texcoord u="1.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="-10.000000" z="-1.000000"/>
+ <normal x="0.000000" y="-1.000000" z="0.000000"/>
+ <texcoord u="0.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="-10.000000" z="-1.000000"/>
+ <normal x="-1.000000" y="0.000000" z="0.000000"/>
+ <texcoord u="0.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="-10.000000" z="1.000000"/>
+ <normal x="-1.000000" y="0.000000" z="0.000000"/>
+ <texcoord u="1.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="10.000000" z="1.000000"/>
+ <normal x="-1.000000" y="0.000000" z="0.000000"/>
+ <texcoord u="1.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="10.000000" z="-1.000000"/>
+ <normal x="-1.000000" y="0.000000" z="0.000000"/>
+ <texcoord u="0.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="10.000000" y="9.999999" z="1.000000"/>
+ <normal x="0.000000" y="1.000000" z="0.000000"/>
+ <texcoord u="0.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="10.000000" y="10.000000" z="-1.000000"/>
+ <normal x="0.000000" y="1.000000" z="0.000000"/>
+ <texcoord u="1.000000" v="1.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="10.000000" z="-1.000000"/>
+ <normal x="0.000000" y="1.000000" z="0.000000"/>
+ <texcoord u="1.000000" v="0.000000"/>
+ </vertex>
+ <vertex>
+ <position x="-10.000000" y="10.000000" z="1.000000"/>
+ <normal x="0.000000" y="1.000000" z="0.000000"/>
+ <texcoord u="0.000000" v="0.000000"/>
+ </vertex>
+ </vertexbuffer>
+ </geometry>
+ </submesh>
+ </submeshes>
+</mesh>
Deleted: code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Spielfeld.blend
===================================================================
(Binary files differ)
Copied: code/branches/presentation2012/src/modules/towerdefense/Spielfeld Blender/Spielfeld.blend (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/Spielfeld Blender/Spielfeld.blend)
===================================================================
(Binary files differ)
Deleted: code/branches/presentation2012/src/modules/towerdefense/TDEnemy.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TDEnemy.h 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TDEnemy.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,26 +0,0 @@
-/*
- * TDEnemy.h
- *
- * Created on: Mar 30, 2012
- * Author: weigeltm
- */
-
-#ifndef TDENEMY_H_
-#define TDENEMY_H_
-
-class TDEnemy
-{
-
-private:
- float health;
- float speed;
- float armour;
-
-
-
-
-
-};
-
-
-#endif /* TDENEMY_H_ */
Copied: code/branches/presentation2012/src/modules/towerdefense/TDEnemy.h (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TDEnemy.h)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TDEnemy.h (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TDEnemy.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,26 @@
+/*
+ * TDEnemy.h
+ *
+ * Created on: Mar 30, 2012
+ * Author: weigeltm
+ */
+
+#ifndef TDENEMY_H_
+#define TDENEMY_H_
+
+class TDEnemy
+{
+
+private:
+ float health;
+ float speed;
+ float armour;
+
+
+
+
+
+};
+
+
+#endif /* TDENEMY_H_ */
Deleted: code/branches/presentation2012/src/modules/towerdefense/Tower.cc
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/Tower.cc 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/Tower.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,85 +0,0 @@
-//
-// Tower.cc
-// Orxonox
-//
-// Created by Fabian Mentzer on 29.04.12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-/* Not implemented fully */
-
-#include "Tower.h"
-
-#include "core/CoreIncludes.h"
-//#include "core/XMLPort.h"
-
-namespace orxonox
-{
- CreateFactory(Tower);
-
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
- Tower::Tower(BaseObject* creator) : SpaceShip(creator)
- {
- RegisterObject(Tower);
-
- this->setCollisionType(WorldEntity::Dynamic);
-
- //this->removeAllEngines();
-
- /*
- this->size_ = 10.0f;
- this->delay_ = false;
- this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this)));
- */
- }
- // This function is called whenever a player presses the up or the down key.
- // You have to implement what happens when the up or the down key is pressed.
- // value.x < 0 means: down key is pressed.
- // I suggest to create a new class which is a controllable entity I will refer to as "TowerMover". This is the controllable entity that the
- // player controls in order to move the tower along the centerpoint and in order to place the tower at the appropriate position.
- //
-
- // The tower itsself is controlled by a WayPointPatroController at the instance you place it on the centerpoint.
- //(don't forget to set the team_ parameter such that all tower are in the same team)
-
- //How to move a tower: simply attach the tower to the TowerMover
- //How to place a tower: detach the tower from the TowerMover
-
- /**
- @brief
- Overloaded the function to rotate the stone.
- @param value
- A vector whose first component is the angle by which to rotate.
- */
- void Tower::moveFrontBack(const Vector2& value)
- {
- //orxout() << "frontBack.x: " << value.x << endl;
- }
-
- /**
- @brief
- Overloaded the function to steer the stone right and left
- @param value
- A vector whose first component is the direction in which we want to steer the stone.
- */
- void Tower::moveRightLeft(const Vector2& value)
- {
- //orxout() << "rightLeft.x: " << value.x << endl;
- /*
- if(!this->delay_)
- {
- const Vector3& position = this->getPosition();
- Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
- if(!this->tetris_->isValidMove(this, newPos))
- return;
-
- this->setPosition(newPos);
- this->delay_ = true;
- this->delayTimer_.startTimer();
- }
- */
- }
-}
Copied: code/branches/presentation2012/src/modules/towerdefense/Tower.cc (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/Tower.cc)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/Tower.cc (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/Tower.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,85 @@
+//
+// Tower.cc
+// Orxonox
+//
+// Created by Fabian Mentzer on 29.04.12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+/* Not implemented fully */
+
+#include "Tower.h"
+
+#include "core/CoreIncludes.h"
+//#include "core/XMLPort.h"
+
+namespace orxonox
+{
+ CreateFactory(Tower);
+
+ /**
+ @brief
+ Constructor. Registers and initializes the object.
+ */
+ Tower::Tower(BaseObject* creator) : SpaceShip(creator)
+ {
+ RegisterObject(Tower);
+
+ this->setCollisionType(WorldEntity::Dynamic);
+
+ //this->removeAllEngines();
+
+ /*
+ this->size_ = 10.0f;
+ this->delay_ = false;
+ this->delayTimer_.setTimer(0.2f, false, createExecutor(createFunctor(&TetrisStone::enableMovement, this)));
+ */
+ }
+ // This function is called whenever a player presses the up or the down key.
+ // You have to implement what happens when the up or the down key is pressed.
+ // value.x < 0 means: down key is pressed.
+ // I suggest to create a new class which is a controllable entity I will refer to as "TowerMover". This is the controllable entity that the
+ // player controls in order to move the tower along the centerpoint and in order to place the tower at the appropriate position.
+ //
+
+ // The tower itsself is controlled by a WayPointPatroController at the instance you place it on the centerpoint.
+ //(don't forget to set the team_ parameter such that all tower are in the same team)
+
+ //How to move a tower: simply attach the tower to the TowerMover
+ //How to place a tower: detach the tower from the TowerMover
+
+ /**
+ @brief
+ Overloaded the function to rotate the stone.
+ @param value
+ A vector whose first component is the angle by which to rotate.
+ */
+ void Tower::moveFrontBack(const Vector2& value)
+ {
+ //orxout() << "frontBack.x: " << value.x << endl;
+ }
+
+ /**
+ @brief
+ Overloaded the function to steer the stone right and left
+ @param value
+ A vector whose first component is the direction in which we want to steer the stone.
+ */
+ void Tower::moveRightLeft(const Vector2& value)
+ {
+ //orxout() << "rightLeft.x: " << value.x << endl;
+ /*
+ if(!this->delay_)
+ {
+ const Vector3& position = this->getPosition();
+ Vector3 newPos = Vector3(position.x+value.x/abs(value.x)*this->size_, position.y, position.z);
+ if(!this->tetris_->isValidMove(this, newPos))
+ return;
+
+ this->setPosition(newPos);
+ this->delay_ = true;
+ this->delayTimer_.startTimer();
+ }
+ */
+ }
+}
Deleted: code/branches/presentation2012/src/modules/towerdefense/Tower.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/Tower.h 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/Tower.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,42 +0,0 @@
-//
-// Tower.h
-// Orxonox
-//
-// Created by Fabian Mentzer on 29.04.12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
-//
-
-/**
- at brief
-See TowerDefenseReadme.txt for Information.
-
- at ingroup TowerDefense
-*/
-
-
-#ifndef Orxonox_Tower_h
-#define Orxonox_Tower_h
-
-#include "towerdefense/TowerDefensePrereqs.h"
-#include "worldentities/pawns/SpaceShip.h"
-
-namespace orxonox
-{
- class _OrxonoxExport Tower : public SpaceShip
- {
- public:
- Tower(BaseObject* creator);
- virtual ~Tower() {};
-
- virtual void moveFrontBack(const Vector2& value);
- virtual void moveRightLeft(const Vector2& value);
-
- void setGame(TowerDefense* towerdefense)
- { assert(towerdefense); game_ = towerdefense; }
- private:
- TowerDefense* game_;
- };
-}
-
-
-#endif
Copied: code/branches/presentation2012/src/modules/towerdefense/Tower.h (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/Tower.h)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/Tower.h (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/Tower.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,42 @@
+//
+// Tower.h
+// Orxonox
+//
+// Created by Fabian Mentzer on 29.04.12.
+// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+/**
+ at brief
+See TowerDefenseReadme.txt for Information.
+
+ at ingroup TowerDefense
+*/
+
+
+#ifndef Orxonox_Tower_h
+#define Orxonox_Tower_h
+
+#include "towerdefense/TowerDefensePrereqs.h"
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+ class _OrxonoxExport Tower : public SpaceShip
+ {
+ public:
+ Tower(BaseObject* creator);
+ virtual ~Tower() {};
+
+ virtual void moveFrontBack(const Vector2& value);
+ virtual void moveRightLeft(const Vector2& value);
+
+ void setGame(TowerDefense* towerdefense)
+ { assert(towerdefense); game_ = towerdefense; }
+ private:
+ TowerDefense* game_;
+ };
+}
+
+
+#endif
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.cc 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefense.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,335 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- *
- * Co-authors:
- * ...
- *
- *NACHRICHT:
- *
- * Hier empfehle ich euch die gesamte Spielogik unter zu bringen. Viele Funktionen werden automatisch
- * bei gewissen Ereignissen aufgerufen bzw. lösen Ereignisse aus
- *
- *Z.B:
- * start() //wird aufgerufen, bevor das Spiel losgeht
- * end() //wenn man diese Funktion aufruft wird
- * pawnKilled() // wird aufgerufen, wenn ein Pawn stirbt (z.B: wenn )
- * playerScored() // kann man aufrufen um dem Spieler Punkte zu vergeben.
- *
- *
- *
- *TIPP: Eclipse hilft euch schnell auf bereits vorhanden Funktionen zuzugreifen:
- * einfach "this->" eingeben und kurz warten. Dann tauch eine Liste mit Vorschlägen auf. Wenn ihr jetzt weiter
- * tippt, werden die Vorschläge entsprechend gefiltert.
- *
- *
- *TIPP: schaut euch mal Tetris::createStone() an. Dort wird ein TetrisStone-Objekt (ControllableEntity) erzeugt,
- * ihm ein Template zugewiesen (welches vorher im Level definiert wurde und dem CenterPoint übergeben wurde)
- * Ähnlich könnt ihr vorgehen, um einen Turm zu erzeugen. (Zusätzlich braucht ein Turm noch einen Controller)
- * z.B: WaypointPatrolController. Wenn kein Team zugewiesen wurde bekämpft ein WaypointPatrolController alles,
- * was in seiner Reichweite liegt.
- *
- *
- *HUD:
- * Ein Gametype kann ein HUD (Head up Display haben.) Z.B: hat Pong eine Anzeige welcher Spieler wieviele Punkte hat.
- * Generell kann man a) Grafiken oder b) Zeichen in einer HUD anzeigen.
- * Fuer den ersten Schritt reicht reiner Text.
- *
- * a)
- * PongScore.cc uebernehmen und eigene Klasse draus machen.
- * Wenn ihr bloss anzeigen wollt wieviele Punkte der Spieler bereits erspielt hat (Punkte = Kapital fuer neue Tuerme) dann orientiert ihr euch an
- * TetrisScore.cc (im pCuts branch): http://www.orxonox.net/browser/code/branches/pCuts/src/modules/tetris/TetrisScore.cc
- * Ich habe TetrisScore lediglich dazu gebraucht, um eine Variable auf dem HUD auszugeben. Ein Objekt fuer statischen Text gibt es bereits.
- *
- * b)
- * Im naesten Schritt erstellt man die Vorlage fuer das HUD-Objekt: siehe /data/overlays/pongHUD
- * OverlayText ist eine Vorlage fuer statischen text zb: "Points Scored:". Aus mir nicht erklaerlichen Gruenden sollte man die OverlayText
- * Objekte immer erst nach dem PongScore anlegen.
- *
- * c) Im TowerDefense gamtype muss im Constructor noch das HUD-Template gesetzt werden.
- *
- * d) in CMakeLists.txt noch das Module includen das fuer die Overlays zustaendig ist. Siehe das gleiche File im Pong module.
- *
- *
- *
- */
-
-#include "TowerDefense.h"
-#include "Tower.h"
-#include "TowerDefenseCenterpoint.h"
-
-#include "worldentities/SpawnPoint.h"
-#include "worldentities/pawns/Pawn.h"
-#include "worldentities/pawns/SpaceShip.h"
-#include "controllers/WaypointController.h"
-
-#include "graphics/Model.h"
-#include "infos/PlayerInfo.h"
-
-#include "chat/ChatManager.h"
-
-/* Part of a temporary hack to allow the player to add towers */
-#include "core/command/ConsoleCommand.h"
-
-namespace orxonox
-{
- CreateUnloadableFactory(TowerDefense);
-
- TowerDefense::TowerDefense(BaseObject* creator) : Deathmatch(creator)
- {
- RegisterObject(TowerDefense);
-
- this->setHUDTemplate("TowerDefenseHUD");
-
- this->stats_ = new TowerDefensePlayerStats();
-
- /* Temporary hack to allow the player to add towers */
- this->dedicatedAddTower_ = createConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) );
-
- // Quick hack to test waypoints
- createConsoleCommand( "aw", createExecutor( createFunctor(&TowerDefense::addWaypointsAndFirstEnemy, this) ) );
- }
-
- TowerDefense::~TowerDefense()
- {
- /* Part of a temporary hack to allow the player to add towers */
- if (this->isInitialized())
- {
- if( this->dedicatedAddTower_ )
- delete this->dedicatedAddTower_;
- }
- }
-
- void TowerDefense::setCenterpoint(TowerDefenseCenterpoint *centerpoint)
- {
- orxout() << "Centerpoint now setting..." << endl;
- this->center_ = centerpoint;
- orxout() << "Centerpoint now set..." << endl;
- }
-
- void TowerDefense::start()
- {
- Deathmatch::start();
-
- orxout() << "Adding towers for debug..." << endl;
-
- // Mark corners
- addTower(0,15); addTower(15,0);
-
- // Mark diagonal line
- for (int i = 0 ; i <= 15; i++)
- addTower(i,i);
-
- orxout() << "Done" << endl;
-
- ChatManager::message("Use the console command addTower x y to add towers");
-
- //TODO: let the player control his controllable entity && TODO: create a new ControllableEntity for the player
-
- }
-
- void TowerDefense::end()
- {
- Deathmatch::end();
-
- ChatManager::message("Match is over");
- }
-
- void TowerDefense::addTower(int x, int y)
- {
- const TowerCost towerCost = TDDefaultTowerCost;
-
- if (!this->hasEnoughCreditForTower(towerCost))
- {
- orxout() << "not enough credit: " << (this->stats_->getCredit()) << " available, " << TDDefaultTowerCost << " needed.";
- return;
- }
-
- if (this->towerExists(x,y))
- {
- orxout() << "tower exists!!" << endl;
- return;
- }
-
- /*
- unsigned int width = this->center_->getWidth();
- unsigned int height = this->center_->getHeight();
- */
-
- int tileScale = (int) this->center_->getTileScale();
-
- if (x > 15 || y > 15 || x < 0 || y < 0)
- {
- //Hard coded: TODO: let this depend on the centerpoint's height, width and fieldsize (fieldsize doesn't exist yet)
- orxout() << "Can not add Tower: x and y should be between 0 and 15" << endl;
- return;
- }
-
- orxout() << "Will add tower at (" << (x-8) * tileScale << "," << (y-8) * tileScale << ")" << endl;
-
- // Add tower to coordinatesStack
- Coordinate newTowerCoordinates = {x, y};
- addedTowersCoordinates_.push_back(newTowerCoordinates);
-
- // Reduce credit
- this->stats_->buyTower(towerCost);
-
- // Create tower
- Tower* newTower = new Tower(this->center_);
- newTower->addTemplate(this->center_->getTowerTemplate());
-
- //this->center_->attach(newTower);
-
- newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 100);
- newTower->setGame(this);
- //TODO: Save the Tower in a Vector. I would suggest std::vector< std::vector<Tower*> > towers_ as a protected member variable;
-
- // TODO: create Tower mesh
- // TODO: load Tower mesh
- }
-
- bool TowerDefense::hasEnoughCreditForTower(TowerCost towerCost)
- {
- return ((this->stats_->getCredit()) >= towerCost);
- }
-
- bool TowerDefense::towerExists(int x, int y)
- {
- for(std::vector<Coordinate>::iterator it = addedTowersCoordinates_.begin(); it != addedTowersCoordinates_.end(); ++it)
- {
- Coordinate currentCoordinates = (Coordinate) (*it);
- if (currentCoordinates.x == x && currentCoordinates.y == y)
- return true;
- }
-
- return false;
- }
-
-
- void TowerDefense::tick(float dt)
- {
- SUPER(TowerDefense, tick, dt);
-
- static int test = 0;
- if (++test == 10)
- {
- orxout()<< "10th tick." <<endl;
- /*
- for (std::set<SpawnPoint*>::iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); it++)
- {
- orxout() << "checking spawnpoint with name " << (*it)->getSpawnClass()->getName() << endl;
- }
- */
-
- //addWaypointsAndFirstEnemy();
-
- }
- }
-
- // Function to test if we can add waypoints using code only. Doesn't work yet
-
- // THE PROBLEM: WaypointController's getControllableEntity() returns null, so it won't track. How do we get the controlableEntity to NOT BE NULL???
-
- void TowerDefense::addWaypointsAndFirstEnemy()
- {
- SpaceShip *newShip = new SpaceShip(this->center_);
- newShip->addTemplate("spaceshipassff");
-
- WaypointController *newController = new WaypointController(newShip);
- newController->setAccuracy(3);
-
- Model *wayPoint1 = new Model(newController);
- wayPoint1->setMeshSource("crate.mesh");
- wayPoint1->setPosition(7,-7,5);
- wayPoint1->setScale(0.2);
-
- Model *wayPoint2 = new Model(newController);
- wayPoint2->setMeshSource("crate.mesh");
- wayPoint2->setPosition(7,7,5);
- wayPoint2->setScale(0.2);
-
- newController->addWaypoint(wayPoint1);
- newController->addWaypoint(wayPoint2);
-
- // The following line causes the game to crash
-
- newShip->setController(newController);
-// newController -> getPlayer() -> startControl(newShip);
- newShip->setPosition(-7,-7,5);
- newShip->setScale(0.1);
- //newShip->addSpeed(1);
-
-
-
-// this->center_->attach(newShip);
- }
-
- /*
- void TowerDefense::playerEntered(PlayerInfo* player)
- {
- Deathmatch::playerEntered(player);
-
- const std::string& message = player->getName() + " entered the game";
- ChatManager::message(message);
- }
-
- bool TowerDefense::playerLeft(PlayerInfo* player)
- {
- bool valid_player = Deathmatch::playerLeft(player);
-
- if (valid_player)
- {
- const std::string& message = player->getName() + " left the game";
- ChatManager::message(message);
- }
-
- return valid_player;
- }
-
-
- void TowerDefense::pawnKilled(Pawn* victim, Pawn* killer)
- {
- if (victim && victim->getPlayer())
- {
- std::string message;
- if (killer)
- {
- if (killer->getPlayer())
- message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName();
- else
- message = victim->getPlayer()->getName() + " was killed";
- }
- else
- message = victim->getPlayer()->getName() + " died";
-
- ChatManager::message(message);
- }
-
- Deathmatch::pawnKilled(victim, killer);
- }
-
- void TowerDefense::playerScored(PlayerInfo* player)
- {
- Gametype::playerScored(player);
-
- }*/
-}
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefense.cc (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.cc)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefense.cc (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefense.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,335 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ *
+ * Co-authors:
+ * ...
+ *
+ *NACHRICHT:
+ *
+ * Hier empfehle ich euch die gesamte Spielogik unter zu bringen. Viele Funktionen werden automatisch
+ * bei gewissen Ereignissen aufgerufen bzw. lösen Ereignisse aus
+ *
+ *Z.B:
+ * start() //wird aufgerufen, bevor das Spiel losgeht
+ * end() //wenn man diese Funktion aufruft wird
+ * pawnKilled() // wird aufgerufen, wenn ein Pawn stirbt (z.B: wenn )
+ * playerScored() // kann man aufrufen um dem Spieler Punkte zu vergeben.
+ *
+ *
+ *
+ *TIPP: Eclipse hilft euch schnell auf bereits vorhanden Funktionen zuzugreifen:
+ * einfach "this->" eingeben und kurz warten. Dann tauch eine Liste mit Vorschlägen auf. Wenn ihr jetzt weiter
+ * tippt, werden die Vorschläge entsprechend gefiltert.
+ *
+ *
+ *TIPP: schaut euch mal Tetris::createStone() an. Dort wird ein TetrisStone-Objekt (ControllableEntity) erzeugt,
+ * ihm ein Template zugewiesen (welches vorher im Level definiert wurde und dem CenterPoint übergeben wurde)
+ * Ähnlich könnt ihr vorgehen, um einen Turm zu erzeugen. (Zusätzlich braucht ein Turm noch einen Controller)
+ * z.B: WaypointPatrolController. Wenn kein Team zugewiesen wurde bekämpft ein WaypointPatrolController alles,
+ * was in seiner Reichweite liegt.
+ *
+ *
+ *HUD:
+ * Ein Gametype kann ein HUD (Head up Display haben.) Z.B: hat Pong eine Anzeige welcher Spieler wieviele Punkte hat.
+ * Generell kann man a) Grafiken oder b) Zeichen in einer HUD anzeigen.
+ * Fuer den ersten Schritt reicht reiner Text.
+ *
+ * a)
+ * PongScore.cc uebernehmen und eigene Klasse draus machen.
+ * Wenn ihr bloss anzeigen wollt wieviele Punkte der Spieler bereits erspielt hat (Punkte = Kapital fuer neue Tuerme) dann orientiert ihr euch an
+ * TetrisScore.cc (im pCuts branch): http://www.orxonox.net/browser/code/branches/pCuts/src/modules/tetris/TetrisScore.cc
+ * Ich habe TetrisScore lediglich dazu gebraucht, um eine Variable auf dem HUD auszugeben. Ein Objekt fuer statischen Text gibt es bereits.
+ *
+ * b)
+ * Im naesten Schritt erstellt man die Vorlage fuer das HUD-Objekt: siehe /data/overlays/pongHUD
+ * OverlayText ist eine Vorlage fuer statischen text zb: "Points Scored:". Aus mir nicht erklaerlichen Gruenden sollte man die OverlayText
+ * Objekte immer erst nach dem PongScore anlegen.
+ *
+ * c) Im TowerDefense gamtype muss im Constructor noch das HUD-Template gesetzt werden.
+ *
+ * d) in CMakeLists.txt noch das Module includen das fuer die Overlays zustaendig ist. Siehe das gleiche File im Pong module.
+ *
+ *
+ *
+ */
+
+#include "TowerDefense.h"
+#include "Tower.h"
+#include "TowerDefenseCenterpoint.h"
+
+#include "worldentities/SpawnPoint.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/SpaceShip.h"
+#include "controllers/WaypointController.h"
+
+#include "graphics/Model.h"
+#include "infos/PlayerInfo.h"
+
+#include "chat/ChatManager.h"
+
+/* Part of a temporary hack to allow the player to add towers */
+#include "core/command/ConsoleCommand.h"
+
+namespace orxonox
+{
+ CreateUnloadableFactory(TowerDefense);
+
+ TowerDefense::TowerDefense(BaseObject* creator) : Deathmatch(creator)
+ {
+ RegisterObject(TowerDefense);
+
+ this->setHUDTemplate("TowerDefenseHUD");
+
+ this->stats_ = new TowerDefensePlayerStats();
+
+ /* Temporary hack to allow the player to add towers */
+ this->dedicatedAddTower_ = createConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) );
+
+ // Quick hack to test waypoints
+ createConsoleCommand( "aw", createExecutor( createFunctor(&TowerDefense::addWaypointsAndFirstEnemy, this) ) );
+ }
+
+ TowerDefense::~TowerDefense()
+ {
+ /* Part of a temporary hack to allow the player to add towers */
+ if (this->isInitialized())
+ {
+ if( this->dedicatedAddTower_ )
+ delete this->dedicatedAddTower_;
+ }
+ }
+
+ void TowerDefense::setCenterpoint(TowerDefenseCenterpoint *centerpoint)
+ {
+ orxout() << "Centerpoint now setting..." << endl;
+ this->center_ = centerpoint;
+ orxout() << "Centerpoint now set..." << endl;
+ }
+
+ void TowerDefense::start()
+ {
+ Deathmatch::start();
+
+ orxout() << "Adding towers for debug..." << endl;
+
+ // Mark corners
+ addTower(0,15); addTower(15,0);
+
+ // Mark diagonal line
+ for (int i = 0 ; i <= 15; i++)
+ addTower(i,i);
+
+ orxout() << "Done" << endl;
+
+ ChatManager::message("Use the console command addTower x y to add towers");
+
+ //TODO: let the player control his controllable entity && TODO: create a new ControllableEntity for the player
+
+ }
+
+ void TowerDefense::end()
+ {
+ Deathmatch::end();
+
+ ChatManager::message("Match is over");
+ }
+
+ void TowerDefense::addTower(int x, int y)
+ {
+ const TowerCost towerCost = TDDefaultTowerCost;
+
+ if (!this->hasEnoughCreditForTower(towerCost))
+ {
+ orxout() << "not enough credit: " << (this->stats_->getCredit()) << " available, " << TDDefaultTowerCost << " needed.";
+ return;
+ }
+
+ if (this->towerExists(x,y))
+ {
+ orxout() << "tower exists!!" << endl;
+ return;
+ }
+
+ /*
+ unsigned int width = this->center_->getWidth();
+ unsigned int height = this->center_->getHeight();
+ */
+
+ int tileScale = (int) this->center_->getTileScale();
+
+ if (x > 15 || y > 15 || x < 0 || y < 0)
+ {
+ //Hard coded: TODO: let this depend on the centerpoint's height, width and fieldsize (fieldsize doesn't exist yet)
+ orxout() << "Can not add Tower: x and y should be between 0 and 15" << endl;
+ return;
+ }
+
+ orxout() << "Will add tower at (" << (x-8) * tileScale << "," << (y-8) * tileScale << ")" << endl;
+
+ // Add tower to coordinatesStack
+ Coordinate newTowerCoordinates = {x, y};
+ addedTowersCoordinates_.push_back(newTowerCoordinates);
+
+ // Reduce credit
+ this->stats_->buyTower(towerCost);
+
+ // Create tower
+ Tower* newTower = new Tower(this->center_);
+ newTower->addTemplate(this->center_->getTowerTemplate());
+
+ //this->center_->attach(newTower);
+
+ newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 100);
+ newTower->setGame(this);
+ //TODO: Save the Tower in a Vector. I would suggest std::vector< std::vector<Tower*> > towers_ as a protected member variable;
+
+ // TODO: create Tower mesh
+ // TODO: load Tower mesh
+ }
+
+ bool TowerDefense::hasEnoughCreditForTower(TowerCost towerCost)
+ {
+ return ((this->stats_->getCredit()) >= towerCost);
+ }
+
+ bool TowerDefense::towerExists(int x, int y)
+ {
+ for(std::vector<Coordinate>::iterator it = addedTowersCoordinates_.begin(); it != addedTowersCoordinates_.end(); ++it)
+ {
+ Coordinate currentCoordinates = (Coordinate) (*it);
+ if (currentCoordinates.x == x && currentCoordinates.y == y)
+ return true;
+ }
+
+ return false;
+ }
+
+
+ void TowerDefense::tick(float dt)
+ {
+ SUPER(TowerDefense, tick, dt);
+
+ static int test = 0;
+ if (++test == 10)
+ {
+ orxout()<< "10th tick." <<endl;
+ /*
+ for (std::set<SpawnPoint*>::iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); it++)
+ {
+ orxout() << "checking spawnpoint with name " << (*it)->getSpawnClass()->getName() << endl;
+ }
+ */
+
+ //addWaypointsAndFirstEnemy();
+
+ }
+ }
+
+ // Function to test if we can add waypoints using code only. Doesn't work yet
+
+ // THE PROBLEM: WaypointController's getControllableEntity() returns null, so it won't track. How do we get the controlableEntity to NOT BE NULL???
+
+ void TowerDefense::addWaypointsAndFirstEnemy()
+ {
+ SpaceShip *newShip = new SpaceShip(this->center_);
+ newShip->addTemplate("spaceshipassff");
+
+ WaypointController *newController = new WaypointController(newShip);
+ newController->setAccuracy(3);
+
+ Model *wayPoint1 = new Model(newController);
+ wayPoint1->setMeshSource("crate.mesh");
+ wayPoint1->setPosition(7,-7,5);
+ wayPoint1->setScale(0.2);
+
+ Model *wayPoint2 = new Model(newController);
+ wayPoint2->setMeshSource("crate.mesh");
+ wayPoint2->setPosition(7,7,5);
+ wayPoint2->setScale(0.2);
+
+ newController->addWaypoint(wayPoint1);
+ newController->addWaypoint(wayPoint2);
+
+ // The following line causes the game to crash
+
+ newShip->setController(newController);
+// newController -> getPlayer() -> startControl(newShip);
+ newShip->setPosition(-7,-7,5);
+ newShip->setScale(0.1);
+ //newShip->addSpeed(1);
+
+
+
+// this->center_->attach(newShip);
+ }
+
+ /*
+ void TowerDefense::playerEntered(PlayerInfo* player)
+ {
+ Deathmatch::playerEntered(player);
+
+ const std::string& message = player->getName() + " entered the game";
+ ChatManager::message(message);
+ }
+
+ bool TowerDefense::playerLeft(PlayerInfo* player)
+ {
+ bool valid_player = Deathmatch::playerLeft(player);
+
+ if (valid_player)
+ {
+ const std::string& message = player->getName() + " left the game";
+ ChatManager::message(message);
+ }
+
+ return valid_player;
+ }
+
+
+ void TowerDefense::pawnKilled(Pawn* victim, Pawn* killer)
+ {
+ if (victim && victim->getPlayer())
+ {
+ std::string message;
+ if (killer)
+ {
+ if (killer->getPlayer())
+ message = victim->getPlayer()->getName() + " was killed by " + killer->getPlayer()->getName();
+ else
+ message = victim->getPlayer()->getName() + " was killed";
+ }
+ else
+ message = victim->getPlayer()->getName() + " died";
+
+ ChatManager::message(message);
+ }
+
+ Deathmatch::pawnKilled(victim, killer);
+ }
+
+ void TowerDefense::playerScored(PlayerInfo* player)
+ {
+ Gametype::playerScored(player);
+
+ }*/
+}
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefense.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.h 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefense.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,103 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- *
- * Co-authors:
- * ...
- *
- */
-
- /**
- @brief
- GameType class for TowerDefense. See TowerDefenseReadme.txt for Information.
-
- @ingroup TowerDefense
- */
-
-
-#ifndef _TowerDefense_H__
-#define _TowerDefense_H__
-
-#include "towerdefense/TowerDefensePrereqs.h"
-#include "gametypes/Deathmatch.h"
-
- #include "TowerDefensePlayerStats.h"
-
-namespace orxonox
-{
- class _OrxonoxExport TowerDefense : public Deathmatch
- {
- public:
- TowerDefense(BaseObject* creator);
- virtual ~TowerDefense();
-
- virtual void start(); //<! The function is called when the gametype starts
- virtual void end();
- virtual void tick(float dt);
- //virtual void playerEntered(PlayerInfo* player);
- //virtual bool playerLeft(PlayerInfo* player);
-
- //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
- //virtual void playerScored(PlayerInfo* player);
-
-
- /* Called by TowerDefenseCenterpoint upon game start
- The centerpoint is used to create towers
- */
- void setCenterpoint(TowerDefenseCenterpoint *centerpoint);
-
- /* Adds a tower at x, y in the playfield */
- void addTower(int x, int y);
-
- /* Part of a temporary hack to allow the player to add towers */
- ConsoleCommand* dedicatedAddTower_;
-
- //TODO: void spawnNewWave()
- //TODO: create a timer which regularly calls the spawnNewWave function (time driven)
- // or spawn a new wave when the old wave has been killed (event driven)
-
-
- private:
-// WeakPtr<TowerDefenseCenterpoint> center_;
- TowerDefenseCenterpoint *center_;
-
- /* handles stats */
- TowerDefensePlayerStats *stats_;
- bool hasEnoughCreditForTower(TowerCost towerCost);
-
- bool towerExists(int x, int y);
-
- typedef struct {
- int x;
- int y;
- } Coordinate;
-
-
-
- std::vector<Coordinate> addedTowersCoordinates_;
- std::vector<Tower*> towers_;
-
- void addWaypointsAndFirstEnemy();
- };
-}
-
-#endif /* _TowerDefense_H__ */
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefense.h (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.h)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefense.h (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefense.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,103 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ *
+ * Co-authors:
+ * ...
+ *
+ */
+
+ /**
+ @brief
+ GameType class for TowerDefense. See TowerDefenseReadme.txt for Information.
+
+ @ingroup TowerDefense
+ */
+
+
+#ifndef _TowerDefense_H__
+#define _TowerDefense_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+#include "gametypes/Deathmatch.h"
+
+ #include "TowerDefensePlayerStats.h"
+
+namespace orxonox
+{
+ class _OrxonoxExport TowerDefense : public Deathmatch
+ {
+ public:
+ TowerDefense(BaseObject* creator);
+ virtual ~TowerDefense();
+
+ virtual void start(); //<! The function is called when the gametype starts
+ virtual void end();
+ virtual void tick(float dt);
+ //virtual void playerEntered(PlayerInfo* player);
+ //virtual bool playerLeft(PlayerInfo* player);
+
+ //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+ //virtual void playerScored(PlayerInfo* player);
+
+
+ /* Called by TowerDefenseCenterpoint upon game start
+ The centerpoint is used to create towers
+ */
+ void setCenterpoint(TowerDefenseCenterpoint *centerpoint);
+
+ /* Adds a tower at x, y in the playfield */
+ void addTower(int x, int y);
+
+ /* Part of a temporary hack to allow the player to add towers */
+ ConsoleCommand* dedicatedAddTower_;
+
+ //TODO: void spawnNewWave()
+ //TODO: create a timer which regularly calls the spawnNewWave function (time driven)
+ // or spawn a new wave when the old wave has been killed (event driven)
+
+
+ private:
+// WeakPtr<TowerDefenseCenterpoint> center_;
+ TowerDefenseCenterpoint *center_;
+
+ /* handles stats */
+ TowerDefensePlayerStats *stats_;
+ bool hasEnoughCreditForTower(TowerCost towerCost);
+
+ bool towerExists(int x, int y);
+
+ typedef struct {
+ int x;
+ int y;
+ } Coordinate;
+
+
+
+ std::vector<Coordinate> addedTowersCoordinates_;
+ std::vector<Tower*> towers_;
+
+ void addWaypointsAndFirstEnemy();
+ };
+}
+
+#endif /* _TowerDefense_H__ */
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,109 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * ...
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file TowerDefenseCenterpoint.cc
- @brief Implementation of the TowerDefenseCenterpoint class.
-*/
-
-#include "TowerDefenseCenterpoint.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-
-#include "TowerDefense.h"
-
-namespace orxonox
-{
- CreateFactory(TowerDefenseCenterpoint);
-
- /**
- @brief
- Constructor. Registers and initializes the object and checks whether the gametype is actually TowerDefense.
- */
- TowerDefenseCenterpoint::TowerDefenseCenterpoint(BaseObject* creator) : MobileEntity(creator)
- {
- RegisterObject(TowerDefenseCenterpoint);
-
- this->width_ = 15;
- this->height_ = 15;
- this->towerTemplate_ = "";
-
- //this->setCollisionType(Static);
-
- this->checkGametype();
-
- }
-
- /**
- @brief
- Method to create a TowerDefenseCenterpoint through XML.
- */
- void TowerDefenseCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- SUPER(TowerDefenseCenterpoint, XMLPort, xmlelement, mode);
-
- XMLPortParam(TowerDefenseCenterpoint, "width", setWidth, getWidth, xmlelement, mode);
- XMLPortParam(TowerDefenseCenterpoint, "height", setHeight, getHeight, xmlelement, mode);
- XMLPortParam(TowerDefenseCenterpoint, "tileScale", setTileScale, getTileScale, xmlelement, mode);
- XMLPortParam(TowerDefenseCenterpoint, "towerTemplate", setTowerTemplate, getTowerTemplate, xmlelement, mode);
-
- //TODO: add XMLPortObject(TowerDefenseCenterpoint, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);
- // This was copied and shightly modified from WaypointController.cc ; there are no getters and setters and no membervariable yet
- // The centerpoint should have all waypoints for "attached" to it. By using this function you can seperately add waypoints
- // When you spawn a new enemy you should let it be controlled by a WaypointController. And that controller should get the waypoints.
-
- // Alternatively you can manage the waypoints directly in TowerDefense.cc
- }
-
- /**
- @brief
- Is called when the gametype has changed.
- */
- void TowerDefenseCenterpoint::changedGametype()
- {
- SUPER(TowerDefenseCenterpoint, changedGametype);
-
- // Check, whether it's still TowerDefense.
- this->checkGametype();
- }
-
- /**
- @brief
- Checks whether the gametype is TowerDefense and if it is, sets its centerpoint.
- */
- void TowerDefenseCenterpoint::checkGametype()
- {
- if (this->getGametype() != NULL && this->getGametype()->isA(Class(TowerDefense)))
- {
- // Sets the centerpoint of the gametype. The gametype uses this to later spawn in towers, he needs the tower template stored in the center point
- TowerDefense* towerDefenseGametype = orxonox_cast<TowerDefense*>(this->getGametype().get());
- towerDefenseGametype->setCenterpoint(this);
- }
- }
-}
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,109 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * ...
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file TowerDefenseCenterpoint.cc
+ @brief Implementation of the TowerDefenseCenterpoint class.
+*/
+
+#include "TowerDefenseCenterpoint.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "TowerDefense.h"
+
+namespace orxonox
+{
+ CreateFactory(TowerDefenseCenterpoint);
+
+ /**
+ @brief
+ Constructor. Registers and initializes the object and checks whether the gametype is actually TowerDefense.
+ */
+ TowerDefenseCenterpoint::TowerDefenseCenterpoint(BaseObject* creator) : MobileEntity(creator)
+ {
+ RegisterObject(TowerDefenseCenterpoint);
+
+ this->width_ = 15;
+ this->height_ = 15;
+ this->towerTemplate_ = "";
+
+ //this->setCollisionType(Static);
+
+ this->checkGametype();
+
+ }
+
+ /**
+ @brief
+ Method to create a TowerDefenseCenterpoint through XML.
+ */
+ void TowerDefenseCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(TowerDefenseCenterpoint, XMLPort, xmlelement, mode);
+
+ XMLPortParam(TowerDefenseCenterpoint, "width", setWidth, getWidth, xmlelement, mode);
+ XMLPortParam(TowerDefenseCenterpoint, "height", setHeight, getHeight, xmlelement, mode);
+ XMLPortParam(TowerDefenseCenterpoint, "tileScale", setTileScale, getTileScale, xmlelement, mode);
+ XMLPortParam(TowerDefenseCenterpoint, "towerTemplate", setTowerTemplate, getTowerTemplate, xmlelement, mode);
+
+ //TODO: add XMLPortObject(TowerDefenseCenterpoint, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);
+ // This was copied and shightly modified from WaypointController.cc ; there are no getters and setters and no membervariable yet
+ // The centerpoint should have all waypoints for "attached" to it. By using this function you can seperately add waypoints
+ // When you spawn a new enemy you should let it be controlled by a WaypointController. And that controller should get the waypoints.
+
+ // Alternatively you can manage the waypoints directly in TowerDefense.cc
+ }
+
+ /**
+ @brief
+ Is called when the gametype has changed.
+ */
+ void TowerDefenseCenterpoint::changedGametype()
+ {
+ SUPER(TowerDefenseCenterpoint, changedGametype);
+
+ // Check, whether it's still TowerDefense.
+ this->checkGametype();
+ }
+
+ /**
+ @brief
+ Checks whether the gametype is TowerDefense and if it is, sets its centerpoint.
+ */
+ void TowerDefenseCenterpoint::checkGametype()
+ {
+ if (this->getGametype() != NULL && this->getGametype()->isA(Class(TowerDefense)))
+ {
+ // Sets the centerpoint of the gametype. The gametype uses this to later spawn in towers, he needs the tower template stored in the center point
+ TowerDefense* towerDefenseGametype = orxonox_cast<TowerDefense*>(this->getGametype().get());
+ towerDefenseGametype->setCenterpoint(this);
+ }
+ }
+}
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.h 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,102 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * ...
- * Co-authors:
- * ...
- *
- */
-
-/**
- @brief
- See TowerDefenseReadme.txt for Information.
- @ingroup TowerDefense
- */
-
-
-#ifndef _TowerDefenseCenterpoint_H__
-#define _TowerDefenseCenterpoint_H__
-
-#include "towerdefense/TowerDefensePrereqs.h"
-
-#include <string>
-#include <util/Math.h>
-
-#include "worldentities/MobileEntity.h"
-
-namespace orxonox
-{
- class _TowerDefenseExport TowerDefenseCenterpoint : public MobileEntity
- {
- public:
- TowerDefenseCenterpoint(BaseObject* creator);
- virtual ~TowerDefenseCenterpoint() {}
-
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void changedGametype();
-
- /**
- @brief The width and hight in number of tiles. Default is 15 for both.
- */
- void setWidth(unsigned int width)
- { this->width_ = width; }
-
- unsigned int getWidth(void) const
- { return this->width_; }
-
- void setHeight(unsigned int height)
- { this->height_ = height; }
-
- unsigned int getHeight(void) const
- { return this->height_; }
-
- /**
- @brief How to convert to world coordinates, e.g. that 0,15 is not at -8,-8 but at -80,-80 (if scale would be 10)
- */
- void setTileScale(unsigned int tileScale)
- { this->tileScale_ = tileScale; }
-
- unsigned int getTileScale(void) const
- { return this->tileScale_; }
-
- /**
- @brief Set the template for the towers.
- @param template The template name to be applied to each tower.
- */
- void setTowerTemplate(const std::string& templateName)
- { this->towerTemplate_ = templateName; }
-
- const std::string& getTowerTemplate(void) const
- { return this->towerTemplate_; }
-
- private:
- void checkGametype();
-
- unsigned int width_;
- unsigned int height_;
- unsigned int tileScale_;
-
- std::string towerTemplate_;
- };
-}
-
-#endif /* _TowerDefenseCenterpoint_H__ */
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.h (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.h)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.h (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseCenterpoint.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,102 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * ...
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @brief
+ See TowerDefenseReadme.txt for Information.
+ @ingroup TowerDefense
+ */
+
+
+#ifndef _TowerDefenseCenterpoint_H__
+#define _TowerDefenseCenterpoint_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+
+#include <string>
+#include <util/Math.h>
+
+#include "worldentities/MobileEntity.h"
+
+namespace orxonox
+{
+ class _TowerDefenseExport TowerDefenseCenterpoint : public MobileEntity
+ {
+ public:
+ TowerDefenseCenterpoint(BaseObject* creator);
+ virtual ~TowerDefenseCenterpoint() {}
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void changedGametype();
+
+ /**
+ @brief The width and hight in number of tiles. Default is 15 for both.
+ */
+ void setWidth(unsigned int width)
+ { this->width_ = width; }
+
+ unsigned int getWidth(void) const
+ { return this->width_; }
+
+ void setHeight(unsigned int height)
+ { this->height_ = height; }
+
+ unsigned int getHeight(void) const
+ { return this->height_; }
+
+ /**
+ @brief How to convert to world coordinates, e.g. that 0,15 is not at -8,-8 but at -80,-80 (if scale would be 10)
+ */
+ void setTileScale(unsigned int tileScale)
+ { this->tileScale_ = tileScale; }
+
+ unsigned int getTileScale(void) const
+ { return this->tileScale_; }
+
+ /**
+ @brief Set the template for the towers.
+ @param template The template name to be applied to each tower.
+ */
+ void setTowerTemplate(const std::string& templateName)
+ { this->towerTemplate_ = templateName; }
+
+ const std::string& getTowerTemplate(void) const
+ { return this->towerTemplate_; }
+
+ private:
+ void checkGametype();
+
+ unsigned int width_;
+ unsigned int height_;
+ unsigned int tileScale_;
+
+ std::string towerTemplate_;
+ };
+}
+
+#endif /* _TowerDefenseCenterpoint_H__ */
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.cc
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.cc 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,144 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Fabian 'x3n' Landau
- * Co-authors:
- * ...
- *
- */
-
-#include "TowerDefenseController.h"
-
-#include "util/Math.h"
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "worldentities/pawns/Pawn.h"
-
-namespace orxonox
-{
- CreateFactory(TowerDefenseController);
-
- TowerDefenseController::TowerDefenseController(BaseObject* creator) : WaypointController(creator)
- {
- RegisterObject(TowerDefenseController);
-
- this->alertnessradius_ = 500;
-
- this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&TowerDefenseController::searchEnemy, this)));
- }
-
- void TowerDefenseController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- SUPER(TowerDefenseController, XMLPort, xmlelement, mode);
-
- XMLPortParam(TowerDefenseController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
- }
-
- void TowerDefenseController::tick(float dt)
- {
- if (!this->isActive())
- return;
-
- if (this->target_)
- {
- this->aimAtTarget();
-
- if (this->bHasTargetPosition_)
- this->moveToTargetPosition();
-
- if (this->getControllableEntity() && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
- this->getControllableEntity()->fire(0);
- }
- else
- {
- SUPER(TowerDefenseController, tick, dt);
- }
- }
-
-
- bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
- {
- if (entity1 == entity2)
- return true;
-
- int team1 = -1;
- int team2 = -1;
-
- Controller* controller = 0;
- if (entity1->getController())
- controller = entity1->getController();
- else
- controller = entity1->getXMLController();
- if (controller)
- {
- FormationController* ac = orxonox_cast<FormationController*>(controller);
- if (ac)
- team1 = ac->getTeam();
- }
-
- if (entity2->getController())
- controller = entity2->getController();
- else
- controller = entity2->getXMLController();
- if (controller)
- {
- FormationController* ac = orxonox_cast<FormationController*>(controller);
- if (ac)
- team2 = ac->getTeam();
- }
-
-
-
- return (team1 == team2 && team1 != -1);
- }
-
-
-
-
-
- void TowerDefenseController::searchEnemy()
- {
- this->patrolTimer_.setInterval(rnd());
-
- if (!this->getControllableEntity())
- return;
-
- Vector3 myposition = this->getControllableEntity()->getPosition();
- float shortestsqdistance = (float)static_cast<unsigned int>(-1);
-
- for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
- {
- if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
- continue;
-
- float sqdistance = it->getPosition().squaredDistance(myposition);
- if (sqdistance < shortestsqdistance)
- {
- shortestsqdistance = sqdistance;
- this->target_ = (*it);
- }
- }
-
- if (shortestsqdistance > (this->alertnessradius_ * this->alertnessradius_))
- this->target_ = 0;
- }
-}
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.cc (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.cc)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.cc (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,144 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "TowerDefenseController.h"
+
+#include "util/Math.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+ CreateFactory(TowerDefenseController);
+
+ TowerDefenseController::TowerDefenseController(BaseObject* creator) : WaypointController(creator)
+ {
+ RegisterObject(TowerDefenseController);
+
+ this->alertnessradius_ = 500;
+
+ this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&TowerDefenseController::searchEnemy, this)));
+ }
+
+ void TowerDefenseController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(TowerDefenseController, XMLPort, xmlelement, mode);
+
+ XMLPortParam(TowerDefenseController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
+ }
+
+ void TowerDefenseController::tick(float dt)
+ {
+ if (!this->isActive())
+ return;
+
+ if (this->target_)
+ {
+ this->aimAtTarget();
+
+ if (this->bHasTargetPosition_)
+ this->moveToTargetPosition();
+
+ if (this->getControllableEntity() && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
+ this->getControllableEntity()->fire(0);
+ }
+ else
+ {
+ SUPER(TowerDefenseController, tick, dt);
+ }
+ }
+
+
+ bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
+ {
+ if (entity1 == entity2)
+ return true;
+
+ int team1 = -1;
+ int team2 = -1;
+
+ Controller* controller = 0;
+ if (entity1->getController())
+ controller = entity1->getController();
+ else
+ controller = entity1->getXMLController();
+ if (controller)
+ {
+ FormationController* ac = orxonox_cast<FormationController*>(controller);
+ if (ac)
+ team1 = ac->getTeam();
+ }
+
+ if (entity2->getController())
+ controller = entity2->getController();
+ else
+ controller = entity2->getXMLController();
+ if (controller)
+ {
+ FormationController* ac = orxonox_cast<FormationController*>(controller);
+ if (ac)
+ team2 = ac->getTeam();
+ }
+
+
+
+ return (team1 == team2 && team1 != -1);
+ }
+
+
+
+
+
+ void TowerDefenseController::searchEnemy()
+ {
+ this->patrolTimer_.setInterval(rnd());
+
+ if (!this->getControllableEntity())
+ return;
+
+ Vector3 myposition = this->getControllableEntity()->getPosition();
+ float shortestsqdistance = (float)static_cast<unsigned int>(-1);
+
+ for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+ {
+ if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
+ continue;
+
+ float sqdistance = it->getPosition().squaredDistance(myposition);
+ if (sqdistance < shortestsqdistance)
+ {
+ shortestsqdistance = sqdistance;
+ this->target_ = (*it);
+ }
+ }
+
+ if (shortestsqdistance > (this->alertnessradius_ * this->alertnessradius_))
+ this->target_ = 0;
+ }
+}
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.h 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,61 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Fabian 'x3n' Landau
- * Co-authors:
- * ...
- *
- */
-
-#ifndef _TowerDefenseController_H__
-#define _TowerDefenseController_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "tools/Timer.h"
-#include "WaypointController.h"
-
-namespace orxonox
-{
- class _OrxonoxExport TowerDefenseController : public WaypointController
- {
- public:
- TowerDefenseController(BaseObject* creator);
- virtual ~TowerDefenseController() {}
-
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void tick(float dt);
-
- inline void setAlertnessRadius(float radius)
- { this->alertnessradius_ = radius; }
- inline float getAlertnessRadius() const
- { return this->alertnessradius_; }
-
- protected:
- void searchEnemy();
-
- float alertnessradius_;
- Timer patrolTimer_;
- };
-}
-
-#endif /* _TowerDefenseController_H__ */
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.h (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseController.h)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.h (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseController.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,61 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _TowerDefenseController_H__
+#define _TowerDefenseController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "tools/Timer.h"
+#include "WaypointController.h"
+
+namespace orxonox
+{
+ class _OrxonoxExport TowerDefenseController : public WaypointController
+ {
+ public:
+ TowerDefenseController(BaseObject* creator);
+ virtual ~TowerDefenseController() {}
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void tick(float dt);
+
+ inline void setAlertnessRadius(float radius)
+ { this->alertnessradius_ = radius; }
+ inline float getAlertnessRadius() const
+ { return this->alertnessradius_; }
+
+ protected:
+ void searchEnemy();
+
+ float alertnessradius_;
+ Timer patrolTimer_;
+ };
+}
+
+#endif /* _TowerDefenseController_H__ */
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.cc
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseHUDController.cc 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,70 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- *
- * Co-authors:
- * ...
- */
-
-#include "TowerDefenseHUDController.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Convert.h"
-
-
-namespace orxonox
-{
- CreateFactory(TowerDefenseHUDController);
-
- TowerDefenseHUDController::TowerDefenseHUDController(BaseObject* creator) : OverlayText(creator)
- {
- RegisterObject(TowerDefenseHUDController);
- }
-
- TowerDefenseHUDController::~TowerDefenseHUDController()
- {
-
- }
-
- void TowerDefenseHUDController::tick(float dt)
- {
- SUPER(TowerDefenseHUDController, tick, dt);
- }
-
- void TowerDefenseHUDController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- SUPER(TowerDefenseHUDController, XMLPort, xmlelement, mode);
- }
-
- void TowerDefenseHUDController::changedOwner()
- {
- SUPER(TowerDefenseHUDController, changedOwner);
- /*
- if (this->getOwner() != NULL && this->getOwner()->getGametype())
- this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype().get());
- else
- this->owner_ = 0;
- */
- }
-
-}
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.cc (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseHUDController.cc)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.cc (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,70 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ *
+ * Co-authors:
+ * ...
+ */
+
+#include "TowerDefenseHUDController.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+
+
+namespace orxonox
+{
+ CreateFactory(TowerDefenseHUDController);
+
+ TowerDefenseHUDController::TowerDefenseHUDController(BaseObject* creator) : OverlayText(creator)
+ {
+ RegisterObject(TowerDefenseHUDController);
+ }
+
+ TowerDefenseHUDController::~TowerDefenseHUDController()
+ {
+
+ }
+
+ void TowerDefenseHUDController::tick(float dt)
+ {
+ SUPER(TowerDefenseHUDController, tick, dt);
+ }
+
+ void TowerDefenseHUDController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(TowerDefenseHUDController, XMLPort, xmlelement, mode);
+ }
+
+ void TowerDefenseHUDController::changedOwner()
+ {
+ SUPER(TowerDefenseHUDController, changedOwner);
+ /*
+ if (this->getOwner() != NULL && this->getOwner()->getGametype())
+ this->owner_ = orxonox_cast<Pong*>(this->getOwner()->getGametype().get());
+ else
+ this->owner_ = 0;
+ */
+ }
+
+}
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseHUDController.h 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,60 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- *
- * Co-authors:
- * ...
- *
- */
-
- /**
- @brief
- This subclass of OverlayText is used to display the stats of the player in the HUD
-
- @ingroup TowerDefense
- */
-
-
-#ifndef _TowerDefenseHUDController_H__
-#define _TowerDefenseHUDController_H__
-
-#include "towerdefense/TowerDefensePrereqs.h"
-
-#include "tools/interfaces/Tickable.h"
-#include "overlays/OverlayText.h"
-
-
-namespace orxonox
-{
- class _TowerDefenseExport TowerDefenseHUDController : public OverlayText, public Tickable
- {
- public:
- TowerDefenseHUDController(BaseObject* creator);
- virtual ~TowerDefenseHUDController();
-
- virtual void tick(float dt);
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void changedOwner();
- };
-}
-
-#endif /* _TowerDefenseHUDController_H__ */
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.h (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseHUDController.h)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.h (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefenseHUDController.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,60 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ *
+ * Co-authors:
+ * ...
+ *
+ */
+
+ /**
+ @brief
+ This subclass of OverlayText is used to display the stats of the player in the HUD
+
+ @ingroup TowerDefense
+ */
+
+
+#ifndef _TowerDefenseHUDController_H__
+#define _TowerDefenseHUDController_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+
+
+namespace orxonox
+{
+ class _TowerDefenseExport TowerDefenseHUDController : public OverlayText, public Tickable
+ {
+ public:
+ TowerDefenseHUDController(BaseObject* creator);
+ virtual ~TowerDefenseHUDController();
+
+ virtual void tick(float dt);
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void changedOwner();
+ };
+}
+
+#endif /* _TowerDefenseHUDController_H__ */
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.cc
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefensePlayerStats.cc 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,44 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- *
- * Co-authors:
- * ...
- */
-
-#include "TowerDefensePlayerStats.h"
-
-namespace orxonox
-{
- const int kDefaultCredit = 200;
-
- TowerDefensePlayerStats::TowerDefensePlayerStats()
- {
- this->credit_ = kDefaultCredit;
- this->waveNumber_ = 0;
- }
- /*
- TowerDefensePlayerStats::~TowerDefensePlayerStats()
- {
- }
- */
-}
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.cc (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefensePlayerStats.cc)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.cc (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,44 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ *
+ * Co-authors:
+ * ...
+ */
+
+#include "TowerDefensePlayerStats.h"
+
+namespace orxonox
+{
+ const int kDefaultCredit = 200;
+
+ TowerDefensePlayerStats::TowerDefensePlayerStats()
+ {
+ this->credit_ = kDefaultCredit;
+ this->waveNumber_ = 0;
+ }
+ /*
+ TowerDefensePlayerStats::~TowerDefensePlayerStats()
+ {
+ }
+ */
+}
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefensePlayerStats.h 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,75 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- *
- * Co-authors:
- * ...
- *
- */
-
- /**
- @brief
- This manages the stats of the player. It is used by 'TowerDefense', the gametype
-
- @ingroup TowerDefense
- */
-
-
-#ifndef _TowerDefensePlayerStats_H__
-#define _TowerDefensePlayerStats_H__
-
-#include "towerdefense/TowerDefensePrereqs.h"
-
-namespace orxonox
-{
- typedef enum _TowerCosts {
- TDDefaultTowerCost = 200
- } TowerCost;
-
- class _TowerDefenseExport TowerDefensePlayerStats
- {
- public:
- TowerDefensePlayerStats();
-
- inline int getCredit()
- { return credit_; }
-
- inline void setCredit(int credit)
- { credit_ = credit; }
-
- inline void buyTower(TowerCost cost)
- { credit_ -= cost;}
-
- inline int getWaveNumber()
- { return waveNumber_; }
-
- inline void didLoadNextWave()
- { waveNumber_++; }
-
- private:
- int credit_;
- int waveNumber_;
- //int baseHealth_;
- };
-}
-
-#endif /* _TowerDefensePlayerStats_H__ */
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.h (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefensePlayerStats.h)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.h (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,75 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ *
+ * Co-authors:
+ * ...
+ *
+ */
+
+ /**
+ @brief
+ This manages the stats of the player. It is used by 'TowerDefense', the gametype
+
+ @ingroup TowerDefense
+ */
+
+
+#ifndef _TowerDefensePlayerStats_H__
+#define _TowerDefensePlayerStats_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+
+namespace orxonox
+{
+ typedef enum _TowerCosts {
+ TDDefaultTowerCost = 200
+ } TowerCost;
+
+ class _TowerDefenseExport TowerDefensePlayerStats
+ {
+ public:
+ TowerDefensePlayerStats();
+
+ inline int getCredit()
+ { return credit_; }
+
+ inline void setCredit(int credit)
+ { credit_ = credit; }
+
+ inline void buyTower(TowerCost cost)
+ { credit_ -= cost;}
+
+ inline int getWaveNumber()
+ { return waveNumber_; }
+
+ inline void didLoadNextWave()
+ { waveNumber_++; }
+
+ private:
+ int credit_;
+ int waveNumber_;
+ //int baseHealth_;
+ };
+}
+
+#endif /* _TowerDefensePlayerStats_H__ */
Deleted: code/branches/presentation2012/src/modules/towerdefense/TowerDefensePrereqs.h
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/TowerDefensePrereqs.h 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefensePrereqs.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,74 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Reto Grieder
- * Co-authors:
- * ...
- *
- */
-
-/**
- at file
- at brief
- Shared library macros, enums, constants and forward declarations for the TowerDefense module
-*/
-
-#ifndef _TowerDefensePrereqs_H__
-#define _TowerDefensePrereqs_H__
-
-#include "OrxonoxConfig.h"
-#include "OrxonoxPrereqs.h"
-
-//-----------------------------------------------------------------------
-// Shared library settings
-//-----------------------------------------------------------------------
-
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(TOWERDEFENSE_STATIC_BUILD)
-# ifdef TOWERDEFENSE_SHARED_BUILD
-# define _TowerDefenseExport __declspec(dllexport)
-# else
-# if defined( __MINGW32__ )
-# define _TowerDefenseExport
-# else
-# define _TowerDefenseExport __declspec(dllimport)
-# endif
-# endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
-# define _TowerDefenseExport __attribute__ ((visibility("default")))
-#else
-# define _TowerDefenseExport
-#endif
-
-//-----------------------------------------------------------------------
-// Forward declarations
-//-----------------------------------------------------------------------
-
-namespace orxonox
-{
- class TowerDefense;
- class Tower;
- class TowerDefenseCenterpoint;
- class TowerDefenseHUDController;
- class TowerDefensePlayerStats;
-}
-
-#endif /* _TowerDefensePrereqs_H__ */
Copied: code/branches/presentation2012/src/modules/towerdefense/TowerDefensePrereqs.h (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/TowerDefensePrereqs.h)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/TowerDefensePrereqs.h (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/TowerDefensePrereqs.h 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,74 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Reto Grieder
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ at file
+ at brief
+ Shared library macros, enums, constants and forward declarations for the TowerDefense module
+*/
+
+#ifndef _TowerDefensePrereqs_H__
+#define _TowerDefensePrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(TOWERDEFENSE_STATIC_BUILD)
+# ifdef TOWERDEFENSE_SHARED_BUILD
+# define _TowerDefenseExport __declspec(dllexport)
+# else
+# if defined( __MINGW32__ )
+# define _TowerDefenseExport
+# else
+# define _TowerDefenseExport __declspec(dllimport)
+# endif
+# endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+# define _TowerDefenseExport __attribute__ ((visibility("default")))
+#else
+# define _TowerDefenseExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+ class TowerDefense;
+ class Tower;
+ class TowerDefenseCenterpoint;
+ class TowerDefenseHUDController;
+ class TowerDefensePlayerStats;
+}
+
+#endif /* _TowerDefensePrereqs_H__ */
Deleted: code/branches/presentation2012/src/modules/towerdefense/tower/Tower.blend
===================================================================
(Binary files differ)
Copied: code/branches/presentation2012/src/modules/towerdefense/tower/Tower.blend (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/tower/Tower.blend)
===================================================================
(Binary files differ)
Deleted: code/branches/presentation2012/src/modules/towerdefense/tower/Tower.material
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/tower/Tower.material 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/tower/Tower.material 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,25 +0,0 @@
-material Material/TEXFACE/RustySteel.jpg
-{
- receive_shadows on
- technique
- {
- pass
- {
- ambient 0.500000 0.500000 0.500000 1.000000
- diffuse 0.800000 0.800000 0.800000 1.000000
- emissive 0.000000 0.000000 0.000000 1.000000
- texture_unit
- {
- texture RustySteel.jpg
- colour_op modulate
- }
- }
- pass
- {
- ambient 0.0 0.0 0.0
- diffuse 0.0 0.0 0.0
- specular 0.500000 0.500000 0.500000 1.000000 12.500000
- scene_blend add
- }
- }
-}
Copied: code/branches/presentation2012/src/modules/towerdefense/tower/Tower.material (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/tower/Tower.material)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/tower/Tower.material (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/tower/Tower.material 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,25 @@
+material Material/TEXFACE/RustySteel.jpg
+{
+ receive_shadows on
+ technique
+ {
+ pass
+ {
+ ambient 0.500000 0.500000 0.500000 1.000000
+ diffuse 0.800000 0.800000 0.800000 1.000000
+ emissive 0.000000 0.000000 0.000000 1.000000
+ texture_unit
+ {
+ texture RustySteel.jpg
+ colour_op modulate
+ }
+ }
+ pass
+ {
+ ambient 0.0 0.0 0.0
+ diffuse 0.0 0.0 0.0
+ specular 0.500000 0.500000 0.500000 1.000000 12.500000
+ scene_blend add
+ }
+ }
+}
Deleted: code/branches/presentation2012/src/modules/towerdefense/tower/Tower.mesh
===================================================================
(Binary files differ)
Copied: code/branches/presentation2012/src/modules/towerdefense/tower/Tower.mesh (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/tower/Tower.mesh)
===================================================================
(Binary files differ)
Deleted: code/branches/presentation2012/src/modules/towerdefense/towerdefensereadme.txt
===================================================================
--- code/branches/newlevel2012/src/modules/towerdefense/towerdefensereadme.txt 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/modules/towerdefense/towerdefensereadme.txt 2012-05-23 11:07:29 UTC (rev 9229)
@@ -1,38 +0,0 @@
-===============================================================================
-Classes
-===============================================================================
-
-TowerDefense:
-GameType class
-
-TowerDefenseCenterpoint
-Centerpoint class. Store tower template
-
-Tower
-Represents a Tower
-I'm not actually sure if you have to code C++ in order to have your result. I would suggest to simply create a new spaceship template or maybe better a
-new template for a pawn. (The tower don't need to be spaceships; pawn is just fine.)
-Example for a template: /data/levels/templates/assff.oxt && /data/levels/include/weaponSettingsAssff.oxi
-@ assff.oxt: you don't need an engine (or your towers could fly away :-) and probably no Cameras. (just try what happens if you leave them out.)
-@ weaponSettingsAssff.oxi:
-<weaponslots>: location where you want to have your tower to be equiped with weapons
-<weaponsets> : if you press fire, you actually always fire a whole set of weapons. The amount of weaponsets is defined here. (I'm not 100% sure whether this explanation is right.)
-
-There are three <Weapon> tags - one for each weaponslot. Each weapon can contain several objects which you would probably
-refer to as "weapons":
-
-LightningGun: Shoots a slow, rotation, yellow "ball".
-HsW01: the default laser weapon
-SimpleRocketFire: a weak (self steering) rocket
-RocketFire: a strong rocket
-
-About your Tower's Template location - either keep it in the level or do it similarly to the Assff templates.
-(If your towers behave & look nicely, I'm quite sure others want to include them in other levels, too.)
-
-
-===============================================================================
-Other files
-===============================================================================
-
-/data/levels/towerdefense.oxw
-Loads the level. In <Level>, we first create a SpawnPoint. It spawns a cylinder using the 'centerpointmark' Template, which uses the 'centerpointmarkcamera' Template to create a static camera. Then, we create an instance of TowerDefenseCenterpoint and pass the 'towertemplate' Template, so that we can later create towers using this template. We also plase the playfield.mesh in a way that maps every field on the playfield.mesh to nice coordinates: the playfield spans as a square from -8,-8 to 8,8.
\ No newline at end of file
Copied: code/branches/presentation2012/src/modules/towerdefense/towerdefensereadme.txt (from rev 9228, code/branches/newlevel2012/src/modules/towerdefense/towerdefensereadme.txt)
===================================================================
--- code/branches/presentation2012/src/modules/towerdefense/towerdefensereadme.txt (rev 0)
+++ code/branches/presentation2012/src/modules/towerdefense/towerdefensereadme.txt 2012-05-23 11:07:29 UTC (rev 9229)
@@ -0,0 +1,38 @@
+===============================================================================
+Classes
+===============================================================================
+
+TowerDefense:
+GameType class
+
+TowerDefenseCenterpoint
+Centerpoint class. Store tower template
+
+Tower
+Represents a Tower
+I'm not actually sure if you have to code C++ in order to have your result. I would suggest to simply create a new spaceship template or maybe better a
+new template for a pawn. (The tower don't need to be spaceships; pawn is just fine.)
+Example for a template: /data/levels/templates/assff.oxt && /data/levels/include/weaponSettingsAssff.oxi
+@ assff.oxt: you don't need an engine (or your towers could fly away :-) and probably no Cameras. (just try what happens if you leave them out.)
+@ weaponSettingsAssff.oxi:
+<weaponslots>: location where you want to have your tower to be equiped with weapons
+<weaponsets> : if you press fire, you actually always fire a whole set of weapons. The amount of weaponsets is defined here. (I'm not 100% sure whether this explanation is right.)
+
+There are three <Weapon> tags - one for each weaponslot. Each weapon can contain several objects which you would probably
+refer to as "weapons":
+
+LightningGun: Shoots a slow, rotation, yellow "ball".
+HsW01: the default laser weapon
+SimpleRocketFire: a weak (self steering) rocket
+RocketFire: a strong rocket
+
+About your Tower's Template location - either keep it in the level or do it similarly to the Assff templates.
+(If your towers behave & look nicely, I'm quite sure others want to include them in other levels, too.)
+
+
+===============================================================================
+Other files
+===============================================================================
+
+/data/levels/towerdefense.oxw
+Loads the level. In <Level>, we first create a SpawnPoint. It spawns a cylinder using the 'centerpointmark' Template, which uses the 'centerpointmarkcamera' Template to create a static camera. Then, we create an instance of TowerDefenseCenterpoint and pass the 'towertemplate' Template, so that we can later create towers using this template. We also plase the playfield.mesh in a way that maps every field on the playfield.mesh to nice coordinates: the playfield spans as a square from -8,-8 to 8,8.
\ No newline at end of file
Modified: code/branches/presentation2012/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/presentation2012/src/orxonox/controllers/FormationController.cc 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/orxonox/controllers/FormationController.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -271,20 +271,26 @@
// return;
}
- Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+ Vector2 coord = get2DViewcoordinates(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
float distance = (target - this->getControllableEntity()->getPosition()).length();
+ if(coord.x < 0.0001 && coord.y < 0.0001)
+ {
+ // if the ship reaches a direction very close to the direct one, set it to the direct one
+ Vector3 v_temp = this->getControllableEntity()->getPosition();
+ Quaternion quat = v_temp.getRotationTo(target);
+ this->getControllableEntity()->rotate(quat);
+ }
-
if(this->state_ == FREE)
{
if (this->target_ || distance > 10)
{
// Multiply with ROTATEFACTOR_FREE to make them a bit slower
- this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
- this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
+ this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * coord.x * 2);
+ this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * coord.y * 2);
}
- if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+ if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
{
this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
} else this->getControllableEntity()->moveFrontBack(SPEED_FREE);
@@ -296,8 +302,8 @@
{
if (this->target_ || distance > 10)
{
- this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
- this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+ this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * coord.x * 2);
+ this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * coord.y * 2);
}
if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
@@ -309,28 +315,28 @@
if(this->state_ == SLAVE)
- {
+ {
- this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
- this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+ this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * coord.x * 2);
+ this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * coord.y * 2);
- if (distance < 300)
- {
- if (bHasTargetOrientation_)
- {
- copyTargetOrientation();
- }
- if (distance < 100)
- { //linear speed reduction
- this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER);
-
- } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
+ if (distance < 300)
+ {
+ if (bHasTargetOrientation_)
+ {
+ copyTargetOrientation();
+ }
+ if (distance < 100)
+ { //linear speed reduction
+ this->getControllableEntity()->moveFrontBack(distance/100.0f*0.4f*SPEED_MASTER);
- } else {
- this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
- }
- }
+ } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
+ } else {
+ this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
+ }
+ }
+
if (distance < 10)
{
this->positionReached();
@@ -382,7 +388,7 @@
void FormationController::searchNewMaster()
{
- if (this->state_==SLAVE)
+ if (this->state_==SLAVE)
return;
if (!this->getControllableEntity())
return;
@@ -393,7 +399,7 @@
//go through all pawns
for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
{
-
+
//same team?
Gametype* gt=this->getGametype();
if (!gt)
@@ -478,7 +484,7 @@
Vector3 pos = Vector3::ZERO;
bool left=true;
int i = 1;
-
+
for(std::vector<FormationController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
{
pos = Vector3::ZERO;
@@ -489,7 +495,7 @@
pos+=dest+i*FORMATION_WIDTH*(orient*WorldEntity::RIGHT);
i++;
dest+=FORMATION_LENGTH*(orient*WorldEntity::BACK);
- }
+ }
(*it)->setTargetOrientation(orient);
(*it)->setTargetPosition(pos);
left=!left;
@@ -598,12 +604,12 @@
}
if (this->state_==SLAVE) //become master of this formation
- {
+ {
this->slaves_=this->myMaster_->slaves_;
this->myMaster_->slaves_.clear();
this->myMaster_->state_=SLAVE;
this->myMaster_->myMaster_=this;
-
+
//delete myself in slavelist
std::vector<FormationController*>::iterator it2 = std::find(this->slaves_.begin(), this->slaves_.end(), this);
if (it2 != this->slaves_.end())
@@ -646,7 +652,7 @@
i++;
if (i>=slaves_.size()/2) break; //half the formation should attack.
}
- }
+ }
/**
@@ -859,7 +865,7 @@
void FormationController::setTargetOrientation(const Quaternion& orient)
{
- this->targetOrientation_=orient;
+ this->targetOrientation_=orient;
this->bHasTargetOrientation_=true;
}
Modified: code/branches/presentation2012/src/orxonox/controllers/WaypointController.cc
===================================================================
--- code/branches/presentation2012/src/orxonox/controllers/WaypointController.cc 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/orxonox/controllers/WaypointController.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -61,15 +61,18 @@
void WaypointController::tick(float dt)
{
- if (!this->isActive())
+ if (!this->isActive())
return;
+
if (this->waypoints_.size() == 0 || !this->getControllableEntity())
return;
+
if (this->waypoints_[this->currentWaypoint_]->getWorldPosition().squaredDistance(this->getControllableEntity()->getPosition()) <= this->squaredaccuracy_)
this->currentWaypoint_ = (this->currentWaypoint_ + 1) % this->waypoints_.size();
+
this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition());
}
Modified: code/branches/presentation2012/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/branches/presentation2012/src/orxonox/worldentities/WorldEntity.cc 2012-05-22 16:34:05 UTC (rev 9228)
+++ code/branches/presentation2012/src/orxonox/worldentities/WorldEntity.cc 2012-05-23 11:07:29 UTC (rev 9229)
@@ -378,7 +378,6 @@
if (!object->notifyBeingAttached(this))
return;
-
this->attachNode(object->node_);
this->children_.insert(object);
More information about the Orxonox-commit
mailing list