[Orxonox-commit 5792] r10452 - in code/branches/presentationFS15: . data/levels data/levels/templates src/modules/objects src/modules/objects/controllers src/modules/tetris src/modules/towerdefense src/orxonox/controllers
maxima at orxonox.net
maxima at orxonox.net
Thu May 21 16:26:39 CEST 2015
Author: maxima
Date: 2015-05-21 16:26:39 +0200 (Thu, 21 May 2015)
New Revision: 10452
Added:
code/branches/presentationFS15/data/levels/templates/towerdefensetower.oxt
code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.cc
code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.h
Removed:
code/branches/presentationFS15/data/levels/templates/tower.oxt
code/branches/presentationFS15/src/modules/towerdefense/Tower.cc
code/branches/presentationFS15/src/modules/towerdefense/Tower.h
code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.cc
code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.h
Modified:
code/branches/presentationFS15/
code/branches/presentationFS15/data/levels/templates/enemytowerdefense.oxt
code/branches/presentationFS15/data/levels/towerDefense.oxw
code/branches/presentationFS15/src/modules/objects/Turret.cc
code/branches/presentationFS15/src/modules/objects/Turret.h
code/branches/presentationFS15/src/modules/objects/controllers/TurretController.cc
code/branches/presentationFS15/src/modules/tetris/Tetris.h
code/branches/presentationFS15/src/modules/towerdefense/CMakeLists.txt
code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.cc
code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.h
code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.cc
code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.h
code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.cc
code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.h
code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseEnemy.cc
code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.cc
code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.h
code/branches/presentationFS15/src/orxonox/controllers/FormationController.cc
Log:
Towerdefense merged to Presentation
Property changes on: code/branches/presentationFS15
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/Racingbot:9388-9513
/code/branches/ScriptableController:9999-10075
/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/core6:9552-9666
/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/formationupdate:9580-9624
/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/hudHS14:10083-10241
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/keckslevelHS14:10082-10222
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/leveljoemeHS14:10087-10223
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/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/minigame4DHS14:10081-10230
/code/branches/miniprojects:2754-2824
/code/branches/modularships:9994-10071
/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-9244
/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/pCuts:9023-9284
/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/pickupsFS14:10000-10259
/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/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationFS14:10069-10215
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/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/sfxThilo:9691-9917
/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/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseHS14:10086-10247
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/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/branches/weaponupdateHS14:10084-10237
+ /code/branches/Racingbot:9388-9513
/code/branches/ScriptableController:9999-10075
/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/core6:9552-9666
/code/branches/core7:10350
/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/formationupdate:9580-9624
/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/hudHS14:10083-10241
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/keckslevelHS14:10082-10222
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/levelElias:9697-9921
/code/branches/levelKaan:9695-9921
/code/branches/levelMichael:9696-9921
/code/branches/leveljoemeHS14:10087-10223
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/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/minigame4DHS14:10081-10230
/code/branches/miniprojects:2754-2824
/code/branches/modularships:9994-10071
/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-9244
/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/pCuts:9023-9284
/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/pickupsFS14:10000-10259
/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/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationFS14:10069-10215
/code/branches/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/code/branches/presentationHS14merge:10222-10257
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/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/sfxThilo:9691-9917
/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/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/storymodeHS14:10085-10254
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10236
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/towerdefenseFS15:10283-10451
/code/branches/towerdefenseHS14:10086-10247
/code/branches/turret:9380-9501
/code/branches/turretFS14:9998-10070
/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/branches/weaponupdateHS14:10084-10237
Modified: code/branches/presentationFS15/data/levels/templates/enemytowerdefense.oxt
===================================================================
--- code/branches/presentationFS15/data/levels/templates/enemytowerdefense.oxt 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/data/levels/templates/enemytowerdefense.oxt 2015-05-21 14:26:39 UTC (rev 10452)
@@ -166,7 +166,7 @@
health = 100
maxhealth = 200
initialhealth = 100
-
+
shieldhealth = 30
initialshieldhealth = 30
maxshieldhealth = 50
Deleted: code/branches/presentationFS15/data/levels/templates/tower.oxt
===================================================================
--- code/branches/presentationFS15/data/levels/templates/tower.oxt 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/data/levels/templates/tower.oxt 2015-05-21 14:26:39 UTC (rev 10452)
@@ -1,128 +0,0 @@
-<Template name=tower>
- <TowerDefenseTower
-
-
- explosionchunks = 6
-
- reloadrate = 3
- reloadwaittime = 1
-
- collisionType = "dynamic"
- team = 2
-
-
- >
- <controller>
- <WaypointPatrolController alertnessradius=1000 team=5>
- <waypoints>
- <Model mesh="cube.mesh" scale=0 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")
-?>
- </TowerDefenseTower>
-</Template>
-
-
-
-<Template name=towerturret>
- <TowerDefenseTower
-
-
- explosionchunks = 6
-
- reloadrate = 10
- reloadwaittime = 5
-
- collisionType = "dynamic"
- team = 1
-
-
- >
- <attached>
-
- <Model position="0,0,0" scale=45 mesh="Tower.mesh" />
-
- <Turret reloadrate=10 reloadwaittime=5 collisionType="dynamic" position="0,0,10" direction="0,0,1" pitch="0" yaw="0" roll="0" angularDamping=0.999999 mass=100 maxPitch=90 maxYaw=90 maxAttackRadius=1000 minAttackRadius=30>
-
- <controller>
- <TurretController/>
- </controller>
- <?lua
- include("../includes/weaponSettingsTurret.oxi")
- ?>
- </Turret>
-
- </attached>
-
-
-
-
- <!--collisionShapes>
-
- </collisionShapes-->
-
-<?lua
- include("../includes/towerWeaponSettings.oxi")
-?>
- </TowerDefenseTower>
-</Template>
-
-
-
-<Template name=towerturret1>
- <TowerDefenseTower
-
-
- explosionchunks = 6
-
- reloadrate = 10
- reloadwaittime = 5
-
- collisionType = "dynamic"
- team = 1
-
-
- >
- <attached>
-
-
- <Turret reloadrate=10 reloadwaittime=5 collisionType="dynamic" position="0,0,10" direction="0,0,1" pitch="0" yaw="0" roll="0" angularDamping=0.999999 mass=100 maxPitch=90 maxYaw=90 maxAttackRadius=1000 minAttackRadius=30>
-
- <controller>
- <TurretController/>
- </controller>
- <?lua
- include("../includes/weaponSettingsTurret1.oxi")
- ?>
- </Turret>
-
- </attached>
-
-
-
-
- <!--collisionShapes>
-
- </collisionShapes-->
-
-<?lua
- include("../includes/towerWeaponSettings.oxi")
-?>
- </TowerDefenseTower>
-</Template>
\ No newline at end of file
Copied: code/branches/presentationFS15/data/levels/templates/towerdefensetower.oxt (from rev 10451, code/branches/towerdefenseFS15/data/levels/templates/towerdefensetower.oxt)
===================================================================
--- code/branches/presentationFS15/data/levels/templates/towerdefensetower.oxt (rev 0)
+++ code/branches/presentationFS15/data/levels/templates/towerdefensetower.oxt 2015-05-21 14:26:39 UTC (rev 10452)
@@ -0,0 +1,38 @@
+<Template name=towerdefensetower>
+ <TowerDefenseTower
+
+
+ explosionchunks = 6
+ reloadrate=10
+ reloadwaittime=5
+ collisionType="none"
+ pitch="0"
+ yaw="0"
+ roll="0"
+ maxPitch=90
+ maxYaw=90
+ maxAttackRadius=1000
+ minAttackRadius=30
+ team = 0
+
+
+ >
+
+ <controller>
+ <TurretController team = 0/>
+ </controller>
+
+
+
+
+
+ <!--collisionShapes>
+
+ </collisionShapes-->
+
+
+ <?lua
+ include("../includes/weaponSettingsTurret.oxi")
+ ?>
+ </TowerDefenseTower>
+</Template>
\ No newline at end of file
Modified: code/branches/presentationFS15/data/levels/towerDefense.oxw
===================================================================
--- code/branches/presentationFS15/data/levels/towerDefense.oxw 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/data/levels/towerDefense.oxw 2015-05-21 14:26:39 UTC (rev 10452)
@@ -19,43 +19,31 @@
<?lua
include("templates/spaceshipAssff.oxt")
include("templates/spaceshipPirate.oxt")
- include("templates/tower.oxt")
+ include("templates/towerdefensetower.oxt")
include("templates/enemytowerdefense.oxt")
include("templates/standardTurret.oxt")
?>
-<!-- Specify the position of the camera -->
-<Template name=centerpointmarkcamera defaults=0>
- <Pawn team=1>
+
+<Template name=selectercameras defaults=0>
+ <TowerDefenseSelecter>
<camerapositions>
- <CameraPosition position="0,0,1500"/>
+ <CameraPosition position="0,0,1400" lookat="0,0,0" absolute=true />
</camerapositions>
- </Pawn>
+ </TowerDefenseSelecter>
</Template>
-<!-- Loads a mesh to mark the center-->
-<Template name=centerpointmark>
- <Pawn team=1 camerapositiontemplate=centerpointmarkcamera>
+<Template name=selectertemplate>
+ <TowerDefenseSelecter team=0 camerapositiontemplate=selectercameras>
<attached>
- <Model position="0,0,0" mesh="cylinder.mesh" scale3D="1,1,1" /> <!-- the camera is attached to this -->
+ <Model pitch=90 position="0,0,-30" mesh="TD_Selection.mesh" scale=30 />
</attached>
- </Pawn>
+ </TowerDefenseSelecter>
</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 />
@@ -71,55 +59,30 @@
<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=1 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=0 position="0,0,0"/>
- <!--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 /-->
-
-
-
-
- <!--invisible entity to attach towers to, since playfield is static and towers are dynamic-->
- <StaticEntity team =1 position=0,0,0>
-
- <attached>
- <Model position="-50,-50,0" mesh="Playfield_ME.mesh" scale=80 />
- <!-- Base -->
- <Model position="500,700,100" mesh="sphere.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
+
+ selecterTemplate=selectertemplate
+
width=16
height=16
tileScale=100
- towerTemplate=tower
position="0,0,0"
direction="0,0,0"
collisionType=dynamic
mass=100000
- team=1
- />
+ >
+ <attached>
+ <Model position="-50,-50,0" mesh="Playfield_ME.mesh" scale=80 />
+ <Model position="500,700,100" mesh="sphere.mesh" scale=80 />
+ </attached>
+ <camerapositions>
+ <CameraPosition position="0,0,1500" lookat="0,0,0" absolute=true/>
+ </camerapositions>
+ </TowerDefenseCenterpoint>
</Scene>
</Level>
Modified: code/branches/presentationFS15/src/modules/objects/Turret.cc
===================================================================
--- code/branches/presentationFS15/src/modules/objects/Turret.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/objects/Turret.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -222,6 +222,7 @@
XMLPortParam(Turret, "minAttackRadius", setMinAttackRadius, getMinAttackRadius, xmlelement, mode);
XMLPortParam(Turret, "maxYaw", setMaxYaw, getMaxYaw, xmlelement, mode);
XMLPortParam(Turret, "maxPitch", setMaxPitch, getMaxPitch, xmlelement, mode);
+ XMLPortParam(Turret, "rotationThrust", setRotationThrust, getRotationThrust, xmlelement, mode);
}
/**
@@ -281,4 +282,4 @@
}
}
-}
\ No newline at end of file
+}
Modified: code/branches/presentationFS15/src/modules/objects/Turret.h
===================================================================
--- code/branches/presentationFS15/src/modules/objects/Turret.h 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/objects/Turret.h 2015-05-21 14:26:39 UTC (rev 10452)
@@ -101,6 +101,12 @@
inline float getMaxYaw() const
{ return this->maxYaw_; }
+ inline void setRotationThrust(float rotationthrust)
+ { this->rotationThrust_ = rotationthrust; }
+
+ inline float getRotationThrust()
+ { return this->rotationThrust_; }
+
protected:
Vector3 startDir_; //!< The initial facing direction, in local coordinates.
Vector3 localZ_; //!< The local z-axis, includes for the parent's rotation and rotations done in xml.
Modified: code/branches/presentationFS15/src/modules/objects/controllers/TurretController.cc
===================================================================
--- code/branches/presentationFS15/src/modules/objects/controllers/TurretController.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/objects/controllers/TurretController.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -103,7 +103,7 @@
for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
{
Pawn* entity = orxonox_cast<Pawn*>(*it);
- if (!entity || FormationController::sameTeam(this->getControllableEntity(), entity, this->getGametype()))
+ if (!entity || FormationController::sameTeam(turret, entity, this->getGametype()))
continue;
tempScore = turret->isInRange(entity);
if(tempScore != -1.f)
@@ -195,6 +195,7 @@
turret->aimAtPosition(target_->getWorldPosition());
if(this->isLookingAtTargetNew(Degree(5).valueRadians()))
{
+
this->getControllableEntity()->fire(0);
}
}
Modified: code/branches/presentationFS15/src/modules/tetris/Tetris.h
===================================================================
--- code/branches/presentationFS15/src/modules/tetris/Tetris.h 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/tetris/Tetris.h 2015-05-21 14:26:39 UTC (rev 10452)
@@ -89,7 +89,6 @@
void findFullRows(void);
void clearRow(unsigned int row);
-
PlayerInfo* player_;
WeakPtr<TetrisCenterpoint> center_; //!< The playing field.
Modified: code/branches/presentationFS15/src/modules/towerdefense/CMakeLists.txt
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/CMakeLists.txt 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/CMakeLists.txt 2015-05-21 14:26:39 UTC (rev 10452)
@@ -1,13 +1,12 @@
SET_SOURCE_FILES(TOWERDEFENSE_SRC_FILES
TowerDefense.cc
TowerDefenseTower.cc
- TowerTurret.cc
TowerDefenseCenterpoint.cc
TowerDefenseHUDController.cc
TowerDefensePlayerStats.cc
TDCoordinate.cc
TowerDefenseEnemy.cc
-
+ TowerDefenseSelecter.cc
)
ORXONOX_ADD_LIBRARY(towerdefense
@@ -16,5 +15,6 @@
LINK_LIBRARIES
orxonox
overlays
+ objects
SOURCE_FILES ${TOWERDEFENSE_SRC_FILES}
)
Modified: code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -16,25 +16,62 @@
TDCoordinate::TDCoordinate()
{
//RegisterObject(TDCoordinate);
- x=0;
- y=0;
+ Set(0,0);
}
TDCoordinate::TDCoordinate(int x, int y)
- {
- this->x=x;
- this->y=y;
+ {
+ Set(x,y);
}
+ void TDCoordinate::Set(int x, int y)
+ {
+ if (x < 0)
+ {
+ _x = 0;
+ }
+ else if (x > 15)
+ {
+ _x = 15;
+ }
+ else
+ {
+ _x = x;
+ }
+ if (y < 0)
+ {
+ _y = 0;
+ }
+ else if (y > 15)
+ {
+ _y = 15;
+ }
+ else
+ {
+ _y = y;
+ }
+ }
+
+ int TDCoordinate::GetX()
+ {
+ return _x;
+ }
+
+ int TDCoordinate::GetY()
+ {
+ return _y;
+ }
+
+
Vector3 TDCoordinate::get3dcoordinate()
{
float tileScale = 100;
Vector3 *coord = new Vector3();
- coord->x= (x-8) * tileScale;
- coord->y= (y-8) * tileScale;
+ coord->x= (_x-8) * tileScale;
+ coord->y= (_y-8) * tileScale;
coord->z=100;
return *coord;
Modified: code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.h 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TDCoordinate.h 2015-05-21 14:26:39 UTC (rev 10452)
@@ -15,16 +15,17 @@
class _TowerDefenseExport TDCoordinate : public OrxonoxClass
{
public:
- int x;
- int y;
-
TDCoordinate();
-
- Vector3 get3dcoordinate();
-
+ TDCoordinate(int x, int y);
virtual ~TDCoordinate() {};
+ virtual void Set(int x, int y);
+ virtual int GetX();
+ virtual int GetY();
+ virtual Vector3 get3dcoordinate();
- TDCoordinate(int x, int y);
+ private:
+ int _x;
+ int _y;
};
}
Deleted: code/branches/presentationFS15/src/modules/towerdefense/Tower.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/Tower.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/Tower.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -1,113 +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
-{
- RegisterClass(Tower);
-
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
- Tower::Tower(Context* context) : Pawn(context)
- {
- 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)));
- */
- }
-
- void Tower::setOrientation(const Quaternion& orientation)
- {
- static int ori;
- //orxout() << "orientation " << ++ori << endl;
- }
-
- void Tower::rotateYaw(const Vector2& value)
- {
- static int yaw;
- //orxout() << "rotateYaw " << ++yaw << endl;
- }
-
- void Tower::rotatePitch(const Vector2& value)
- {
- static int pitch;
- //orxout() << "rotatePitch " << ++pitch << endl;
- }
-
- void Tower::rotateRoll(const Vector2& value)
- {
- static int roll;
- //orxout() << "rotateRoll" << ++roll << endl;
- }
-
- // 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/presentationFS15/src/modules/towerdefense/Tower.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/Tower.h 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/Tower.h 2015-05-21 14:26:39 UTC (rev 10452)
@@ -1,52 +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 _TowerDefenseExport Tower : public Pawn
- {
- public:
- Tower(Context* context);
- virtual ~Tower() {};
-
- // Maybe later override these to move towers with cursor keys
- /*
- virtual void moveFrontBack(const Vector2& value);
- virtual void moveRightLeft(const Vector2& value);
- */
-
- // Overriding these to stop towers from spasing out
- void setOrientation(const Quaternion& orientation);
- virtual void rotateYaw(const Vector2& value);
- virtual void rotatePitch(const Vector2& value);
- virtual void rotateRoll(const Vector2& value);
-
- void setGame(TowerDefense* towerdefense)
- { assert(towerdefense); game_ = towerdefense; }
- private:
- TowerDefense* game_;
- };
-}
-
-
-#endif
Modified: code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -36,7 +36,6 @@
* 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.
@@ -76,7 +75,6 @@
#include "TowerDefenseTower.h"
#include "TowerDefenseCenterpoint.h"
//#include "TDCoordinate.h"
-#include "TowerTurret.h"
#include "worldentities/SpawnPoint.h"
#include "worldentities/pawns/Pawn.h"
#include "worldentities/pawns/SpaceShip.h"
@@ -87,12 +85,26 @@
#include "core/CoreIncludes.h"
/* Part of a temporary hack to allow the player to add towers */
#include "core/command/ConsoleCommand.h"
+#include <cmath>
+
namespace orxonox
{
+ static const std::string __CC_addTower_name = "addTower";
+ static const std::string __CC_upgradeTower_name = "upgradeTower";
+ static const int upgradeCost = 20;
+ static const int towerCost = 20;
+ unsigned int maxspaceships = 30;
+ int maxspaceshipsstandard = 30;
+
+
+
+ SetConsoleCommand("TowerDefense", __CC_addTower_name, &TowerDefense::addTower ).addShortcut().defaultValues(1);
+ SetConsoleCommand("TowerDefense", __CC_upgradeTower_name, &TowerDefense::upgradeTower).addShortcut().defaultValues(0);
+
RegisterUnloadableClass(TowerDefense);
- TowerDefense::TowerDefense(Context* context) : Deathmatch(context)
+ TowerDefense::TowerDefense(Context* context) : TeamDeathmatch(context)
{
RegisterObject(TowerDefense);
/*
@@ -102,13 +114,25 @@
}
}*/
+ //Timer for the waves (10 seconds between the waves)
+ selecter = NULL;
+ this->player_ = NULL;
this->setHUDTemplate("TowerDefenseHUD");
+ this->nextwaveTimer_.setTimer(10, false, createExecutor(createFunctor(&TowerDefense::nextwave, this)));
+ this->nextwaveTimer_.stopTimer();
+ this->waves_ = 0;
+ this->time = 0;
+ this->credit_ = 0;
+ this->lifes_ = 0;
+ this->timeSetTower_ = 0;
+ spaceships =15;
+ eggs=3;
+ ufos=7;
+ randomships=5;
- //this->stats_ = new TowerDefensePlayerStats();
- /* Temporary hack to allow the player to add towers and upgrade them */
- this->dedicatedAddTower_ = createConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) );
- this->dedicatedUpgradeTower_ = createConsoleCommand( "upgradeTower", createExecutor( createFunctor(&TowerDefense::upgradeTower, this) ) );
+ ModifyConsoleCommand(__CC_addTower_name).setObject(this);
+ ModifyConsoleCommand(__CC_upgradeTower_name).setObject(this);
}
TowerDefense::~TowerDefense()
@@ -116,8 +140,8 @@
/* Part of a temporary hack to allow the player to add towers */
if (this->isInitialized())
{
- if( this->dedicatedAddTower_ )
- delete this->dedicatedAddTower_;
+ ModifyConsoleCommand(__CC_addTower_name).setObject(NULL);
+ ModifyConsoleCommand(__CC_upgradeTower_name).setObject(NULL);
}
}
@@ -130,40 +154,72 @@
void TowerDefense::start()
{
+ if (center_ != NULL) // There needs to be a TowerDefenseCenterpoint, i.e. the area the game takes place.
+ {
+ if (selecter == NULL)
+ {
+ selecter = new TowerDefenseSelecter(this->center_->getContext());
+ }
+ selecter->addTemplate(center_->getSelecterTemplate());
+ center_->attach(selecter);
+ }
+ else // If no centerpoint was specified, an error is thrown and the level is exited.
+ {
+ orxout(internal_error) << "Jump: No Centerpoint specified." << endl;
+ return;
+ }
- Deathmatch::start();
+ TeamDeathmatch::start();
-// Waypoints: [1,3] [10,3] [10,11] [13,11] -> add the points to a matrix so the player cant place towers on the path
- for (int i=0; i < 16 ; i++){
- for (int j = 0; j< 16 ; j++){
- towermatrix[i][j] = false;
+ // Waypoints: [1,3] [10,3] [10,11] [13,11] -> add the points to a matrix so the player cant place towers on the path
+ for (int i=0; i < 16 ; i++)
+ {
+ for (int j = 0; j< 16 ; j++)
+ {
+ towerModelMatrix[i][j] = NULL;
+ towerTurretMatrix[i][j] = NULL;
}
}
+
+
+ if (player_ != NULL)
+ {
+ //this->player_->startControl(selecter);
+ }
+ else
+ {
+ orxout() << "player=NULL" << endl;
+ }
+
+
+ Model* dummyModel = new Model(this->center_->getContext());
+
+ //the path of the spacehips has to be blocked, so that no towers can be build there
for (int k=0; k<3; k++)
- towermatrix[1][k]=true;
+ towerModelMatrix[1][k]=dummyModel;
for (int l=1; l<11; l++)
- towermatrix[l][3]=true;
+ towerModelMatrix[l][3]=dummyModel;
for (int m=3; m<12; m++)
- towermatrix[10][m]=true;
+ towerModelMatrix[10][m]=dummyModel;
for (int n=10; n<14; n++)
- towermatrix[n][11]=true;
+ towerModelMatrix[n][11]=dummyModel;
for (int o=13; o<16; o++)
- towermatrix[13][o]=true;
+ towerModelMatrix[13][o]=dummyModel;
+
//set initial credits, lifes and WaveNumber
- this->setCredit(200);
- this->setLifes(50);
+ this->setCredit(100);
+ this->setLifes(100);
this->setWaveNumber(0);
time=0.0;
+ /*
//adds initial towers
for (int i=0; i <7; i++){
addTower(i+3,4);
- }/*
- for (int j=0; j < 7; j++){
- addTower(9,j+5);
- }*/
+ }
+ */
}
// Generates a TowerDefenseEnemy. Uses Template "enemytowerdefense". Sets position at first waypoint of path.
@@ -177,25 +233,31 @@
case 1 :
en1->addTemplate("enemytowerdefense1");
en1->setScale(3);
- en1->setHealth(en1->getHealth() + this->getWaveNumber()*4);
+ en1->lookAt(Vector3(0,0,100000));
+ en1->setHealth(en1->getHealth() +50 + this->getWaveNumber()*4);
break;
case 2 :
en1->addTemplate("enemytowerdefense2");
en1->setScale(2);
- en1->setHealth(en1->getHealth() + this->getWaveNumber()*4);
+ en1->lookAt(Vector3(0,0,100000));
+ en1->roll(Degree(120));
+ en1->setHealth(en1->getHealth() -30 + this->getWaveNumber()*4);
// en1->setShieldHealth(en1->getShield() = this->getWaveNumber()*2))
break;
case 3 :
en1->addTemplate("enemytowerdefense3");
en1->setScale(1);
- en1->setHealth(en1->getHealth() + this->getWaveNumber()*4);
+ en1->lookAt(Vector3(0,0,100000));
+ en1->roll(Degree(120));
+ en1->setHealth(en1->getHealth() -10 + this->getWaveNumber()*4);
break;
}
+ en1->setTeam(2);
en1->getController();
- en1->setPosition(path.at(0)->get3dcoordinate());
+ en1->setPosition(path.at(0)->get3dcoordinate());
TowerDefenseEnemyvector.push_back(en1);
for(unsigned int i = 0; i < path.size(); ++i)
@@ -208,15 +270,42 @@
void TowerDefense::end()
{
- Deathmatch::end();
+ TeamDeathmatch::end();
ChatManager::message("Match is over! Gameover!");
}
+ void TowerDefense::spawnPlayer(PlayerInfo* player)
+ {
+ assert(player);
+ this->player_ = player;
+
+ if (selecter->getPlayer() == NULL)
+ {
+ this->player_ = player;
+ player->startControl(selecter);
+ players_[player].state_ = PlayerState::Alive;
+ }
+ }
+
+ /**
+ @brief
+ Get the player.
+ @return
+ Returns a pointer to the player. If there is no player, NULL is returned.
+ */
+ PlayerInfo* TowerDefense::getPlayer(void) const
+ {
+ return this->player_;
+ }
+
//not working yet
void TowerDefense::upgradeTower(int x,int y)
- {/*
- const int upgradeCost = 20;
+ {
+ TDCoordinate* coord = new TDCoordinate(x,y);
+ x = coord->GetX();
+ y = coord->GetY();
+
if (!this->hasEnoughCreditForTower(upgradeCost))
{
@@ -224,7 +313,10 @@
return;
}
- if (towermatrix [x][y] == NULL)
+
+ Model* dummyModel2 = new Model(this->center_->getContext());
+
+ if (towerModelMatrix [x][y] == NULL || (towerModelMatrix [x][y])->getMeshSource() == dummyModel2->getMeshSource())
{
orxout() << "no tower on this position" << endl;
return;
@@ -232,25 +324,47 @@
else
{
- (towermatrix [x][y])->upgradeTower();
- }*/
+ (towerTurretMatrix [x][y])->upgradeTower();
+ switch(towerTurretMatrix[x][y]->upgrade)
+ {
+ case 1 :
+ towerModelMatrix[x][y]->setMeshSource("TD_T2.mesh");
+ break;
+
+ case 2 :
+ towerModelMatrix[x][y]->setMeshSource("TD_T3.mesh");
+ break;
+ case 3 :
+ towerModelMatrix[x][y]->setMeshSource("TD_T4.mesh");
+ break;
+ case 4 :
+ towerModelMatrix[x][y]->setMeshSource("TD_T5.mesh");
+ break;
+
+ }
+
+ this->buyTower(upgradeCost);
+ }
}
/*adds Tower at Position (x,y) and reduces credit and adds the point to the towermatrix. template ("towerturret")
so towers have ability if the turrets
+ */
- */
void TowerDefense::addTower(int x, int y)
- {
- const int towerCost = 20;
+ {
+ TDCoordinate* coord = new TDCoordinate(x,y);
+ x = coord->GetX();
+ y = coord->GetY();
+
if (!this->hasEnoughCreditForTower(towerCost))
{
orxout() << "not enough credit: " << (this->getCredit()) << " available, " << towerCost << " needed.";
return;
}
- if (towermatrix [x][y]==true)
+ if (towerModelMatrix [x][y]!=NULL)
{
orxout() << "not possible to put tower here!!" << endl;
return;
@@ -263,26 +377,36 @@
int tileScale = (int) this->center_->getTileScale();
- if (x > 15 || y > 15 || x < 0 || y < 0)
+ /*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;
+ //orxout() << "Will add tower at (" << (x-8) * tileScale << "," << (y-8) * tileScale << ")" << endl;
+ orxout() << "Will add tower at (" << x << "," << y << ")" << endl;
- //Reduce credit
- this->buyTower(towerCost);
- towermatrix [x][y]=true;
+ //Create Model
+ Model* newTowerModel = new Model(this->center_->getContext());
+ newTowerModel->setMeshSource("TD_T1.mesh");
+ newTowerModel->setScale(30);
+ newTowerModel->pitch(Degree(90));
+ newTowerModel->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 80);
+
//Creates tower
TowerDefenseTower* towernew = new TowerDefenseTower(this->center_->getContext());
- towernew->addTemplate("towerturret");
- towernew->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 75);
+ towernew->setPosition(static_cast<float>((x-8) * tileScale), static_cast<float>((y-8) * tileScale), 275);
towernew->setGame(this);
- }
+ towernew->setTeam(1);
+ //Reduce credit
+ this->buyTower(towerCost);
+ towerModelMatrix [x][y]= newTowerModel;
+ towerTurretMatrix [x][y]= towernew;
+ }
+
bool TowerDefense::hasEnoughCreditForTower(int towerCost)
{
return ((this->getCredit()) >= towerCost);
@@ -295,28 +419,146 @@
}
+ void TowerDefense::nextwave()
+ {
+
+ orxout() << "newwave" << endl;
+ TowerDefenseEnemyvector.clear();
+ waves_++;
+ //maxspaceships = round(maxspaceshipsstandard + 0.25*(waves_));
+ time=0;
+
+ int helpnumber = 40 -(waves_);
+ if(helpnumber <= 0) {helpnumber =1;}
+ float numSpaceships = std::abs((rand() % 100)*5*(helpnumber));
+ float numEggs = std::abs((rand() % 100)*1*(waves_));
+ float numUfos = std::abs((rand() % 100)*1.5*(0.5*(waves_))) ;
+
+ float totalnumber = (numSpaceships + numEggs + numUfos)*1.3;
+
+ int newspaceships = (int)(maxspaceships* numSpaceships / totalnumber);
+ int neweggs = (int)(maxspaceships*numEggs / totalnumber);
+ int newufos = (int)(maxspaceships*numUfos / totalnumber);
+ int newrandomships = maxspaceships -newspaceships - neweggs - newufos;
+ spaceships =newspaceships;
+ eggs=neweggs;
+ ufos=newufos;
+ randomships=newrandomships;
+
+ orxout() << spaceships << endl;
+ orxout() << eggs << endl;
+ orxout() << ufos << endl;
+ orxout() << randomships << endl;
+
+
+
+
+
+ }
+
void TowerDefense::tick(float dt)
{
SUPER(TowerDefense, tick, dt);
time +=dt;
+ timeSetTower_ +=dt;
+ //Check if tower has to be set (because TowerDefenseSelecter asks for it)
+ if(timeSetTower_ >= 0.25)
+ {
+ timeSetTower_ =0;
+ if(selecter != NULL && selecter->firePressed_)
+ {
+
+ int x = selecter->selectedPos_->GetX();
+ int y = selecter->selectedPos_->GetY();
+ Model* dummyModel2 = new Model(this->center_->getContext());
+
+
+
+ if(towerModelMatrix[x][y] == NULL)
+ {
+ addTower(x,y);
+ }
+ else
+ {
+ if(!((towerModelMatrix [x][y])->getMeshSource() == dummyModel2->getMeshSource()))
+ {
+ towerTurretMatrix[x][y]->upgradeTower();
+ if(towerTurretMatrix[x][y]->upgrade < towerTurretMatrix[x][y]->upgradeMax)
+ {
+ int specificupgradecost = (int)(upgradeCost*(std::pow(1.5,towerTurretMatrix[x][y]->upgrade)));
+ if(this->credit_ >= specificupgradecost)
+ {
+ this->buyTower(specificupgradecost);
+ switch(towerTurretMatrix[x][y]->upgrade)
+ {
+ case 1 :
+ towerModelMatrix[x][y]->setMeshSource("TD_T2.mesh");
+ break;
+
+ case 2 :
+ towerModelMatrix[x][y]->setMeshSource("TD_T3.mesh");
+ break;
+ case 3 :
+ towerModelMatrix[x][y]->setMeshSource("TD_T4.mesh");
+ break;
+ case 4 :
+ towerModelMatrix[x][y]->setMeshSource("TD_T5.mesh");
+ break;
+
+ }
+ }
+
+
+ }
+ }
+ }
+ selecter->firePressed_ = false;
+ }
+ }
+
TDCoordinate* coord1 = new TDCoordinate(1,1);
std::vector<TDCoordinate*> path;
path.push_back(coord1);
- if(time>1 && TowerDefenseEnemyvector.size() < 30)
- {
- //adds different types of enemys depending on the WaveNumber
- addTowerDefenseEnemy(path, this->getWaveNumber() % 3 +1 );
- time = time-1;
- }
+
+
+
+
+ if(time>=TowerDefenseEnemyvector.size() && TowerDefenseEnemyvector.size() < maxspaceships)
+ {
+
+ //adds different types of enemys depending on the WaveNumber progressively making the combination of enemys more difficult
+ if(spaceships>0)
+ {
+ addTowerDefenseEnemy(path, 1);
+ spaceships--;
+
+ }else if(ufos>0)
+ {
+ addTowerDefenseEnemy(path, 3);
+ ufos--;
+ }else if(eggs>0)
+ {
+ addTowerDefenseEnemy(path, 2);
+ eggs--;
+ }else if(randomships>0)
+ {
+ addTowerDefenseEnemy(path, rand() % 3 +1);
+ randomships--;
+
+ }
+
+ }
+
+
Vector3* endpoint = new Vector3(500, 700, 150);
//if ships are at the end they get destroyed
for(unsigned int i =0; i < TowerDefenseEnemyvector.size(); ++i)
{
if(TowerDefenseEnemyvector.at(i) != NULL && TowerDefenseEnemyvector.at(i)->isAlive())
{
- //destroys enemys at the end of teh path and reduces the life by 1. no credits gifted
+ //destroys enemys at the end of the path and reduces the life by 1. no credits gifted
Vector3 ship = TowerDefenseEnemyvector.at(i)->getRVWorldPosition();
float distance = ship.distance(*endpoint);
@@ -332,6 +574,7 @@
}
}
}
+
//goes thorugh vector to see if an enemy is still alive. if not next wave is launched
int count= 0;
for(unsigned int i =0; i < TowerDefenseEnemyvector.size(); ++i)
@@ -342,9 +585,12 @@
}
}
+ if (count == 0 && !this->nextwaveTimer_.isActive())
+ this->nextwaveTimer_.startTimer();
+
+/* time2 +=dt;
if(count== 0)
{
- time2 +=dt;
if(time2 > 10)
{
TowerDefenseEnemyvector.clear();
@@ -353,10 +599,11 @@
time2=0;
}
}
+*/
-
}
+
// 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???
@@ -398,7 +645,7 @@
/*
void TowerDefense::playerEntered(PlayerInfo* player)
{
- Deathmatch::playerEntered(player);
+ TeamDeathmatch::playerEntered(player);
const std::string& message = player->getName() + " entered the game";
ChatManager::message(message);
@@ -406,7 +653,7 @@
bool TowerDefense::playerLeft(PlayerInfo* player)
{
- bool valid_player = Deathmatch::playerLeft(player);
+ bool valid_player = TeamDeathmatch::playerLeft(player);
if (valid_player)
{
@@ -436,7 +683,7 @@
ChatManager::message(message);
}
- Deathmatch::pawnKilled(victim, killer);
+ TeamDeathmatch::pawnKilled(victim, killer);
}
void TowerDefense::playerScored(PlayerInfo* player, int score)
Modified: code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.h 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefense.h 2015-05-21 14:26:39 UTC (rev 10452)
@@ -37,29 +37,33 @@
#ifndef _TowerDefense_H__
#define _TowerDefense_H__
#include "TDCoordinate.h"
+#include "TowerDefenseSelecter.h"
#include "towerdefense/TowerDefensePrereqs.h"
-#include "gametypes/Deathmatch.h"
+#include "gametypes/TeamDeathmatch.h"
#include "TowerDefenseEnemy.h"
#include "util/Output.h"
#include "core/object/WeakPtr.h"
+#include "TowerDefenseSelecter.h"
+#include "graphics/Camera.h"
+
namespace orxonox
{
- class _TowerDefenseExport TowerDefense : public Deathmatch
+ class _TowerDefenseExport TowerDefense : public TeamDeathmatch
{
public:
TowerDefense(Context* context);
virtual ~TowerDefense();
std::vector<orxonox::WeakPtr<TowerDefenseEnemy> > TowerDefenseEnemyvector;
- bool towermatrix[16][16];
+ Model* towerModelMatrix[16][16];
+ TowerDefenseTower* towerTurretMatrix[16][16];
void addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr);
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);
- //Player Stats (set,get, reduce)
+ virtual void spawnPlayer(PlayerInfo* player);
+ PlayerInfo* getPlayer(void) const;
int getCredit(){ return this->credit_; }
int getLifes(){ return this->lifes_; }
int getWaveNumber(){ return this->waves_; }
@@ -68,9 +72,15 @@
void setWaveNumber(int wavenumber){ waves_=wavenumber; }
void buyTower(int cost){ credit_ -= cost;}
void addCredit(int credit) { credit_+=credit; }
- void nextwave(){ waves_++;}
+ void nextwave();
int reduceLifes(int NumberofLifes){ return lifes_-=NumberofLifes; }
+ TowerDefenseSelecter* selecter;
+ int spaceships;
+ int eggs;
+ int ufos;
+ int randomships;
+
//virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
//virtual void playerScored(PlayerInfo* player, int score);
@@ -82,11 +92,7 @@
/* Adds a tower at x, y in the playfield */
void addTower(int x, int y);
-
void upgradeTower(int x, int y);
- /* Part of a temporary hack to allow the player to add towers */
- ConsoleCommand* dedicatedAddTower_;
- ConsoleCommand* dedicatedUpgradeTower_;
//TODO: void spawnNewWave()
//TODO: create a timer which regularly calls the spawnNewWave function (time driven)
@@ -95,19 +101,18 @@
private:
TowerDefenseCenterpoint *center_;
+ PlayerInfo* player_;
float time;
- float time2;
+ float timeSetTower_;
+// float time2;
int credit_;
int waves_;
int lifes_;
+ Timer nextwaveTimer_;
/* handles stats */
bool hasEnoughCreditForTower(int towerCost);
bool hasEnoughCreditForUpgrade();
-
-
-
- std::vector<TowerTurret*> towers_;
};
}
Modified: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -52,7 +52,6 @@
this->width_ = 15;
this->height_ = 15;
- this->towerTemplate_ = "";
//this->setCollisionType(Static);
@@ -71,7 +70,7 @@
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);
+ XMLPortParam(TowerDefenseCenterpoint, "selecterTemplate", setSelecterTemplate, getSelecterTemplate, 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
Modified: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.h 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseCenterpoint.h 2015-05-21 14:26:39 UTC (rev 10452)
@@ -59,16 +59,16 @@
*/
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_; }
-
+ void setSelecterTemplate(const std::string& newTemplate)
+ { this->selecterTemplate_ = newTemplate; }
+ const std::string& getSelecterTemplate() const
+ { return this->selecterTemplate_; }
/**
@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)
*/
@@ -78,24 +78,13 @@
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();
+ std::string selecterTemplate_;
unsigned int width_;
unsigned int height_;
unsigned int tileScale_;
-
- std::string towerTemplate_;
};
}
Modified: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseEnemy.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseEnemy.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseEnemy.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -34,7 +34,11 @@
}
//add credit if enemy is destroyed
TowerDefenseEnemy::~TowerDefenseEnemy(){
- //this->td->addCredit(1);
+
+ if (this->isInitialized())
+ {
+ getGame()->addCredit(1);
+ }
}
void TowerDefenseEnemy::addWaypoint(TDCoordinate* coord)
@@ -63,10 +67,14 @@
Pawn::damage(damage, healthdamage, shielddamage, originator);
if (getGame() && once_ == false && getHealth() <= 0)
{
+ orxout() << "damagefunctionIF" << endl;
getGame()->addCredit(1);
once_ = true;
}
+ orxout() << "damagefunction" << endl;
+
}
+
/*
void TowerDefenseEnemy::popWaypoint()
{
Copied: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.cc (from rev 10451, code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefenseSelecter.cc)
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.cc (rev 0)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -0,0 +1,184 @@
+/*
+ * 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:
+ * Fabien Vultier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file TowerDefenseSelecter.cc
+ @brief This class represents your figure when you play the minigame. Here the movement of the figure, activating items, ... are handled.
+*/
+
+#include "TowerDefenseSelecter.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "graphics/Model.h"
+
+namespace orxonox
+{
+ RegisterClass(TowerDefenseSelecter);
+
+ TowerDefenseSelecter::TowerDefenseSelecter(Context* context) : ControllableEntity(context)
+ {
+ RegisterObject(TowerDefenseSelecter);
+
+ // initialize variables
+ moveUpPressed_ = false;
+ moveDownPressed_ = false;
+ moveLeftPressed_ = false;
+ moveRightPressed_ = false;
+ firePressed_ = false;
+ setSelectedPosition(6,6);
+ timerSetFire_=0;
+ }
+
+ TowerDefenseSelecter::~TowerDefenseSelecter()
+ {
+
+ }
+
+ void TowerDefenseSelecter::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(TowerDefenseSelecter, XMLPort, xmlelement, mode);
+ }
+
+ void TowerDefenseSelecter::tick(float dt)
+ {
+ SUPER(TowerDefenseSelecter, tick, dt);
+
+
+ if (hasLocalController())
+ {
+ timerSetFire_ +=dt;
+
+ if(timerSetFire_ >= 0.25)
+ {
+ timerSetFire_ = 0;
+
+ int selecterPosX = selectedPos_->GetX();
+ int selecterPosY = selectedPos_->GetY();
+
+ if (moveUpPressed_ == true)
+ {
+ moveUpPressed_ = false;
+ selectedPos_->Set(selecterPosX, selecterPosY + 1);
+ updatePosition();
+ }
+ if (moveDownPressed_ == true)
+ {
+ moveDownPressed_ = false;
+ selectedPos_->Set(selecterPosX, selecterPosY - 1);
+ updatePosition();
+ }
+
+ if (moveLeftPressed_ == true)
+ {
+ moveLeftPressed_ = false;
+ selectedPos_->Set(selecterPosX - 1, selecterPosY);
+ updatePosition();
+ }
+ if (moveRightPressed_ == true)
+ {
+ moveRightPressed_ = false;
+ selectedPos_->Set(selecterPosX + 1, selecterPosY);
+ updatePosition();
+ }
+
+
+ }
+
+
+
+ }
+ }
+
+
+ void TowerDefenseSelecter::moveFrontBack(const Vector2& value)
+ {
+ if (value.x > 0)
+ {
+ moveUpPressed_ = true;
+ moveDownPressed_ = false;
+ }
+ else
+ {
+ moveUpPressed_ = false;
+ moveDownPressed_ = true;
+ }
+ }
+
+ void TowerDefenseSelecter::moveRightLeft(const Vector2& value)
+ {
+ if (value.x > 0)
+ {
+ moveLeftPressed_ = false;
+ moveRightPressed_ = true;
+ }
+ else
+ {
+ moveLeftPressed_ = true;
+ moveRightPressed_ = false;
+ }
+ }
+
+ void TowerDefenseSelecter::rotateYaw(const Vector2& value)
+ {
+ }
+
+ void TowerDefenseSelecter::rotatePitch(const Vector2& value)
+ {
+ }
+
+ void TowerDefenseSelecter::rotateRoll(const Vector2& value)
+ {
+ }
+
+
+ void TowerDefenseSelecter::boost(bool bBoost)
+ {
+ firePressed_ = true;
+ orxout() << "boost" << endl;
+ }
+
+
+ void TowerDefenseSelecter::updatePosition()
+ {
+ setPosition(selectedPos_->get3dcoordinate());
+ }
+
+ void TowerDefenseSelecter::setSelectedPosition(TDCoordinate* newPos)
+ {
+ selectedPos_ = newPos;
+ updatePosition();
+ }
+
+ void TowerDefenseSelecter::setSelectedPosition(int x, int y)
+ {
+ setSelectedPosition(new TDCoordinate(x,y));
+ }
+
+
+}
Copied: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.h (from rev 10451, code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefenseSelecter.h)
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.h (rev 0)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseSelecter.h 2015-05-21 14:26:39 UTC (rev 10452)
@@ -0,0 +1,67 @@
+/*
+ * 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:
+ * Fabien Vultier
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _TowerDefenseSelecter_H__
+#define _TowerDefenseSelecter_H__
+
+#include "towerdefense/TowerDefensePrereqs.h"
+#include "worldentities/ControllableEntity.h"
+#include "TDCoordinate.h"
+
+namespace orxonox
+{
+class _TowerDefenseExport TowerDefenseSelecter : public ControllableEntity
+ {
+ public:
+ TowerDefenseSelecter(Context* context); //!< Constructor. Registers and initializes the object.
+ virtual ~TowerDefenseSelecter();
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void tick(float dt);
+ virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+ virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+ virtual void rotateYaw(const Vector2& value);
+ virtual void rotatePitch(const Vector2& value);
+ virtual void rotateRoll(const Vector2& value);
+ virtual void boost(bool bBoost);
+ virtual void setSelectedPosition(TDCoordinate* newPos);
+ virtual void setSelectedPosition(int x, int y);
+ bool firePressed_;
+ TDCoordinate* selectedPos_;
+
+
+ private:
+ virtual void updatePosition();
+ float timerSetFire_;
+ bool moveUpPressed_;
+ bool moveDownPressed_;
+ bool moveLeftPressed_;
+ bool moveRightPressed_;
+ };
+}
+
+#endif /* _TowerDefenseSelecter_H__ */
Modified: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -21,13 +21,17 @@
@brief
Constructor. Registers and initializes the object.
*/
- TowerDefenseTower::TowerDefenseTower(Context* context) : Pawn(context)
+ TowerDefenseTower::TowerDefenseTower(Context* context) : Turret(context)
{
RegisterObject(TowerDefenseTower);
-
- this->setCollisionType(WorldEntity::Dynamic);
+ game_ =NULL;
+ this->setCollisionType(WorldEntity::None);
upgrade = 0;
+ this->addTemplate("towerdefensetower");
+ upgradeMax = 5;
+
+
//this->removeAllEngines();
/*
@@ -37,6 +41,7 @@
*/
}
+ /*
void TowerDefenseTower::setOrientation(const Quaternion& orientation)
{
}
@@ -52,21 +57,22 @@
void TowerDefenseTower::rotateRoll(const Vector2& value)
{
}
+ */
bool TowerDefenseTower::upgradeTower()
{
- if(upgrade < 3)
+ if(upgrade < upgradeMax)
{
upgrade++;
float reloadrate = getReloadRate();
float reloadwaittime = getReloadWaitTime();
- this->setDamageMultiplier(5000);
-
- reloadrate = 0.5f*reloadrate;
- reloadwaittime = 0.5f*reloadwaittime;
+ this->setDamageMultiplier((upgrade+1)*1.5);
+ this->setRotationThrust(2*this->getRotationThrust());
+ reloadrate = 0.7f*reloadrate;
+ reloadwaittime = 0.7f*reloadwaittime;
setReloadRate(reloadrate);
setReloadWaitTime(reloadwaittime);
- this->addTemplate("towerturret1");
+ //this->addTemplate("towerturret1");
}
else
{
Modified: code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.h 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerDefenseTower.h 2015-05-21 14:26:39 UTC (rev 10452)
@@ -19,11 +19,12 @@
#include "towerdefense/TowerDefensePrereqs.h"
#include "worldentities/pawns/SpaceShip.h"
+#include "objects/Turret.h"
namespace orxonox
{
- class _TowerDefenseExport TowerDefenseTower : public Pawn
+ class _TowerDefenseExport TowerDefenseTower : public Turret
{
public:
TowerDefenseTower(Context* context);
@@ -36,18 +37,22 @@
*/
// Overriding these to stop TowerDefenseTowers from spasing out
+ /*
void setOrientation(const Quaternion& orientation);
virtual void rotateYaw(const Vector2& value);
virtual void rotatePitch(const Vector2& value);
virtual void rotateRoll(const Vector2& value);
+ */
virtual bool upgradeTower();
void setGame(TowerDefense* Towerdefense)
{ assert(Towerdefense); game_ = Towerdefense; }
+ int upgrade;
+ int upgradeMax;
private:
TowerDefense* game_;
- int upgrade;
+
};
}
Deleted: code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.cc
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -1,41 +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 "TowerTurret.h"
-
-#include "core/CoreIncludes.h"
-//#include "core/XMLPort.h"
-
-namespace orxonox
-{
- RegisterClass(TowerTurret);
-
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
- TowerTurret::TowerTurret(Context* context) : StaticEntity(context)
- {
- RegisterObject(TowerTurret);
-
- this->setCollisionType(WorldEntity::Static);
-
-
- }
-
- void TowerTurret::setOrientation(const Quaternion& orientation)
- {
- static int ori;
- orxout() << "orientation " << ++ori << endl;
- }
-
-
-}
Deleted: code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.h
===================================================================
--- code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.h 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/modules/towerdefense/TowerTurret.h 2015-05-21 14:26:39 UTC (rev 10452)
@@ -1,53 +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"
-#include "worldentities/StaticEntity.h"
-
-
-namespace orxonox
-{
- class _TowerDefenseExport TowerTurret : public StaticEntity
- {
- public:
- TowerTurret(Context* context);
- virtual ~TowerTurret() {};
-
- // Maybe later override these to move towers with cursor keys
- /*
- virtual void moveFrontBack(const Vector2& value);
- virtual void moveRightLeft(const Vector2& value);
- */
-
- // Overriding these to stop towers from spasing out
- void setOrientation(const Quaternion& orientation);
- //virtual void rotateYaw(const Vector2& value);
- //virtual void rotatePitch(const Vector2& value);
- //virtual void rotateRoll(const Vector2& value);
-
- void setGame(TowerDefense* towerdefense)
- { assert(towerdefense); game_ = towerdefense; }
- private:
- TowerDefense* game_;
- };
-}
-
-
-#endif
Modified: code/branches/presentationFS15/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/presentationFS15/src/orxonox/controllers/FormationController.cc 2015-05-21 14:10:10 UTC (rev 10451)
+++ code/branches/presentationFS15/src/orxonox/controllers/FormationController.cc 2015-05-21 14:26:39 UTC (rev 10452)
@@ -954,6 +954,8 @@
bool FormationController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
{
+
+
if (entity1 == entity2)
return true;
@@ -983,7 +985,7 @@
team2 = ac->getTeam();
}
- TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);
+ TeamGametype* tdm = orxonox_cast<TeamGametype*>(gametype);
if (tdm)
{
if (entity1->getPlayer())
@@ -993,16 +995,6 @@
team2 = tdm->getTeam(entity2->getPlayer());
}
- Mission* miss = orxonox_cast<Mission*>(gametype);
- if (miss)
- {
- if (entity1->getPlayer())
- team1 = miss->getTeam(entity1->getPlayer());
-
- if (entity2->getPlayer())
- team2 = miss->getTeam(entity2->getPlayer());
- }
-
TeamBaseMatchBase* base = 0;
base = orxonox_cast<TeamBaseMatchBase*>(entity1);
if (base)
More information about the Orxonox-commit
mailing list