[Orxonox-commit 5513] r10176 - in code/branches/presentationHS14: . data/gui/scripts data/levels data/levels/templates data/overlays src/modules src/modules/dodgerace2 src/modules/invader
maxima at orxonox.net
maxima at orxonox.net
Thu Dec 11 16:09:30 CET 2014
Author: maxima
Date: 2014-12-11 16:09:29 +0100 (Thu, 11 Dec 2014)
New Revision: 10176
Added:
code/branches/presentationHS14/data/levels/DodgeRace.oxw
code/branches/presentationHS14/data/levels/templates/DodgeRacePattern.oxt
code/branches/presentationHS14/data/levels/templates/spaceshipDodgeRace.oxt
code/branches/presentationHS14/data/overlays/DodgeRaceHUD.oxo
code/branches/presentationHS14/src/modules/dodgerace2/
code/branches/presentationHS14/src/modules/dodgerace2/CMakeLists.txt
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRacePrereqs.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.h
code/branches/presentationHS14/src/modules/invader/Invader.cc
code/branches/presentationHS14/src/modules/invader/Invader.h
code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.cc
code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.h
code/branches/presentationHS14/src/modules/invader/InvaderEnemy.cc
code/branches/presentationHS14/src/modules/invader/InvaderEnemy.h
code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.cc
code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.h
code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.cc
code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.h
code/branches/presentationHS14/src/modules/invader/InvaderPrereqs.h
code/branches/presentationHS14/src/modules/invader/InvaderShip.cc
code/branches/presentationHS14/src/modules/invader/InvaderShip.h
code/branches/presentationHS14/src/modules/invader/InvaderWeapon.cc
code/branches/presentationHS14/src/modules/invader/InvaderWeapon.h
code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.cc
code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.h
code/branches/presentationHS14/svn-commit.tmp
Removed:
code/branches/presentationHS14/src/modules/dodgerace2/CMakeLists.txt
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRacePrereqs.h
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.cc
code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.h
code/branches/presentationHS14/src/modules/invader/Invader.cc
code/branches/presentationHS14/src/modules/invader/Invader.h
code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.cc
code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.h
code/branches/presentationHS14/src/modules/invader/InvaderEnemy.cc
code/branches/presentationHS14/src/modules/invader/InvaderEnemy.h
code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.cc
code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.h
code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.cc
code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.h
code/branches/presentationHS14/src/modules/invader/InvaderPrereqs.h
code/branches/presentationHS14/src/modules/invader/InvaderShip.cc
code/branches/presentationHS14/src/modules/invader/InvaderShip.h
code/branches/presentationHS14/src/modules/invader/InvaderWeapon.cc
code/branches/presentationHS14/src/modules/invader/InvaderWeapon.h
code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.cc
code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.h
Modified:
code/branches/presentationHS14/
code/branches/presentationHS14/data/gui/scripts/CampaignMenu.lua
code/branches/presentationHS14/data/gui/scripts/campaign.txt
code/branches/presentationHS14/data/levels/templates/spaceshipInvader.oxt
code/branches/presentationHS14/src/modules/CMakeLists.txt
Log:
dodgeraceHS14 merged.
Property changes on: code/branches/presentationHS14
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/Racingbot:9388-9513
/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-10170
/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-10169
/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-10172
/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/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-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/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/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/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-10173
/code/branches/surfaceRace:9028-9199
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/turret:9380-9501
/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/Racingbot:9388-9513
/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-10170
/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-10169
/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-10172
/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/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-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/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/presentationHS12:9481-9525
/code/branches/presentationHS13:9891-9938
/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-10173
/code/branches/surfaceRace:9028-9199
/code/branches/surfaceraceHS14:10080-10175
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/turret:9380-9501
/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
Modified: code/branches/presentationHS14/data/gui/scripts/CampaignMenu.lua
===================================================================
--- code/branches/presentationHS14/data/gui/scripts/CampaignMenu.lua 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/data/gui/scripts/CampaignMenu.lua 2014-12-11 15:09:29 UTC (rev 10176)
@@ -51,7 +51,7 @@
end
function P.CheckLevel(filename)
- local file = io.open("/home/pmao/pmao-extra-0/orxonox/storymodeHS14/data/gui/scripts/campaign.txt", "r+")
+ local file = io.open("/home/maxima/maxima-extra-0/orxonox/presentationHS14/data/gui/scripts/campaign.txt", "r+")
local index = 0
local returnvalue = false
local numberoflines = 58-string.len(filename)
@@ -133,4 +133,4 @@
hideMenuSheet(P.name)
end
-return P
\ No newline at end of file
+return P
Modified: code/branches/presentationHS14/data/gui/scripts/campaign.txt
===================================================================
--- code/branches/presentationHS14/data/gui/scripts/campaign.txt 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/data/gui/scripts/campaign.txt 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,7 +1,7 @@
1f you want to insert a new level do not use tab use .
spacebar!!! .
missionOne.oxw 1 .
-fightInOurBack.oxw 1 .
-pirateAttack.oxw 1 .
+fightInOurBack.oxw 0 .
+pirateAttack.oxw 0 .
iJohnVane_TriptoArea51.oxw 0 .
-............................................................
\ No newline at end of file
+............................................................
Copied: code/branches/presentationHS14/data/levels/DodgeRace.oxw (from rev 10175, code/branches/surfaceraceHS14/data/levels/DodgeRace.oxw)
===================================================================
--- code/branches/presentationHS14/data/levels/DodgeRace.oxw (rev 0)
+++ code/branches/presentationHS14/data/levels/DodgeRace.oxw 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,67 @@
+<LevelInfo
+ name = "Dodge Race"
+ description = "Try to come as far as possible"
+ tags = "minigame"
+ screenshot = "DodgeRace.png"
+/>
+<?lua
+ include("stats.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipDodgeRace.oxt")
+ include("templates/enemyInvader.oxt")
+ include("templates/DodgeRacePattern.oxt")
+ include("overlays/DodgeRaceHUD.oxo")
+?>
+
+<Level gametype = DodgeRace>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "1.0, 1.0, 1.0"
+ skybox = "Orxonox/skyBoxClouds"
+ negativeWorldRange = "-100000, -100000, -100000"
+ positiveWorldRange = " 100000, 100000, 100000"
+ >
+
+ <WorldAmbientSound
+ source="Earth.ogg"
+ looping="true"
+ playOnLoad="true"
+ />
+
+ <!-- <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"/> -->
+ <Light type=directional position="-100, 10000, -700" lookat="0.2, -1, 0" 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=DodgeRaceShip pawndesign=spaceshipdodgerace />
+
+ <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=10 stayActive="true" delay=0 />
+
+
+ <DodgeRaceCenterPoint name=invadercenter />
+
+ <StaticEntity position="0,-50,0" direction="0,0,0" scale="1" collisionType=static mass=1 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="plane.mesh" scale3D="100000,0,100000" />
+ </attached>
+
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="1,1,1" />
+ </collisionShapes>
+
+ </StaticEntity>
+
+
+
+
+
+
+ </Scene>
+</Level>
+
Copied: code/branches/presentationHS14/data/levels/templates/DodgeRacePattern.oxt (from rev 10175, code/branches/surfaceraceHS14/data/levels/templates/DodgeRacePattern.oxt)
===================================================================
--- code/branches/presentationHS14/data/levels/templates/DodgeRacePattern.oxt (rev 0)
+++ code/branches/presentationHS14/data/levels/templates/DodgeRacePattern.oxt 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,61 @@
+<Template name=DodgeRaceCube01>
+
+ <DodgeRaceCube position="0,0,0" direction="0,0,0" scale="1" collisionType=dynamic mass=1 friction=0.01 >
+ <attached>
+ <Model position="700,0,50" mesh="CuboidBody.mesh" scale3D="300,50,50" />
+ <Model position="700,0,1150" mesh="CuboidBody.mesh" scale3D="300,50,50" />
+ <Model position="1200,0,200" mesh="CuboidBody.mesh" scale3D="100,50,100" />
+ <Model position="1200,0,1000" mesh="CuboidBody.mesh" scale3D="100,50,100" />
+ <Model position="1250,-10,430" mesh="CuboidBody.mesh" scale3D="50,40,30" />
+ <Model position="1250,-10,600" mesh="CuboidBody.mesh" scale3D="50,40,30" />
+ <Model position="1250,-10,770" mesh="CuboidBody.mesh" scale3D="50,40,30" />
+ <Model position="1650,0,350" mesh="CuboidBody.mesh" scale3D="50,50,150" />
+ <Model position="1650,0,850" mesh="CuboidBody.mesh" scale3D="50,50,150" />
+ <Model position="2100,0,150" mesh="CuboidBody.mesh" scale3D="100,50,150" />
+ <Model position="2100,0,1050" mesh="CuboidBody.mesh" scale3D="100,50,150" />
+ <Model position="2150,0,600" mesh="CuboidBody.mesh" scale3D="50,50,100" />
+ </attached>
+
+ <collisionShapes>
+ <BoxCollisionShape position="700,0,50" halfExtents="300,50,50" />
+ <BoxCollisionShape position="700,0,1150" halfExtents="300,50,50" />
+ <BoxCollisionShape position="1200,0,200" halfExtents="100,50,100" />
+ <BoxCollisionShape position="1200,0,1000" halfExtents="100,50,100" />
+ <BoxCollisionShape position="1250,-10,430" halfExtents="50,40,30" />
+ <BoxCollisionShape position="1250,-10,600" halfExtents="50,40,30" />
+ <BoxCollisionShape position="1250,-10,770" halfExtents="50,40,30" />
+ <BoxCollisionShape position="1650,0,350" halfExtents="50,50,150" />
+ <BoxCollisionShape position="1650,0,850" halfExtents="50,50,150" />
+ <BoxCollisionShape position="2100,0,150" halfExtents="100,50,150" />
+ <BoxCollisionShape position="2100,0,1050" halfExtents="100,50,150" />
+ <BoxCollisionShape position="2150,0,600" halfExtents="50,50,100" />
+ </collisionShapes>
+ </DodgeRaceCube>
+
+</Template>
+
+<Template name=DodgeRaceCube02>
+
+ <DodgeRaceCube position="0,0,0" direction="0,0,0" scale="1" collisionType=dynamic mass=1 friction=0.01 >
+ <attached>
+ <Model position="450,0,300" mesh="CuboidBody.mesh" scale3D="50,50,300" />
+ <Model position="950,0,850" mesh="CuboidBody.mesh" scale3D="50,50,350" />
+ <Model position="1350,0,200" mesh="CuboidBody.mesh" scale3D="50,50,200" />
+ <Model position="1350,0,700" mesh="CuboidBody.mesh" scale3D="50,50,100" />
+ <Model position="1750,0,350" mesh="CuboidBody.mesh" scale3D="50,50,350" />
+ <Model position="2000,0,1000" mesh="CuboidBody.mesh" scale3D="100,50,100" />
+ <Model position="1650,0,1150" mesh="CuboidBody.mesh" scale3D="450,50,50" />
+ </attached>
+
+ <collisionShapes>
+ <BoxCollisionShape position="450,0,300" halfExtents="50,50,300" />
+ <BoxCollisionShape position="950,0,850" halfExtents="50,50,350" />
+ <BoxCollisionShape position="1350,0,200" halfExtents="50,50,200" />
+ <BoxCollisionShape position="1350,0,700" halfExtents="50,50,100" />
+ <BoxCollisionShape position="1750,0,350" halfExtents="50,50,350" />
+ <BoxCollisionShape position="2000,0,1000" halfExtents="100,50,100" />
+ <BoxCollisionShape position="1650,0,1150" halfExtents="450,50,50" />
+ </collisionShapes>
+ </DodgeRaceCube>
+
+</Template>
\ No newline at end of file
Copied: code/branches/presentationHS14/data/levels/templates/spaceshipDodgeRace.oxt (from rev 10175, code/branches/surfaceraceHS14/data/levels/templates/spaceshipDodgeRace.oxt)
===================================================================
--- code/branches/presentationHS14/data/levels/templates/spaceshipDodgeRace.oxt (rev 0)
+++ code/branches/presentationHS14/data/levels/templates/spaceshipDodgeRace.oxt 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,117 @@
+<Template name=spaceshipdodgerace>
+ <DodgeRaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipescortcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 4
+
+ health = 40
+ maxhealth = 40
+ initialhealth = 40
+
+ shieldhealth = 20
+ initialshieldhealth = 20
+ maxshieldhealth = 20
+ shieldabsorption = 0.1
+ reloadrate = 1
+ reloadwaittime = 1
+
+ primaryThrust = 150
+ auxilaryThrust = 30
+ rotationThrust = 50
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 20
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ shakeFrequency = 15
+ shakeAmplitude = 6
+
+ collisionType = "dynamic"
+ mass = 4200000
+ linearDamping = 0.9999999
+ angularDamping = 0.9999999
+
+ collisiondamage = 100
+ enablecollisiondamage = true
+
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipinvaderengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipinvaderengine />
+ </engines>
+ <attached>
+ <Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=4 mesh="escortShip.mesh" />
+ <Model position="0,0,0" yaw=180 pitch=90 roll=0 scale=4 mesh="escortWeapon.mesh" />
+<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
+<Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="-12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="0,0,-12" scale3D="4,4,7" /-->
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0 ,0 , 3" halfExtents="10, 4,8" />
+ <BoxCollisionShape position="12.6 ,-2, 3" halfExtents="2.8,2.8,11"/>
+ <BoxCollisionShape position="-12.6,-2, 3" halfExtents="2.8,2.8,11"/>
+ <BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" />
+ </collisionShapes>
+<?lua
+ include("../includes/invaderWeapon.oxi")
+?>
+ </DodgeRaceShip>
+</Template>
+
+<Template name=spaceshipescortcameras defaults=0>
+ <DodgeRaceShip>
+ <camerapositions>
+ <CameraPosition position="0,100,180" direction="0, -0.2, -1" drag=false mouselook=true />
+ <CameraPosition position="0,200,250" direction="0, -0.4, -1" drag=false mouselook=true />
+ <CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true />
+ <CameraPosition position="0,1300,-100" direction="0, -1, 0" drag=false mouselook=true />
+ </camerapositions>
+ </DodgeRaceShip>
+</Template>
+
+<Template name=spaceshipinvaderengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2.2
+
+ speedfront = 200
+ speedback = 70
+ speedleftright = 70
+ speedupdown = 70
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+
+ accelerationfront = 700
+ accelerationbrake = 700
+ accelerationback = 125
+ accelerationleftright = 125
+ accelerationupdown = 125
+ >
+ <EffectContainer condition="idle">
+ <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+ </EffectContainer>
+ <EffectContainer condition="not idle">
+ <FadingBillboard mainstate=activity active=false scale=0.09 position="12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.09 position="-12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+ <EffectContainer condition="normal or brake">
+
+ </EffectContainer>
+ <EffectContainer condition="normal or boost">
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+ <EffectContainer condition="boost">
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ </EffectContainer>
+
+ </MultiStateEngine>
+</Template>
\ No newline at end of file
Modified: code/branches/presentationHS14/data/levels/templates/spaceshipInvader.oxt
===================================================================
--- code/branches/presentationHS14/data/levels/templates/spaceshipInvader.oxt 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/data/levels/templates/spaceshipInvader.oxt 2014-12-11 15:09:29 UTC (rev 10176)
@@ -67,9 +67,9 @@
<Template name=spaceshipescortcameras defaults=0>
<InvaderShip>
<camerapositions>
-<!-- <CameraPosition position="0,15, 60" drag=true mouselook=true />
- <CameraPosition position="0,20, 90" drag=true mouselook=true />
- <CameraPosition position="0,30,120" drag=true mouselook=true /> -->
+ <!-- <CameraPosition position="0,15, 60" drag=true mouselook=true />
+ <CameraPosition position="0,20, 90" drag=true mouselook=true />
+ <CameraPosition position="0,30,120" direction="0, 0, -1" drag=false mouselook=true /> -->
<CameraPosition position="0,300,-100" direction="0, -1, 0" drag=false mouselook=true />
</camerapositions>
</InvaderShip>
Copied: code/branches/presentationHS14/data/overlays/DodgeRaceHUD.oxo (from rev 10175, code/branches/surfaceraceHS14/data/overlays/DodgeRaceHUD.oxo)
===================================================================
--- code/branches/presentationHS14/data/overlays/DodgeRaceHUD.oxo (rev 0)
+++ code/branches/presentationHS14/data/overlays/DodgeRaceHUD.oxo 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,38 @@
+<Template name="spectatorhud">
+ <OverlayGroup name = "spectatorhud" scale = "1, 1">
+ </OverlayGroup>
+</Template>
+
+<Template name="DodgeRaceHUD">
+ <OverlayGroup name="DodgeRaceHUD" scale = "1, 1">
+
+ <OverlayText
+ position = "0.02, 0.02"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ caption = "Points: "
+ />
+
+ <DodgeRaceHUDinfo
+ position = "0.14, 0.02"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+
+ showpoints = true
+ />
+
+
+ </OverlayGroup>
+</Template>
+
+<Template name="spaceshiphud">
+ <OverlayGroup name = "spaceshiphud" scale = "1, 1">
+
+ </OverlayGroup>
+</Template>
\ No newline at end of file
Modified: code/branches/presentationHS14/src/modules/CMakeLists.txt
===================================================================
--- code/branches/presentationHS14/src/modules/CMakeLists.txt 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/CMakeLists.txt 2014-12-11 15:09:29 UTC (rev 10176)
@@ -39,3 +39,4 @@
ADD_SUBDIRECTORY(docking)
ADD_SUBDIRECTORY(towerdefense)
ADD_SUBDIRECTORY(invader)
+ADD_SUBDIRECTORY(dodgerace2)
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/CMakeLists.txt
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/CMakeLists.txt 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/CMakeLists.txt 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,17 +0,0 @@
-SET_SOURCE_FILES(Dodgerace2_SRC_FILES
-DodgeRace.cc
-DodgeRaceCenterPoint.cc
-DodgeRaceShip.cc
-DodgeRaceCube.cc
-DodgeRaceHUDinfo.cc
-)
-
-ORXONOX_ADD_LIBRARY(dodgerace2
- MODULE
- FIND_HEADER_FILES
- LINK_LIBRARIES
- orxonox
- overlays
- weapons
- SOURCE_FILES ${Dodgerace2_SRC_FILES}
-)
Copied: code/branches/presentationHS14/src/modules/dodgerace2/CMakeLists.txt (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/CMakeLists.txt)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/CMakeLists.txt (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/CMakeLists.txt 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,17 @@
+SET_SOURCE_FILES(Dodgerace2_SRC_FILES
+DodgeRace.cc
+DodgeRaceCenterPoint.cc
+DodgeRaceShip.cc
+DodgeRaceCube.cc
+DodgeRaceHUDinfo.cc
+)
+
+ORXONOX_ADD_LIBRARY(dodgerace2
+ MODULE
+ FIND_HEADER_FILES
+ LINK_LIBRARIES
+ orxonox
+ overlays
+ weapons
+ SOURCE_FILES ${Dodgerace2_SRC_FILES}
+)
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.cc
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,231 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file DodgeRace.cc
- @brief Implementation of the DodgeRace class.
-*/
-
-#include "DodgeRace.h"
-#include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
-#include "DodgeRaceCube.h"
-
-namespace orxonox
-{
- RegisterUnloadableClass(DodgeRace);
-
- DodgeRace::DodgeRace(Context* context) : Deathmatch(context)
- {
- RegisterObject(DodgeRace);
- init();
- this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
- this->center_ = 0;
-
- this->setHUDTemplate("DodgeRaceHUD");
- }
-
- void DodgeRace::init()
- {
- bEndGame = false;
- lives = 1;
- level = 1;
- point = 0;
- bShowLevel = false;
- multiplier = 1;
- b_combo = false;
- counter = 5000;
- pattern = 1;
- lastPosition = 0;
- // spawn enemy every 3.5 seconds
- //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
- comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
- }
-
- void DodgeRace::levelUp()
- {
- level++;
- if (getPlayer() != NULL)
- {
- for (int i = 0; i < 7; i++)
- {
- WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
- chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
- chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
- chunk->setScale(20);
- }
- }
- addPoints(multiplier * 42);
- multiplier *= 2;
- toggleShowLevel();
- showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&DodgeRace::toggleShowLevel, this)));
- }
-
- void DodgeRace::tick(float dt)
- {
- if (getPlayer() != NULL)
- {
- //WeakPtr<DodgeRaceShip> ship = getPlayer();
-
- currentPosition = getPlayer()->getWorldPosition().x;
- counter = counter + (currentPosition - lastPosition);
- lastPosition = currentPosition;
- point = currentPosition;
- getPlayer()->speed = 830 - (point / 1000);
-
- for(uint i=0; i < cubeList.size();i++)
- {
- if(cubeList.at(i)->getPosition().x < currentPosition-3000)
- {
- cubeList.at(i)->destroy();
- cubeList.erase(cubeList.begin()+i);
- }
- }
-
- if(counter >= 3000)
- {
- counter = 0;
- for(int i = 0; i<6; i++)
- {
- WeakPtr<DodgeRaceCube> cube = new DodgeRaceCube(this->center_->getContext());
- cubeList.push_back(cube);
- switch(pattern)
- {
- case 1: cube->addTemplate("DodgeRaceCube01");
- break;
- case 2: cube->addTemplate("DodgeRaceCube02");
- break;
-
- }
-
- cube->setPosition(getPlayer()->getWorldPosition() + Vector3(5000, 0, -3600 + (i*1200)));
- //stEntity->setScale3D(50,50,50);
- }
-
-
- pattern %= 2;
- pattern ++;
-
- }
-
- }
- SUPER(DodgeRace, tick, dt);
- }
-
- WeakPtr<DodgeRaceShip> DodgeRace::getPlayer()
- {
- if (player == NULL)
- {
- for (ObjectList<DodgeRaceShip>::iterator it = ObjectList<DodgeRaceShip>::begin(); it != ObjectList<DodgeRaceShip>::end(); ++it)
- {
- player = *it;
- }
- }
- return player;
- }
-
- void DodgeRace::costLife()
- {
- //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&DodgeRace::end, this)));
- lives = 0;
- };
-
- void DodgeRace::comboControll()
- {
- if (b_combo)
- multiplier++;
- // if no combo was performed before, reset multiplier
- else
- multiplier = 1;
- b_combo = false;
- }
-
- void DodgeRace::start()
- {
- orxout() << "start" << endl;
- init();
- for(uint i=0; i< cubeList.size();i++)
- {
- cubeList.at(i)->destroy();
- cubeList.erase(cubeList.begin()+i);
-
- }
- cubeList.clear();
- // Set variable to temporarily force the player to spawn.
- this->bForceSpawn_ = false;
-
- if (this->center_ == NULL) // abandon mission!
- {
- orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl;
- GSLevel::startMainMenu();
- return;
- }
- // Call start for the parent class.
- Deathmatch::start();
- }
-
- void DodgeRace::playerPreSpawn(PlayerInfo* player)
- {
- if(lives <= 0)
- {
- this->end();
- }
-
- // Reset all the cubes
- /*
- orxout() << "prespawn" << endl;
- init();
- for(int i=0; i< cubeList.size();i++)
- {
- cubeList.at(i)->destroy();
- cubeList.erase(cubeList.begin()+i);
- }
- cubeList.clear();
- lives = 1;
- point = 0;
- lastPosition = 0;
- */
- }
-
- void DodgeRace::addPoints(int numPoints)
- {
- if (!bEndGame)
- {
- point += numPoints * multiplier;
- b_combo = true;
- }
- }
-
- void DodgeRace::end()
- {
- // DON'T CALL THIS!
- // Deathmatch::end();
- // It will misteriously crash the game!
- // Instead startMainMenu, this won't crash.
- GSLevel::startMainMenu();
- }
-}
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,231 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DodgeRace.cc
+ @brief Implementation of the DodgeRace class.
+*/
+
+#include "DodgeRace.h"
+#include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
+#include "DodgeRaceCube.h"
+
+namespace orxonox
+{
+ RegisterUnloadableClass(DodgeRace);
+
+ DodgeRace::DodgeRace(Context* context) : Deathmatch(context)
+ {
+ RegisterObject(DodgeRace);
+ init();
+ this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
+ this->center_ = 0;
+
+ this->setHUDTemplate("DodgeRaceHUD");
+ }
+
+ void DodgeRace::init()
+ {
+ bEndGame = false;
+ lives = 1;
+ level = 1;
+ point = 0;
+ bShowLevel = false;
+ multiplier = 1;
+ b_combo = false;
+ counter = 5000;
+ pattern = 1;
+ lastPosition = 0;
+ // spawn enemy every 3.5 seconds
+ //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
+ comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
+ }
+
+ void DodgeRace::levelUp()
+ {
+ level++;
+ if (getPlayer() != NULL)
+ {
+ for (int i = 0; i < 7; i++)
+ {
+ WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
+ chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
+ chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
+ chunk->setScale(20);
+ }
+ }
+ addPoints(multiplier * 42);
+ multiplier *= 2;
+ toggleShowLevel();
+ showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&DodgeRace::toggleShowLevel, this)));
+ }
+
+ void DodgeRace::tick(float dt)
+ {
+ if (getPlayer() != NULL)
+ {
+ //WeakPtr<DodgeRaceShip> ship = getPlayer();
+
+ currentPosition = getPlayer()->getWorldPosition().x;
+ counter = counter + (currentPosition - lastPosition);
+ lastPosition = currentPosition;
+ point = currentPosition;
+ getPlayer()->speed = 830 - (point / 1000);
+
+ for(uint i=0; i < cubeList.size();i++)
+ {
+ if(cubeList.at(i)->getPosition().x < currentPosition-3000)
+ {
+ cubeList.at(i)->destroy();
+ cubeList.erase(cubeList.begin()+i);
+ }
+ }
+
+ if(counter >= 3000)
+ {
+ counter = 0;
+ for(int i = 0; i<6; i++)
+ {
+ WeakPtr<DodgeRaceCube> cube = new DodgeRaceCube(this->center_->getContext());
+ cubeList.push_back(cube);
+ switch(pattern)
+ {
+ case 1: cube->addTemplate("DodgeRaceCube01");
+ break;
+ case 2: cube->addTemplate("DodgeRaceCube02");
+ break;
+
+ }
+
+ cube->setPosition(getPlayer()->getWorldPosition() + Vector3(5000, 0, -3600 + (i*1200)));
+ //stEntity->setScale3D(50,50,50);
+ }
+
+
+ pattern %= 2;
+ pattern ++;
+
+ }
+
+ }
+ SUPER(DodgeRace, tick, dt);
+ }
+
+ WeakPtr<DodgeRaceShip> DodgeRace::getPlayer()
+ {
+ if (player == NULL)
+ {
+ for (ObjectList<DodgeRaceShip>::iterator it = ObjectList<DodgeRaceShip>::begin(); it != ObjectList<DodgeRaceShip>::end(); ++it)
+ {
+ player = *it;
+ }
+ }
+ return player;
+ }
+
+ void DodgeRace::costLife()
+ {
+ //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&DodgeRace::end, this)));
+ lives = 0;
+ };
+
+ void DodgeRace::comboControll()
+ {
+ if (b_combo)
+ multiplier++;
+ // if no combo was performed before, reset multiplier
+ else
+ multiplier = 1;
+ b_combo = false;
+ }
+
+ void DodgeRace::start()
+ {
+ orxout() << "start" << endl;
+ init();
+ for(uint i=0; i< cubeList.size();i++)
+ {
+ cubeList.at(i)->destroy();
+ cubeList.erase(cubeList.begin()+i);
+
+ }
+ cubeList.clear();
+ // Set variable to temporarily force the player to spawn.
+ this->bForceSpawn_ = false;
+
+ if (this->center_ == NULL) // abandon mission!
+ {
+ orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl;
+ GSLevel::startMainMenu();
+ return;
+ }
+ // Call start for the parent class.
+ Deathmatch::start();
+ }
+
+ void DodgeRace::playerPreSpawn(PlayerInfo* player)
+ {
+ if(lives <= 0)
+ {
+ this->end();
+ }
+
+ // Reset all the cubes
+ /*
+ orxout() << "prespawn" << endl;
+ init();
+ for(int i=0; i< cubeList.size();i++)
+ {
+ cubeList.at(i)->destroy();
+ cubeList.erase(cubeList.begin()+i);
+ }
+ cubeList.clear();
+ lives = 1;
+ point = 0;
+ lastPosition = 0;
+ */
+ }
+
+ void DodgeRace::addPoints(int numPoints)
+ {
+ if (!bEndGame)
+ {
+ point += numPoints * multiplier;
+ b_combo = true;
+ }
+ }
+
+ void DodgeRace::end()
+ {
+ // DON'T CALL THIS!
+ // Deathmatch::end();
+ // It will misteriously crash the game!
+ // Instead startMainMenu, this won't crash.
+ GSLevel::startMainMenu();
+ }
+}
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.h
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,149 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file DodgeRace.h
- @brief Gametype.
- @ingroup DodgeRace
-*/
-
-#ifndef _DodgeRace_H__
-#define _DodgeRace_H__
-
-#include "dodgerace2/DodgeRacePrereqs.h"
-
-#include "DodgeRaceCenterPoint.h" // Necessary for WeakPointer??
-//#include "DodgeRaceShip.h" DO NOT include in Header. Will cause forward declaration issues
-
-//#include "DodgeRaceHUDinfo.h"
-
-
-#include "core/CoreIncludes.h"
-#include "core/EventIncludes.h"
-#include "core/command/Executor.h"
-#include "core/config/ConfigValueIncludes.h"
-
-#include "gamestates/GSLevel.h"
-#include "chat/ChatManager.h"
-#include <vector>
-
-// ! HACK
-#include "infos/PlayerInfo.h"
-
-#include "core/command/ConsoleCommand.h"
-#include "worldentities/BigExplosion.h"
-
-#include "gametypes/Deathmatch.h"
-#include "tools/Timer.h"
-
-namespace orxonox
-{
-
- class _DodgeRaceExport DodgeRace : public Deathmatch
- {
- public:
- DodgeRace(Context* context);
-
- void init();
-
- virtual void start();
- virtual void end();
-
- virtual void tick(float dt);
-
- virtual void playerPreSpawn(PlayerInfo* player);
-
- void levelUp();
-
- int getLives(){return this->lives;}
- int getLevel(){return this->level;}
- int getPoints(){return this->point;}
- int getMultiplier(){return this->multiplier;}
-
- void setCenterpoint(DodgeRaceCenterPoint* center)
- { this->center_ = center; }
- virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
-
- // checks if multiplier should be reset.
- void comboControll();
- void costLife();
-
- bool bEndGame;
- bool bShowLevel;
- int lives;
- int multiplier;
- int counter;
- int pattern;
- int currentPosition;
- int lastPosition;
-
- private:
- Timer endGameTimer;
-
- WeakPtr<DodgeRaceShip> getPlayer();
- WeakPtr<DodgeRaceShip> player;
- std::vector<DodgeRaceCube*> cubeList;
- void toggleShowLevel(){bShowLevel = !bShowLevel;}
- void addPoints(int numPoints);
-
- WeakPtr<DodgeRaceCenterPoint> center_;
- int level;
- int point;
- bool b_combo;
-
- Timer enemySpawnTimer;
- Timer comboTimer;
- Timer showLevelTimer;
-
-
- /*
-
- //void spawnEnemy();
-
-
-
-
-
-
-
-
-
-
-
-
- private:
-
-
-
-
- //Context* context;
- */
- };
-}
-
-#endif /* _DodgeRace_H__ */
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.h)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.h (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRace.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,149 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DodgeRace.h
+ @brief Gametype.
+ @ingroup DodgeRace
+*/
+
+#ifndef _DodgeRace_H__
+#define _DodgeRace_H__
+
+#include "dodgerace2/DodgeRacePrereqs.h"
+
+#include "DodgeRaceCenterPoint.h" // Necessary for WeakPointer??
+//#include "DodgeRaceShip.h" DO NOT include in Header. Will cause forward declaration issues
+
+//#include "DodgeRaceHUDinfo.h"
+
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+#include "core/command/Executor.h"
+#include "core/config/ConfigValueIncludes.h"
+
+#include "gamestates/GSLevel.h"
+#include "chat/ChatManager.h"
+#include <vector>
+
+// ! HACK
+#include "infos/PlayerInfo.h"
+
+#include "core/command/ConsoleCommand.h"
+#include "worldentities/BigExplosion.h"
+
+#include "gametypes/Deathmatch.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+
+ class _DodgeRaceExport DodgeRace : public Deathmatch
+ {
+ public:
+ DodgeRace(Context* context);
+
+ void init();
+
+ virtual void start();
+ virtual void end();
+
+ virtual void tick(float dt);
+
+ virtual void playerPreSpawn(PlayerInfo* player);
+
+ void levelUp();
+
+ int getLives(){return this->lives;}
+ int getLevel(){return this->level;}
+ int getPoints(){return this->point;}
+ int getMultiplier(){return this->multiplier;}
+
+ void setCenterpoint(DodgeRaceCenterPoint* center)
+ { this->center_ = center; }
+ virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
+
+ // checks if multiplier should be reset.
+ void comboControll();
+ void costLife();
+
+ bool bEndGame;
+ bool bShowLevel;
+ int lives;
+ int multiplier;
+ int counter;
+ int pattern;
+ int currentPosition;
+ int lastPosition;
+
+ private:
+ Timer endGameTimer;
+
+ WeakPtr<DodgeRaceShip> getPlayer();
+ WeakPtr<DodgeRaceShip> player;
+ std::vector<DodgeRaceCube*> cubeList;
+ void toggleShowLevel(){bShowLevel = !bShowLevel;}
+ void addPoints(int numPoints);
+
+ WeakPtr<DodgeRaceCenterPoint> center_;
+ int level;
+ int point;
+ bool b_combo;
+
+ Timer enemySpawnTimer;
+ Timer comboTimer;
+ Timer showLevelTimer;
+
+
+ /*
+
+ //void spawnEnemy();
+
+
+
+
+
+
+
+
+
+
+
+
+ private:
+
+
+
+
+ //Context* context;
+ */
+ };
+}
+
+#endif /* _DodgeRace_H__ */
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.cc
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,72 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file DodgeRaceCenterPoint.cc
- @brief Implementation of the DodgeRaceCenterPoint class.
-*/
-
-#include "DodgeRaceCenterPoint.h"
-
-#include "core/CoreIncludes.h"
-
-#include "DodgeRace.h"
-
-namespace orxonox
-{
- RegisterClass(DodgeRaceCenterPoint);
-
- DodgeRaceCenterPoint::DodgeRaceCenterPoint(Context* context) : StaticEntity(context)
- {
- RegisterObject(DodgeRaceCenterPoint);
-
- this->checkGametype();
- }
-
- void DodgeRaceCenterPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- SUPER(DodgeRaceCenterPoint, XMLPort, xmlelement, mode);
- }
-
- void DodgeRaceCenterPoint::changedGametype()
- {
- SUPER(DodgeRaceCenterPoint, changedGametype);
-
- // Check, whether it's still DodgeRace.
- this->checkGametype();
- }
-
- void DodgeRaceCenterPoint::checkGametype()
- {
- if (this->getGametype() != NULL && this->getGametype()->isA(Class(DodgeRace)))
- {
- DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype().get());
- DodgeRaceGametype->setCenterpoint(this);
- }
- }
-}
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,72 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DodgeRaceCenterPoint.cc
+ @brief Implementation of the DodgeRaceCenterPoint class.
+*/
+
+#include "DodgeRaceCenterPoint.h"
+
+#include "core/CoreIncludes.h"
+
+#include "DodgeRace.h"
+
+namespace orxonox
+{
+ RegisterClass(DodgeRaceCenterPoint);
+
+ DodgeRaceCenterPoint::DodgeRaceCenterPoint(Context* context) : StaticEntity(context)
+ {
+ RegisterObject(DodgeRaceCenterPoint);
+
+ this->checkGametype();
+ }
+
+ void DodgeRaceCenterPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(DodgeRaceCenterPoint, XMLPort, xmlelement, mode);
+ }
+
+ void DodgeRaceCenterPoint::changedGametype()
+ {
+ SUPER(DodgeRaceCenterPoint, changedGametype);
+
+ // Check, whether it's still DodgeRace.
+ this->checkGametype();
+ }
+
+ void DodgeRaceCenterPoint::checkGametype()
+ {
+ if (this->getGametype() != NULL && this->getGametype()->isA(Class(DodgeRace)))
+ {
+ DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype().get());
+ DodgeRaceGametype->setCenterpoint(this);
+ }
+ }
+}
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.h
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file DodgeRaceCenterPoint.h
- @brief Declaration of the DodgeRaceCenterPoint class.
- @ingroup DodgeRace
-*/
-
-#ifndef _DodgeRaceCenterPoint_H__
-#define _DodgeRaceCenterPoint_H__
-
-#include "dodgerace2/DodgeRacePrereqs.h"
-
-//#include "DodgeRace.h"
-//#include "DodgeRaceHUDinfo.h"
-
-#include "worldentities/StaticEntity.h"
-
-namespace orxonox
-{
- class _DodgeRaceExport DodgeRaceCenterPoint : public StaticEntity
- {
- public:
- DodgeRaceCenterPoint(Context* context); //checks whether the gametype is actually DodgeRace.
-
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
- virtual void changedGametype(); //!< Is called when the gametype has changed.
- private:
- void checkGametype();
-
- };
-}
-
-#endif /* _DodgeRaceCenterPoint_H__ */
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.h)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.h (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCenterPoint.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DodgeRaceCenterPoint.h
+ @brief Declaration of the DodgeRaceCenterPoint class.
+ @ingroup DodgeRace
+*/
+
+#ifndef _DodgeRaceCenterPoint_H__
+#define _DodgeRaceCenterPoint_H__
+
+#include "dodgerace2/DodgeRacePrereqs.h"
+
+//#include "DodgeRace.h"
+//#include "DodgeRaceHUDinfo.h"
+
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+ class _DodgeRaceExport DodgeRaceCenterPoint : public StaticEntity
+ {
+ public:
+ DodgeRaceCenterPoint(Context* context); //checks whether the gametype is actually DodgeRace.
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ virtual void changedGametype(); //!< Is called when the gametype has changed.
+ private:
+ void checkGametype();
+
+ };
+}
+
+#endif /* _DodgeRaceCenterPoint_H__ */
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.cc
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceCube.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,46 +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:
- * Samuel Riedel
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file DodgeRace.cc
- @brief Implementation of the DodgeRace class.
-*/
-
-#include "DodgeRaceCube.h"
-#include "DodgeRace.h"
-
-namespace orxonox
-{
- RegisterClass(DodgeRaceCube);
-
- DodgeRaceCube::DodgeRaceCube(Context* context) : MovableEntity(context)
- {
- RegisterObject(DodgeRaceCube);
- }
-
-
-}
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceCube.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,46 @@
+/* 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:
+ * Samuel Riedel
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DodgeRace.cc
+ @brief Implementation of the DodgeRace class.
+*/
+
+#include "DodgeRaceCube.h"
+#include "DodgeRace.h"
+
+namespace orxonox
+{
+ RegisterClass(DodgeRaceCube);
+
+ DodgeRaceCube::DodgeRaceCube(Context* context) : MovableEntity(context)
+ {
+ RegisterObject(DodgeRaceCube);
+ }
+
+
+}
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.h
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceCube.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,54 +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:
- * Samuel Riedel
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file DodgeRace.h
- @brief Gametype.
- @ingroup DodgeRace
-*/
-
-#ifndef _DodgeRaceCube_H__
-#define _DodgeRaceCube_H__
-
-#include "dodgerace2/DodgeRacePrereqs.h"
-
-#include "worldentities/MovableEntity.h"
-
-
-namespace orxonox
-{
- class _DodgeRaceExport DodgeRaceCube : public MovableEntity
- {
- public:
- DodgeRaceCube(Context* context);
-
- private:
- };
-}
-
-#endif /* _DodgeRaceCube_H__ */
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceCube.h)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.h (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceCube.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,54 @@
+/*
+ * 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:
+ * Samuel Riedel
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DodgeRace.h
+ @brief Gametype.
+ @ingroup DodgeRace
+*/
+
+#ifndef _DodgeRaceCube_H__
+#define _DodgeRaceCube_H__
+
+#include "dodgerace2/DodgeRacePrereqs.h"
+
+#include "worldentities/MovableEntity.h"
+
+
+namespace orxonox
+{
+ class _DodgeRaceExport DodgeRaceCube : public MovableEntity
+ {
+ public:
+ DodgeRaceCube(Context* context);
+
+ private:
+ };
+}
+
+#endif /* _DodgeRaceCube_H__ */
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.cc
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,91 +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:
- * Florian Zinggeler
- *
- */
-
-#include "DodgeRaceHUDinfo.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Convert.h"
-//#include "DodgeRace.h"
-
-namespace orxonox
-{
- RegisterClass(DodgeRaceHUDinfo);
-
- DodgeRaceHUDinfo::DodgeRaceHUDinfo(Context* context) : OverlayText(context)
- {
- RegisterObject(DodgeRaceHUDinfo);
-
- this->DodgeRaceGame = 0;
- this->bShowPoints_ = true;
- }
-
- void DodgeRaceHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- SUPER(DodgeRaceHUDinfo, XMLPort, xmlelement, mode);
-
- XMLPortParam(DodgeRaceHUDinfo,"showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);
- }
-
- void DodgeRaceHUDinfo::tick(float dt)
- {
- SUPER(DodgeRaceHUDinfo, tick, dt);
-
-
- if(this->bShowPoints_)
- {
- const std::string& points = multi_cast<std::string>(this->DodgeRaceGame->getPoints());
- if (this->DodgeRaceGame->lives <= 0)
- {
- setTextSize(0.2);
- setPosition(Vector2(0.1, 0.02));
- this->setCaption("Final score:\n" + points);
- this->setColour(ColourValue(1, 0, 0, 1));
- }
- else
- {
- setTextSize(0.04);
- setPosition(Vector2(0.14, 0.02));
- this->setColour(ColourValue(1, 1, 1, 1));
- this->setCaption(points);
- }
- }
- }
-
- void DodgeRaceHUDinfo::changedOwner()
- {
- SUPER(DodgeRaceHUDinfo, changedOwner);
-
- if (this->getOwner() && this->getOwner()->getGametype())
- {
- this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype().get());
- }
- else
- {
- this->DodgeRaceGame = 0;
- }
- }
-}
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,91 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ *
+ */
+
+#include "DodgeRaceHUDinfo.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+//#include "DodgeRace.h"
+
+namespace orxonox
+{
+ RegisterClass(DodgeRaceHUDinfo);
+
+ DodgeRaceHUDinfo::DodgeRaceHUDinfo(Context* context) : OverlayText(context)
+ {
+ RegisterObject(DodgeRaceHUDinfo);
+
+ this->DodgeRaceGame = 0;
+ this->bShowPoints_ = true;
+ }
+
+ void DodgeRaceHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(DodgeRaceHUDinfo, XMLPort, xmlelement, mode);
+
+ XMLPortParam(DodgeRaceHUDinfo,"showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);
+ }
+
+ void DodgeRaceHUDinfo::tick(float dt)
+ {
+ SUPER(DodgeRaceHUDinfo, tick, dt);
+
+
+ if(this->bShowPoints_)
+ {
+ const std::string& points = multi_cast<std::string>(this->DodgeRaceGame->getPoints());
+ if (this->DodgeRaceGame->lives <= 0)
+ {
+ setTextSize(0.2);
+ setPosition(Vector2(0.1, 0.02));
+ this->setCaption("Final score:\n" + points);
+ this->setColour(ColourValue(1, 0, 0, 1));
+ }
+ else
+ {
+ setTextSize(0.04);
+ setPosition(Vector2(0.14, 0.02));
+ this->setColour(ColourValue(1, 1, 1, 1));
+ this->setCaption(points);
+ }
+ }
+ }
+
+ void DodgeRaceHUDinfo::changedOwner()
+ {
+ SUPER(DodgeRaceHUDinfo, changedOwner);
+
+ if (this->getOwner() && this->getOwner()->getGametype())
+ {
+ this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype().get());
+ }
+ else
+ {
+ this->DodgeRaceGame = 0;
+ }
+ }
+}
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.h
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -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:
- * Florian Zinggeler
- *
- */
-
-#ifndef _DodgeRaceHUDinfo_H__
-#define _DodgeRaceHUDinfo_H__
-
-//#include "DodgeRaceShip.h"
-#include "DodgeRace.h"
-//#include "DodgeRaceCenterPoint.h"
-
-#include "dodgerace2/DodgeRacePrereqs.h"
-
-#include "tools/interfaces/Tickable.h"
-#include "overlays/OverlayText.h"
-
-namespace orxonox
-{
- class _DodgeRaceExport DodgeRaceHUDinfo : public OverlayText, public Tickable
- {
- public:
- DodgeRaceHUDinfo(Context* context);
-
- virtual void tick(float dt);
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void changedOwner();
-
- inline void setShowPoints(bool value)
- { this->bShowPoints_ = value; }
- inline bool getShowPoints() const
- { return this->bShowPoints_; }
-
-
- private:
- DodgeRace* DodgeRaceGame;
- bool bShowPoints_;
- };
-}
-#endif /* _DodgeRaceHUDinfo_H__ */
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.h)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.h (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceHUDinfo.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -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:
+ * Florian Zinggeler
+ *
+ */
+
+#ifndef _DodgeRaceHUDinfo_H__
+#define _DodgeRaceHUDinfo_H__
+
+//#include "DodgeRaceShip.h"
+#include "DodgeRace.h"
+//#include "DodgeRaceCenterPoint.h"
+
+#include "dodgerace2/DodgeRacePrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+ class _DodgeRaceExport DodgeRaceHUDinfo : public OverlayText, public Tickable
+ {
+ public:
+ DodgeRaceHUDinfo(Context* context);
+
+ virtual void tick(float dt);
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void changedOwner();
+
+ inline void setShowPoints(bool value)
+ { this->bShowPoints_ = value; }
+ inline bool getShowPoints() const
+ { return this->bShowPoints_; }
+
+
+ private:
+ DodgeRace* DodgeRaceGame;
+ bool bShowPoints_;
+ };
+}
+#endif /* _DodgeRaceHUDinfo_H__ */
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRacePrereqs.h
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRacePrereqs.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRacePrereqs.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,81 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- at file
- at brief
- Shared library macros, enums, constants and forward declarations for the DodgeRace module
-*/
-
-#ifndef _DodgeRacePrereqs_H__
-#define _DodgeRacePrereqs_H__
-
-#include "OrxonoxConfig.h"
-#include "OrxonoxPrereqs.h"
-
-//-----------------------------------------------------------------------
-// Shared library settings
-//-----------------------------------------------------------------------
-
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(DODGERACE_STATIC_BUILD)
-# ifdef DODGERACE_SHARED_BUILD
-# define _DodgeRaceExport __declspec(dllexport)
-# else
-# if defined( __MINGW32__ )
-# define _DodgeRaceExport
-# else
-# define _DodgeRaceExport __declspec(dllimport)
-# endif
-# endif
-# define _DodgeRacePrivate
-#elif defined (ORXONOX_GCC_VISIBILITY)
-# define _DodgeRaceExport __attribute__ ((visibility("default")))
-# define _DodgeRacePrivate __attribute__ ((visibility("hidden")))
-#else
-# define _DodgeRaceExport
-# define _DodgeRacePrivate
-#endif
-
-//-----------------------------------------------------------------------
-// Forward declarations
-//-----------------------------------------------------------------------
-
-namespace orxonox
-{
- class DodgeRace;
- class DodgeRaceCenterPoint;
- class DodgeRaceShip;
- class DodgeRaceCube;
- //class DodgeRaceEnemy;
- //class DodgeRaceEnemyShooter;
- //class DodgeRaceWeapon;
- //class DodgeRaceWeaponEnemy;
- //class DodgeRaceHUDinfo;
-}
-
-#endif /* _DodgeRacePrereqs_H__*/
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRacePrereqs.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRacePrereqs.h)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRacePrereqs.h (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRacePrereqs.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,81 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ at file
+ at brief
+ Shared library macros, enums, constants and forward declarations for the DodgeRace module
+*/
+
+#ifndef _DodgeRacePrereqs_H__
+#define _DodgeRacePrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(DODGERACE_STATIC_BUILD)
+# ifdef DODGERACE_SHARED_BUILD
+# define _DodgeRaceExport __declspec(dllexport)
+# else
+# if defined( __MINGW32__ )
+# define _DodgeRaceExport
+# else
+# define _DodgeRaceExport __declspec(dllimport)
+# endif
+# endif
+# define _DodgeRacePrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
+# define _DodgeRaceExport __attribute__ ((visibility("default")))
+# define _DodgeRacePrivate __attribute__ ((visibility("hidden")))
+#else
+# define _DodgeRaceExport
+# define _DodgeRacePrivate
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+ class DodgeRace;
+ class DodgeRaceCenterPoint;
+ class DodgeRaceShip;
+ class DodgeRaceCube;
+ //class DodgeRaceEnemy;
+ //class DodgeRaceEnemyShooter;
+ //class DodgeRaceWeapon;
+ //class DodgeRaceWeaponEnemy;
+ //class DodgeRaceHUDinfo;
+}
+
+#endif /* _DodgeRacePrereqs_H__*/
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.cc
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,168 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file DodgeRaceShip.cc
- @brief Implementation of the DodgeRaceShip class.
-*/
-
-#include "DodgeRaceShip.h"
-
-namespace orxonox
-{
- RegisterClass(DodgeRaceShip);
-
- DodgeRaceShip::DodgeRaceShip(Context* context) : SpaceShip(context)
- {
- RegisterObject(DodgeRaceShip);
-
- speed = 830;
- isFireing = false;
- damping = 10;
-
- // not sure if has to be zero?
- lastTimeFront = 0;
- lastTimeLeft = 0;
- lastTime = 0;
- }
-
- void DodgeRaceShip::tick(float dt)
- {
- Vector3 pos = getPosition();
-
- //Movement calculation
- lastTimeFront += dt * damping;
- lastTimeLeft += dt * damping;
- lastTime += dt;
-
- velocity.x = interpolate(clamp(lastTimeLeft, 0.0f, 1.0f), desiredVelocity.x, 0.0f);
- velocity.y = interpolate(clamp(lastTimeFront, 0.0f, 1.0f), desiredVelocity.y, 0.0f);
-
- //Execute movement
- if (this->hasLocalController())
- {
- float dist_y = velocity.y * dt;
- //float dist_x = velocity.x * dt;
- if(dist_y + posforeward > -42*3 && dist_y + posforeward < 42*6)
- posforeward += dist_y;
- else
- {
- velocity.y = 0;
- // restart if game ended
-/*
- if (getGame())
- if (getGame()->bEndGame)
- {
- getGame()->start();
- return;
- }*/
- }
-
- pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
- }
-
-
- // Camera
- WeakPtr<Camera> camera = this->getCamera();
- if (camera != NULL)
- {
- // camera->setPosition(Vector3(-pos.z, -posforeward, 0));
- camera->setOrientation(Vector3::UNIT_Z, Degree(0));
- }
-
-
-
- // bring back on track!
- if(pos.y != 0)
- {
- pos.y = 0;
- }
-
- setPosition(pos);
- setOrientation(Vector3::UNIT_Y, Degree(270));
-
- // Level up!
- if (pos.x > 42000)
- {
- updateLevel();
- setPosition(Vector3(0, 0, pos.z)); // pos - Vector3(30000, 0, 0)
- }
-
- SUPER(DodgeRaceShip, tick, dt);
- }
-
- void DodgeRaceShip::updateLevel()
- {
- lastTime = 0;
- if (getGame())
- getGame()->levelUp();
- }
-
- void DodgeRaceShip::moveFrontBack(const Vector2& value)
- {
- //lastTimeFront = 0;
- //desiredVelocity.y = value.y * speed * 42;
-
- }
-
- void DodgeRaceShip::moveRightLeft(const Vector2& value)
- {
- lastTimeLeft = 0;
- desiredVelocity.x = value.x * speed;
- }
- void DodgeRaceShip::boost(bool bBoost)
- {
- //getGame()->bEndGame = bBoost;
- }
-
- inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
- {
-
- removeHealth(100);
- this->death();
- return false;
- }
-
- WeakPtr<DodgeRace> DodgeRaceShip::getGame()
- {
- if (game == NULL)
- {
- for (ObjectList<DodgeRace>::iterator it = ObjectList<DodgeRace>::begin(); it != ObjectList<DodgeRace>::end(); ++it)
- {
- game = *it;
- }
- }
- return game;
- }
-
- void DodgeRaceShip::death()
- {
- getGame()->costLife();
- SpaceShip::death();
- }
-}
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,168 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DodgeRaceShip.cc
+ @brief Implementation of the DodgeRaceShip class.
+*/
+
+#include "DodgeRaceShip.h"
+
+namespace orxonox
+{
+ RegisterClass(DodgeRaceShip);
+
+ DodgeRaceShip::DodgeRaceShip(Context* context) : SpaceShip(context)
+ {
+ RegisterObject(DodgeRaceShip);
+
+ speed = 830;
+ isFireing = false;
+ damping = 10;
+
+ // not sure if has to be zero?
+ lastTimeFront = 0;
+ lastTimeLeft = 0;
+ lastTime = 0;
+ }
+
+ void DodgeRaceShip::tick(float dt)
+ {
+ Vector3 pos = getPosition();
+
+ //Movement calculation
+ lastTimeFront += dt * damping;
+ lastTimeLeft += dt * damping;
+ lastTime += dt;
+
+ velocity.x = interpolate(clamp(lastTimeLeft, 0.0f, 1.0f), desiredVelocity.x, 0.0f);
+ velocity.y = interpolate(clamp(lastTimeFront, 0.0f, 1.0f), desiredVelocity.y, 0.0f);
+
+ //Execute movement
+ if (this->hasLocalController())
+ {
+ float dist_y = velocity.y * dt;
+ //float dist_x = velocity.x * dt;
+ if(dist_y + posforeward > -42*3 && dist_y + posforeward < 42*6)
+ posforeward += dist_y;
+ else
+ {
+ velocity.y = 0;
+ // restart if game ended
+/*
+ if (getGame())
+ if (getGame()->bEndGame)
+ {
+ getGame()->start();
+ return;
+ }*/
+ }
+
+ pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
+ }
+
+
+ // Camera
+ WeakPtr<Camera> camera = this->getCamera();
+ if (camera != NULL)
+ {
+ // camera->setPosition(Vector3(-pos.z, -posforeward, 0));
+ camera->setOrientation(Vector3::UNIT_Z, Degree(0));
+ }
+
+
+
+ // bring back on track!
+ if(pos.y != 0)
+ {
+ pos.y = 0;
+ }
+
+ setPosition(pos);
+ setOrientation(Vector3::UNIT_Y, Degree(270));
+
+ // Level up!
+ if (pos.x > 42000)
+ {
+ updateLevel();
+ setPosition(Vector3(0, 0, pos.z)); // pos - Vector3(30000, 0, 0)
+ }
+
+ SUPER(DodgeRaceShip, tick, dt);
+ }
+
+ void DodgeRaceShip::updateLevel()
+ {
+ lastTime = 0;
+ if (getGame())
+ getGame()->levelUp();
+ }
+
+ void DodgeRaceShip::moveFrontBack(const Vector2& value)
+ {
+ //lastTimeFront = 0;
+ //desiredVelocity.y = value.y * speed * 42;
+
+ }
+
+ void DodgeRaceShip::moveRightLeft(const Vector2& value)
+ {
+ lastTimeLeft = 0;
+ desiredVelocity.x = value.x * speed;
+ }
+ void DodgeRaceShip::boost(bool bBoost)
+ {
+ //getGame()->bEndGame = bBoost;
+ }
+
+ inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+ {
+
+ removeHealth(100);
+ this->death();
+ return false;
+ }
+
+ WeakPtr<DodgeRace> DodgeRaceShip::getGame()
+ {
+ if (game == NULL)
+ {
+ for (ObjectList<DodgeRace>::iterator it = ObjectList<DodgeRace>::begin(); it != ObjectList<DodgeRace>::end(); ++it)
+ {
+ game = *it;
+ }
+ }
+ return game;
+ }
+
+ void DodgeRaceShip::death()
+ {
+ getGame()->costLife();
+ SpaceShip::death();
+ }
+}
Deleted: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.h
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,97 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file DodgeRaceShip.h
- @brief Declaration of the DodgeRaceShip class.
-*/
-
-#ifndef _DodgeRaceShip_H__
-#define _DodgeRaceShip_H__
-
-
-#include "dodgerace2/DodgeRacePrereqs.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "worldentities/pawns/SpaceShip.h"
-#include "graphics/Camera.h"
-#include "weapons/projectiles/Projectile.h"
-
-#include "DodgeRace.h" // Is necessary for getGame function
-//#include "DodgeRaceCenterPoint.h"
-
-namespace orxonox
-{
- class _DodgeRaceExport DodgeRaceShip : public SpaceShip
- {
- public:
- DodgeRaceShip(Context* context);
-
- virtual void tick(float dt);
-
- // overwrite for 2d movement
- virtual void moveFrontBack(const Vector2& value);
- virtual void moveRightLeft(const Vector2& value);
-
- // Starts or stops fireing
- virtual void boost(bool bBoost);
-
- //no rotation!
- virtual void rotateYaw(const Vector2& value){};
- virtual void rotatePitch(const Vector2& value){};
-
- //return to main menu if game has ended.
- virtual void rotateRoll(const Vector2& value){if (getGame()) if (getGame()->bEndGame) getGame()->end();};
-
- virtual void updateLevel();
-
- float speed, damping, posforeward;
- bool isFireing;
-
- protected:
- virtual void death();
-
- private:
- virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
- WeakPtr<DodgeRace> getGame();
- WeakPtr<DodgeRace> game;
- WeakPtr<Projectile> lastShot;
- WeakPtr<WorldEntity> lastEntity;
- Camera* camera;
- float lastTimeFront, lastTimeLeft, lastTime;
- struct Velocity
- {
- float x;
- float y;
- } velocity, desiredVelocity;
-
- };
-}
-
-#endif /* _DodgeRaceShip_H__ */
Copied: code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.h)
===================================================================
--- code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.h (rev 0)
+++ code/branches/presentationHS14/src/modules/dodgerace2/DodgeRaceShip.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,97 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file DodgeRaceShip.h
+ @brief Declaration of the DodgeRaceShip class.
+*/
+
+#ifndef _DodgeRaceShip_H__
+#define _DodgeRaceShip_H__
+
+
+#include "dodgerace2/DodgeRacePrereqs.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "worldentities/pawns/SpaceShip.h"
+#include "graphics/Camera.h"
+#include "weapons/projectiles/Projectile.h"
+
+#include "DodgeRace.h" // Is necessary for getGame function
+//#include "DodgeRaceCenterPoint.h"
+
+namespace orxonox
+{
+ class _DodgeRaceExport DodgeRaceShip : public SpaceShip
+ {
+ public:
+ DodgeRaceShip(Context* context);
+
+ virtual void tick(float dt);
+
+ // overwrite for 2d movement
+ virtual void moveFrontBack(const Vector2& value);
+ virtual void moveRightLeft(const Vector2& value);
+
+ // Starts or stops fireing
+ virtual void boost(bool bBoost);
+
+ //no rotation!
+ virtual void rotateYaw(const Vector2& value){};
+ virtual void rotatePitch(const Vector2& value){};
+
+ //return to main menu if game has ended.
+ virtual void rotateRoll(const Vector2& value){if (getGame()) if (getGame()->bEndGame) getGame()->end();};
+
+ virtual void updateLevel();
+
+ float speed, damping, posforeward;
+ bool isFireing;
+
+ protected:
+ virtual void death();
+
+ private:
+ virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+ WeakPtr<DodgeRace> getGame();
+ WeakPtr<DodgeRace> game;
+ WeakPtr<Projectile> lastShot;
+ WeakPtr<WorldEntity> lastEntity;
+ Camera* camera;
+ float lastTimeFront, lastTimeLeft, lastTime;
+ struct Velocity
+ {
+ float x;
+ float y;
+ } velocity, desiredVelocity;
+
+ };
+}
+
+#endif /* _DodgeRaceShip_H__ */
Deleted: code/branches/presentationHS14/src/modules/invader/Invader.cc
===================================================================
--- code/branches/presentationHS14/src/modules/invader/Invader.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/Invader.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,187 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file Invader.cc
- @brief Implementation of the Invader class.
-*/
-
-#include "Invader.h"
-
-#include "core/CoreIncludes.h"
-#include "core/EventIncludes.h"
-#include "core/command/Executor.h"
-#include "core/config/ConfigValueIncludes.h"
-
-#include "gamestates/GSLevel.h"
-#include "chat/ChatManager.h"
-
-// ! HACK
-#include "infos/PlayerInfo.h"
-
-#include "InvaderCenterPoint.h"
-#include "InvaderShip.h"
-#include "InvaderEnemy.h"
-#include "InvaderEnemyShooter.h"
-
-#include "core/command/ConsoleCommand.h"
-#include "worldentities/BigExplosion.h"
-
-namespace orxonox
-{
- RegisterUnloadableClass(Invader);
-
- Invader::Invader(Context* context) : Deathmatch(context)
- {
- RegisterObject(Invader);
- this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
- this->center_ = 0;
- init();
- this->setHUDTemplate("InvaderHUD");
- }
-
- void Invader::init()
- {
- bEndGame = false;
- lives = 3;
- level = 1;
- point = 0;
- bShowLevel = false;
- multiplier = 1;
- b_combo = false;
- // spawn enemy every 3.5 seconds
- enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&Invader::spawnEnemy, this)));
- comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&Invader::comboControll, this)));
- }
-
- void Invader::levelUp()
- {
- level++;
- if (getPlayer() != NULL)
- {
- for (int i = 0; i < 7; i++)
- {
- WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
- chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
- chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
- chunk->setScale(20);
- }
- }
- addPoints(multiplier * 42);
- multiplier *= 2;
- toggleShowLevel();
- showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&Invader::toggleShowLevel, this)));
- }
-
- WeakPtr<InvaderShip> Invader::getPlayer()
- {
- if (player == NULL)
- {
- for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it)
- player = *it;
- }
- return player;
- }
-
- void Invader::spawnEnemy()
- {
- if (getPlayer() == NULL)
- return;
-
- for (int i = 0; i < (3*log10(static_cast<double>(level)) + 1); i++)
- {
- WeakPtr<InvaderEnemy> newPawn;
- if (rand() % 42/(1 + level*level) == 0)
- {
- newPawn = new InvaderEnemyShooter(this->center_->getContext());
- newPawn->addTemplate("enemyinvadershooter");
- }
- else
- {
- newPawn = new InvaderEnemy(this->center_->getContext());
- newPawn->addTemplate("enemyinvader");
- }
- newPawn->setPlayer(player);
- newPawn->level = level;
- // spawn enemy at random points in front of player.
- newPawn->setPosition(player->getPosition() + Vector3(500.f + 100 * i, 0, float(rand())/RAND_MAX * 400 - 200));
- }
- }
-
- void Invader::costLife()
- {
- lives--;
- multiplier = 1;
- // end the game in 30 seconds.
- if (lives <= 0)
- enemySpawnTimer.setTimer(30.0f, false, createExecutor(createFunctor(&Invader::end, this)));
- };
-
- void Invader::comboControll()
- {
- if (b_combo)
- multiplier++;
- // if no combo was performed before, reset multiplier
- else
- multiplier = 1;
- b_combo = false;
- }
-
- void Invader::start()
- {
- init();
- // Set variable to temporarily force the player to spawn.
- this->bForceSpawn_ = true;
-
- if (this->center_ == NULL) // abandon mission!
- {
- orxout(internal_error) << "Invader: No Centerpoint specified." << endl;
- GSLevel::startMainMenu();
- return;
- }
- // Call start for the parent class.
- Deathmatch::start();
- }
- void Invader::addPoints(int numPoints)
- {
- if (!bEndGame)
- {
- point += numPoints * multiplier;
- b_combo = true;
- }
- }
-
- void Invader::end()
- {
- // DON'T CALL THIS!
- // Deathmatch::end();
- // It will misteriously crash the game!
- // Instead startMainMenu, this won't crash.
- GSLevel::startMainMenu();
- }
-}
Copied: code/branches/presentationHS14/src/modules/invader/Invader.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/Invader.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/Invader.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/Invader.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,187 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file Invader.cc
+ @brief Implementation of the Invader class.
+*/
+
+#include "Invader.h"
+
+#include "core/CoreIncludes.h"
+#include "core/EventIncludes.h"
+#include "core/command/Executor.h"
+#include "core/config/ConfigValueIncludes.h"
+
+#include "gamestates/GSLevel.h"
+#include "chat/ChatManager.h"
+
+// ! HACK
+#include "infos/PlayerInfo.h"
+
+#include "InvaderCenterPoint.h"
+#include "InvaderShip.h"
+#include "InvaderEnemy.h"
+#include "InvaderEnemyShooter.h"
+
+#include "core/command/ConsoleCommand.h"
+#include "worldentities/BigExplosion.h"
+
+namespace orxonox
+{
+ RegisterUnloadableClass(Invader);
+
+ Invader::Invader(Context* context) : Deathmatch(context)
+ {
+ RegisterObject(Invader);
+ this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
+ this->center_ = 0;
+ init();
+ this->setHUDTemplate("InvaderHUD");
+ }
+
+ void Invader::init()
+ {
+ bEndGame = false;
+ lives = 3;
+ level = 1;
+ point = 0;
+ bShowLevel = false;
+ multiplier = 1;
+ b_combo = false;
+ // spawn enemy every 3.5 seconds
+ enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&Invader::spawnEnemy, this)));
+ comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&Invader::comboControll, this)));
+ }
+
+ void Invader::levelUp()
+ {
+ level++;
+ if (getPlayer() != NULL)
+ {
+ for (int i = 0; i < 7; i++)
+ {
+ WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
+ chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
+ chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
+ chunk->setScale(20);
+ }
+ }
+ addPoints(multiplier * 42);
+ multiplier *= 2;
+ toggleShowLevel();
+ showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&Invader::toggleShowLevel, this)));
+ }
+
+ WeakPtr<InvaderShip> Invader::getPlayer()
+ {
+ if (player == NULL)
+ {
+ for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it)
+ player = *it;
+ }
+ return player;
+ }
+
+ void Invader::spawnEnemy()
+ {
+ if (getPlayer() == NULL)
+ return;
+
+ for (int i = 0; i < (3*log10(static_cast<double>(level)) + 1); i++)
+ {
+ WeakPtr<InvaderEnemy> newPawn;
+ if (rand() % 42/(1 + level*level) == 0)
+ {
+ newPawn = new InvaderEnemyShooter(this->center_->getContext());
+ newPawn->addTemplate("enemyinvadershooter");
+ }
+ else
+ {
+ newPawn = new InvaderEnemy(this->center_->getContext());
+ newPawn->addTemplate("enemyinvader");
+ }
+ newPawn->setPlayer(player);
+ newPawn->level = level;
+ // spawn enemy at random points in front of player.
+ newPawn->setPosition(player->getPosition() + Vector3(500.f + 100 * i, 0, float(rand())/RAND_MAX * 400 - 200));
+ }
+ }
+
+ void Invader::costLife()
+ {
+ lives--;
+ multiplier = 1;
+ // end the game in 30 seconds.
+ if (lives <= 0)
+ enemySpawnTimer.setTimer(30.0f, false, createExecutor(createFunctor(&Invader::end, this)));
+ };
+
+ void Invader::comboControll()
+ {
+ if (b_combo)
+ multiplier++;
+ // if no combo was performed before, reset multiplier
+ else
+ multiplier = 1;
+ b_combo = false;
+ }
+
+ void Invader::start()
+ {
+ init();
+ // Set variable to temporarily force the player to spawn.
+ this->bForceSpawn_ = true;
+
+ if (this->center_ == NULL) // abandon mission!
+ {
+ orxout(internal_error) << "Invader: No Centerpoint specified." << endl;
+ GSLevel::startMainMenu();
+ return;
+ }
+ // Call start for the parent class.
+ Deathmatch::start();
+ }
+ void Invader::addPoints(int numPoints)
+ {
+ if (!bEndGame)
+ {
+ point += numPoints * multiplier;
+ b_combo = true;
+ }
+ }
+
+ void Invader::end()
+ {
+ // DON'T CALL THIS!
+ // Deathmatch::end();
+ // It will misteriously crash the game!
+ // Instead startMainMenu, this won't crash.
+ GSLevel::startMainMenu();
+ }
+}
Deleted: code/branches/presentationHS14/src/modules/invader/Invader.h
===================================================================
--- code/branches/presentationHS14/src/modules/invader/Invader.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/Invader.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,94 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file Invader.h
- @brief Gametype.
- @ingroup Invader
-*/
-
-#ifndef _Invader_H__
-#define _Invader_H__
-
-#include "invader/InvaderPrereqs.h"
-
-#include "gametypes/Deathmatch.h"
-
-#include "InvaderCenterPoint.h"
-
-#include "tools/Timer.h"
-
-namespace orxonox
-{
-
- class _InvaderExport Invader : public Deathmatch
- {
- public:
- Invader(Context* context);
-
- virtual void start();
- virtual void end();
- virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
-
- void spawnEnemy();
-
- void setCenterpoint(InvaderCenterPoint* center)
- { this->center_ = center; }
-
- int getLives(){return this->lives;}
- int getLevel(){return this->level;}
- int getPoints(){return this->point;}
- int getMultiplier(){return this->multiplier;}
-
- void costLife();
- void levelUp();
- void addPoints(int numPoints);
- // checks if multiplier should be reset.
- void comboControll();
- void init();
- int lives;
- int multiplier;
- bool bEndGame;
- bool bShowLevel;
- private:
- void toggleShowLevel(){bShowLevel = !bShowLevel;}
- WeakPtr<InvaderShip> getPlayer();
- WeakPtr<InvaderCenterPoint> center_;
- WeakPtr<InvaderShip> player;
-
- Timer enemySpawnTimer;
- Timer comboTimer;
- Timer showLevelTimer;
- //Context* context;
- int level;
- int point;
- bool b_combo;
- };
-}
-
-#endif /* _Invader_H__ */
Copied: code/branches/presentationHS14/src/modules/invader/Invader.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/Invader.h)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/Invader.h (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/Invader.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,94 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file Invader.h
+ @brief Gametype.
+ @ingroup Invader
+*/
+
+#ifndef _Invader_H__
+#define _Invader_H__
+
+#include "invader/InvaderPrereqs.h"
+
+#include "gametypes/Deathmatch.h"
+
+#include "InvaderCenterPoint.h"
+
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+
+ class _InvaderExport Invader : public Deathmatch
+ {
+ public:
+ Invader(Context* context);
+
+ virtual void start();
+ virtual void end();
+ virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
+
+ void spawnEnemy();
+
+ void setCenterpoint(InvaderCenterPoint* center)
+ { this->center_ = center; }
+
+ int getLives(){return this->lives;}
+ int getLevel(){return this->level;}
+ int getPoints(){return this->point;}
+ int getMultiplier(){return this->multiplier;}
+
+ void costLife();
+ void levelUp();
+ void addPoints(int numPoints);
+ // checks if multiplier should be reset.
+ void comboControll();
+ void init();
+ int lives;
+ int multiplier;
+ bool bEndGame;
+ bool bShowLevel;
+ private:
+ void toggleShowLevel(){bShowLevel = !bShowLevel;}
+ WeakPtr<InvaderShip> getPlayer();
+ WeakPtr<InvaderCenterPoint> center_;
+ WeakPtr<InvaderShip> player;
+
+ Timer enemySpawnTimer;
+ Timer comboTimer;
+ Timer showLevelTimer;
+ //Context* context;
+ int level;
+ int point;
+ bool b_combo;
+ };
+}
+
+#endif /* _Invader_H__ */
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.cc
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,72 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderCenterPoint.cc
- @brief Implementation of the InvaderCenterPoint class.
-*/
-
-#include "InvaderCenterPoint.h"
-
-#include "core/CoreIncludes.h"
-
-#include "Invader.h"
-
-namespace orxonox
-{
- RegisterClass(InvaderCenterPoint);
-
- InvaderCenterPoint::InvaderCenterPoint(Context* context) : StaticEntity(context)
- {
- RegisterObject(InvaderCenterPoint);
-
- this->checkGametype();
- }
-
- void InvaderCenterPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- SUPER(InvaderCenterPoint, XMLPort, xmlelement, mode);
- }
-
- void InvaderCenterPoint::changedGametype()
- {
- SUPER(InvaderCenterPoint, changedGametype);
-
- // Check, whether it's still Invader.
- this->checkGametype();
- }
-
- void InvaderCenterPoint::checkGametype()
- {
- if (this->getGametype() != NULL && this->getGametype()->isA(Class(Invader)))
- {
- Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype().get());
- InvaderGametype->setCenterpoint(this);
- }
- }
-}
Copied: code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderCenterPoint.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,72 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderCenterPoint.cc
+ @brief Implementation of the InvaderCenterPoint class.
+*/
+
+#include "InvaderCenterPoint.h"
+
+#include "core/CoreIncludes.h"
+
+#include "Invader.h"
+
+namespace orxonox
+{
+ RegisterClass(InvaderCenterPoint);
+
+ InvaderCenterPoint::InvaderCenterPoint(Context* context) : StaticEntity(context)
+ {
+ RegisterObject(InvaderCenterPoint);
+
+ this->checkGametype();
+ }
+
+ void InvaderCenterPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(InvaderCenterPoint, XMLPort, xmlelement, mode);
+ }
+
+ void InvaderCenterPoint::changedGametype()
+ {
+ SUPER(InvaderCenterPoint, changedGametype);
+
+ // Check, whether it's still Invader.
+ this->checkGametype();
+ }
+
+ void InvaderCenterPoint::checkGametype()
+ {
+ if (this->getGametype() != NULL && this->getGametype()->isA(Class(Invader)))
+ {
+ Invader* InvaderGametype = orxonox_cast<Invader*>(this->getGametype().get());
+ InvaderGametype->setCenterpoint(this);
+ }
+ }
+}
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.h
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,58 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderCenterPoint.h
- @brief Declaration of the InvaderCenterPoint class.
- @ingroup Invader
-*/
-
-#ifndef _InvaderCenterPoint_H__
-#define _InvaderCenterPoint_H__
-
-#include "invader/InvaderPrereqs.h"
-
-#include "worldentities/StaticEntity.h"
-
-namespace orxonox
-{
- class _InvaderExport InvaderCenterPoint : public StaticEntity
- {
- public:
- InvaderCenterPoint(Context* context); //checks whether the gametype is actually Invader.
-
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
- virtual void changedGametype(); //!< Is called when the gametype has changed.
- private:
- void checkGametype();
-
- };
-}
-
-#endif /* _InvaderCenterPoint_H__ */
Copied: code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderCenterPoint.h)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.h (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderCenterPoint.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,58 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderCenterPoint.h
+ @brief Declaration of the InvaderCenterPoint class.
+ @ingroup Invader
+*/
+
+#ifndef _InvaderCenterPoint_H__
+#define _InvaderCenterPoint_H__
+
+#include "invader/InvaderPrereqs.h"
+
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+ class _InvaderExport InvaderCenterPoint : public StaticEntity
+ {
+ public:
+ InvaderCenterPoint(Context* context); //checks whether the gametype is actually Invader.
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ virtual void changedGametype(); //!< Is called when the gametype has changed.
+ private:
+ void checkGametype();
+
+ };
+}
+
+#endif /* _InvaderCenterPoint_H__ */
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderEnemy.cc
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderEnemy.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderEnemy.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,87 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderEnemy.h
- @brief Declaration of the InvaderEnemy class.
-*/
-
-#include "invader/InvaderPrereqs.h"
-#include "InvaderEnemy.h"
-#include "InvaderShip.h"
-
-namespace orxonox
-{
- RegisterClass(InvaderEnemy);
-
- InvaderEnemy::InvaderEnemy(Context* context) : Pawn(context)
- {
- RegisterObject(InvaderEnemy);
- enableCollisionCallback();
- lifetime = 0;
- }
-
- void InvaderEnemy::tick(float dt)
- {
- lifetime += dt;
- // die after 5 seconds.
- if (lifetime > 5000)
- removeHealth(2000);
-
- if (player != NULL)
- {
- float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z);
- setVelocity(Vector3(1000.f - level * 100 , 0, newZ));
- }
- SUPER(InvaderEnemy, tick, dt);
- }
-
- inline bool InvaderEnemy::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
- {
- if(orxonox_cast<InvaderShip*>(otherObject))
- removeHealth(2000);
- return false;
- }
-
- WeakPtr<Invader> InvaderEnemy::getGame()
- {
- if (game == NULL)
- {
- for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
- game = *it;
- }
- return game;
- }
-
- void InvaderEnemy::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
- {
- Pawn::damage(damage, healthdamage, shielddamage, originator);
- if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL && getHealth() <= 0)
- getGame()->addPoints(42);
- }
-}
\ No newline at end of file
Copied: code/branches/presentationHS14/src/modules/invader/InvaderEnemy.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderEnemy.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderEnemy.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderEnemy.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,87 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderEnemy.h
+ @brief Declaration of the InvaderEnemy class.
+*/
+
+#include "invader/InvaderPrereqs.h"
+#include "InvaderEnemy.h"
+#include "InvaderShip.h"
+
+namespace orxonox
+{
+ RegisterClass(InvaderEnemy);
+
+ InvaderEnemy::InvaderEnemy(Context* context) : Pawn(context)
+ {
+ RegisterObject(InvaderEnemy);
+ enableCollisionCallback();
+ lifetime = 0;
+ }
+
+ void InvaderEnemy::tick(float dt)
+ {
+ lifetime += dt;
+ // die after 5 seconds.
+ if (lifetime > 5000)
+ removeHealth(2000);
+
+ if (player != NULL)
+ {
+ float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z);
+ setVelocity(Vector3(1000.f - level * 100 , 0, newZ));
+ }
+ SUPER(InvaderEnemy, tick, dt);
+ }
+
+ inline bool InvaderEnemy::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+ {
+ if(orxonox_cast<InvaderShip*>(otherObject))
+ removeHealth(2000);
+ return false;
+ }
+
+ WeakPtr<Invader> InvaderEnemy::getGame()
+ {
+ if (game == NULL)
+ {
+ for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
+ game = *it;
+ }
+ return game;
+ }
+
+ void InvaderEnemy::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
+ {
+ Pawn::damage(damage, healthdamage, shielddamage, originator);
+ if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL && getHealth() <= 0)
+ getGame()->addPoints(42);
+ }
+}
\ No newline at end of file
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderEnemy.h
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderEnemy.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderEnemy.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,72 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderEnemy.h
- @brief Declaration of the InvaderEnemy class.
-*/
-
-#ifndef _InvaderEnemy_H__
-#define _InvaderEnemy_H__
-
-#include "invader/InvaderPrereqs.h"
-
-#include "worldentities/pawns/SpaceShip.h"
-
-namespace orxonox
-{
- class _InvaderExport InvaderEnemy : public Pawn
- {
- public:
- InvaderEnemy(Context* context);
-
- virtual void tick(float dt);
- virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
- virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator);
- virtual void setPlayer(WeakPtr<InvaderShip> player){this->player = player;}
-
- int level;
- protected:
- WeakPtr<Invader> getGame();
- WeakPtr<Invader> game;
- WeakPtr<InvaderShip> player;
- Camera* camera;
- bool isFireing;
- float speed, damping;
- float lastTimeFront, lastTimeLeft;
- float lifetime;
- struct Velocity
- {
- float x;
- float y;
- } velocity, desiredVelocity;
-
- };
-}
-
-#endif /* _InvaderEnemy_H__ */
Copied: code/branches/presentationHS14/src/modules/invader/InvaderEnemy.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderEnemy.h)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderEnemy.h (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderEnemy.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,72 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderEnemy.h
+ @brief Declaration of the InvaderEnemy class.
+*/
+
+#ifndef _InvaderEnemy_H__
+#define _InvaderEnemy_H__
+
+#include "invader/InvaderPrereqs.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+ class _InvaderExport InvaderEnemy : public Pawn
+ {
+ public:
+ InvaderEnemy(Context* context);
+
+ virtual void tick(float dt);
+ virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+ virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator);
+ virtual void setPlayer(WeakPtr<InvaderShip> player){this->player = player;}
+
+ int level;
+ protected:
+ WeakPtr<Invader> getGame();
+ WeakPtr<Invader> game;
+ WeakPtr<InvaderShip> player;
+ Camera* camera;
+ bool isFireing;
+ float speed, damping;
+ float lastTimeFront, lastTimeLeft;
+ float lifetime;
+ struct Velocity
+ {
+ float x;
+ float y;
+ } velocity, desiredVelocity;
+
+ };
+}
+
+#endif /* _InvaderEnemy_H__ */
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.cc
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,79 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderEnemyShooter.h
- @brief Declaration of the InvaderEnemyShooter class.
-*/
-
-#include "invader/InvaderPrereqs.h"
-#include "InvaderEnemyShooter.h"
-// #include "worldentities/pawns/SpaceShip.h"
-
-namespace orxonox
-{
- RegisterClass(InvaderEnemyShooter);
-
- InvaderEnemyShooter::InvaderEnemyShooter(Context* context) : InvaderEnemy(context)
- {
- RegisterObject(InvaderEnemyShooter);
- enableCollisionCallback();
- lifetime = 0;
- // shoot every second
- shootTimer.setTimer(1.0f, true, createExecutor(createFunctor(&InvaderEnemyShooter::shoot, this)));
- }
-
- void InvaderEnemyShooter::tick(float dt)
- {
- lifetime += dt;
- // die after 20 seconds.
- if (lifetime > 20000)
- removeHealth(2000);
-
- if (player != NULL)
- {
- float distPlayer = player->getPosition().z - getPosition().z;
- // orxout() << "i'm different!" << endl;
- float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * distPlayer;
- setVelocity(Vector3(950 - abs(distPlayer), 0, newZ));
- }
- Pawn::tick(dt);
- }
-
- void InvaderEnemyShooter::shoot()
- {
- ControllableEntity::fire(0);
- }
-
- void InvaderEnemyShooter::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
- {
- Pawn::damage(damage, healthdamage, shielddamage, originator);
- if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL && getHealth() <= 0)
- getGame()->addPoints(3*42);
- }
-}
\ No newline at end of file
Copied: code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderEnemyShooter.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,79 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderEnemyShooter.h
+ @brief Declaration of the InvaderEnemyShooter class.
+*/
+
+#include "invader/InvaderPrereqs.h"
+#include "InvaderEnemyShooter.h"
+// #include "worldentities/pawns/SpaceShip.h"
+
+namespace orxonox
+{
+ RegisterClass(InvaderEnemyShooter);
+
+ InvaderEnemyShooter::InvaderEnemyShooter(Context* context) : InvaderEnemy(context)
+ {
+ RegisterObject(InvaderEnemyShooter);
+ enableCollisionCallback();
+ lifetime = 0;
+ // shoot every second
+ shootTimer.setTimer(1.0f, true, createExecutor(createFunctor(&InvaderEnemyShooter::shoot, this)));
+ }
+
+ void InvaderEnemyShooter::tick(float dt)
+ {
+ lifetime += dt;
+ // die after 20 seconds.
+ if (lifetime > 20000)
+ removeHealth(2000);
+
+ if (player != NULL)
+ {
+ float distPlayer = player->getPosition().z - getPosition().z;
+ // orxout() << "i'm different!" << endl;
+ float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * distPlayer;
+ setVelocity(Vector3(950 - abs(distPlayer), 0, newZ));
+ }
+ Pawn::tick(dt);
+ }
+
+ void InvaderEnemyShooter::shoot()
+ {
+ ControllableEntity::fire(0);
+ }
+
+ void InvaderEnemyShooter::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
+ {
+ Pawn::damage(damage, healthdamage, shielddamage, originator);
+ if (getGame() && orxonox_cast<InvaderShip*>(originator) != NULL && getHealth() <= 0)
+ getGame()->addPoints(3*42);
+ }
+}
\ No newline at end of file
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.h
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,58 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderEnemyShooter.h
- @brief Declaration of the InvaderEnemyShooter class.
-*/
-
-#ifndef _InvaderEnemyShooter_H__
-#define _InvaderEnemyShooter_H__
-
-#include "invader/InvaderPrereqs.h"
-
-#include "invader/InvaderEnemy.h"
-#include "tools/Timer.h"
-
-namespace orxonox
-{
- class _InvaderExport InvaderEnemyShooter : public InvaderEnemy
- {
- public:
- InvaderEnemyShooter(Context* context);
-
- virtual void tick(float dt);
- virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator);
- protected:
- void shoot();
- Timer shootTimer;
-
- };
-}
-
-#endif /* _InvaderEnemyShooter_H__ */
Copied: code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderEnemyShooter.h)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.h (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderEnemyShooter.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,58 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderEnemyShooter.h
+ @brief Declaration of the InvaderEnemyShooter class.
+*/
+
+#ifndef _InvaderEnemyShooter_H__
+#define _InvaderEnemyShooter_H__
+
+#include "invader/InvaderPrereqs.h"
+
+#include "invader/InvaderEnemy.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+ class _InvaderExport InvaderEnemyShooter : public InvaderEnemy
+ {
+ public:
+ InvaderEnemyShooter(Context* context);
+
+ virtual void tick(float dt);
+ virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator);
+ protected:
+ void shoot();
+ Timer shootTimer;
+
+ };
+}
+
+#endif /* _InvaderEnemyShooter_H__ */
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.cc
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,137 +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:
- * Florian Zinggeler
- *
- */
-
-#include "InvaderHUDinfo.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Convert.h"
-// #include "Invader.h"
-
-namespace orxonox
-{
- RegisterClass(InvaderHUDinfo);
-
- InvaderHUDinfo::InvaderHUDinfo(Context* context) : OverlayText(context)
- {
- RegisterObject(InvaderHUDinfo);
-
- this->InvaderGame = 0;
- this->bShowLives_ = false;
- this->bShowLevel_ = false;
- this->bShowPoints_ = false;
- this->bShowMultiplier_ = false;
- }
-
- void InvaderHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
- {
- SUPER(InvaderHUDinfo, XMLPort, xmlelement, mode);
-
- XMLPortParam(InvaderHUDinfo, "showlives", setShowLives, getShowLives, xmlelement, mode).defaultValues(false);
- XMLPortParam(InvaderHUDinfo, "showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);
- XMLPortParam(InvaderHUDinfo, "showLevel", setShowLevel, getShowLevel, xmlelement, mode).defaultValues(false);
- XMLPortParam(InvaderHUDinfo, "showMultiplier", setShowMultiplier, getShowMultiplier, xmlelement, mode).defaultValues(false);
- }
-
- void InvaderHUDinfo::tick(float dt)
- {
- SUPER(InvaderHUDinfo, tick, dt);
-
- if (this->InvaderGame)
- {
- if (this->bShowLives_)
- {
- const std::string& lives = multi_cast<std::string>(this->InvaderGame->getLives());
- this->setCaption(lives);
- }
- else if(this->bShowLevel_)
- {
- const std::string& Level = multi_cast<std::string>(this->InvaderGame->getLevel());
- if (this->InvaderGame->lives <= 0)
- {
- setPosition(Vector2(0.1, 0.65));
- this->setCaption("Game ends in 30 seconds.\nPress (e)xit / (q)uit to go to the main menu.\nTo restart fly out of the screen!");
- setTextSize(0.05);
- this->InvaderGame->bEndGame = true;
- }
- else if (this->InvaderGame->bShowLevel)
- {
- setTextSize(0.1);
- setPosition(Vector2(0.3, 0.55));
- std::stringstream sstm;
- sstm << "Level " << Level;
- this->setCaption(sstm.str()); // + level
- }
- else
- {
- setTextSize(0.04);
- setPosition(Vector2(0.14, 0.055));
- this->setCaption(Level);
- }
- }
- else if(this->bShowPoints_)
- {
- const std::string& points = multi_cast<std::string>(this->InvaderGame->getPoints());
- if (this->InvaderGame->lives <= 0)
- {
- setTextSize(0.2);
- setPosition(Vector2(0.1, 0.25));
- this->setCaption("Final score:\n" + points);
- this->setColour(ColourValue(1, 0, 0, 1));
- }
- else
- {
- setTextSize(0.04);
- setPosition(Vector2(0.14, 0.1));
- this->setColour(ColourValue(1, 1, 1, 1));
- this->setCaption(points);
- }
- }
- else if(this->bShowMultiplier_)
- {
- int mult = this->InvaderGame->getMultiplier();
- const std::string& Multiplier = "X " + multi_cast<std::string>(mult);
- this->setCaption(Multiplier);
- this->setColour(ColourValue(1, 0, 0, clamp(float(mult * 0.1), 0.0f, 1.0f)));
- this->setTextSize(clamp(float(mult * 0.1), 0.0f, 1.0f) * 0.01f + 0.04f);
- }
- }
- }
-
- void InvaderHUDinfo::changedOwner()
- {
- SUPER(InvaderHUDinfo, changedOwner);
-
- if (this->getOwner() && this->getOwner()->getGametype())
- {
- this->InvaderGame = orxonox_cast<Invader*>(this->getOwner()->getGametype().get());
- }
- else
- {
- this->InvaderGame = 0;
- }
- }
-}
Copied: code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderHUDinfo.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,137 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ *
+ */
+
+#include "InvaderHUDinfo.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+// #include "Invader.h"
+
+namespace orxonox
+{
+ RegisterClass(InvaderHUDinfo);
+
+ InvaderHUDinfo::InvaderHUDinfo(Context* context) : OverlayText(context)
+ {
+ RegisterObject(InvaderHUDinfo);
+
+ this->InvaderGame = 0;
+ this->bShowLives_ = false;
+ this->bShowLevel_ = false;
+ this->bShowPoints_ = false;
+ this->bShowMultiplier_ = false;
+ }
+
+ void InvaderHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(InvaderHUDinfo, XMLPort, xmlelement, mode);
+
+ XMLPortParam(InvaderHUDinfo, "showlives", setShowLives, getShowLives, xmlelement, mode).defaultValues(false);
+ XMLPortParam(InvaderHUDinfo, "showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);
+ XMLPortParam(InvaderHUDinfo, "showLevel", setShowLevel, getShowLevel, xmlelement, mode).defaultValues(false);
+ XMLPortParam(InvaderHUDinfo, "showMultiplier", setShowMultiplier, getShowMultiplier, xmlelement, mode).defaultValues(false);
+ }
+
+ void InvaderHUDinfo::tick(float dt)
+ {
+ SUPER(InvaderHUDinfo, tick, dt);
+
+ if (this->InvaderGame)
+ {
+ if (this->bShowLives_)
+ {
+ const std::string& lives = multi_cast<std::string>(this->InvaderGame->getLives());
+ this->setCaption(lives);
+ }
+ else if(this->bShowLevel_)
+ {
+ const std::string& Level = multi_cast<std::string>(this->InvaderGame->getLevel());
+ if (this->InvaderGame->lives <= 0)
+ {
+ setPosition(Vector2(0.1, 0.65));
+ this->setCaption("Game ends in 30 seconds.\nPress (e)xit / (q)uit to go to the main menu.\nTo restart fly out of the screen!");
+ setTextSize(0.05);
+ this->InvaderGame->bEndGame = true;
+ }
+ else if (this->InvaderGame->bShowLevel)
+ {
+ setTextSize(0.1);
+ setPosition(Vector2(0.3, 0.55));
+ std::stringstream sstm;
+ sstm << "Level " << Level;
+ this->setCaption(sstm.str()); // + level
+ }
+ else
+ {
+ setTextSize(0.04);
+ setPosition(Vector2(0.14, 0.055));
+ this->setCaption(Level);
+ }
+ }
+ else if(this->bShowPoints_)
+ {
+ const std::string& points = multi_cast<std::string>(this->InvaderGame->getPoints());
+ if (this->InvaderGame->lives <= 0)
+ {
+ setTextSize(0.2);
+ setPosition(Vector2(0.1, 0.25));
+ this->setCaption("Final score:\n" + points);
+ this->setColour(ColourValue(1, 0, 0, 1));
+ }
+ else
+ {
+ setTextSize(0.04);
+ setPosition(Vector2(0.14, 0.1));
+ this->setColour(ColourValue(1, 1, 1, 1));
+ this->setCaption(points);
+ }
+ }
+ else if(this->bShowMultiplier_)
+ {
+ int mult = this->InvaderGame->getMultiplier();
+ const std::string& Multiplier = "X " + multi_cast<std::string>(mult);
+ this->setCaption(Multiplier);
+ this->setColour(ColourValue(1, 0, 0, clamp(float(mult * 0.1), 0.0f, 1.0f)));
+ this->setTextSize(clamp(float(mult * 0.1), 0.0f, 1.0f) * 0.01f + 0.04f);
+ }
+ }
+ }
+
+ void InvaderHUDinfo::changedOwner()
+ {
+ SUPER(InvaderHUDinfo, changedOwner);
+
+ if (this->getOwner() && this->getOwner()->getGametype())
+ {
+ this->InvaderGame = orxonox_cast<Invader*>(this->getOwner()->getGametype().get());
+ }
+ else
+ {
+ this->InvaderGame = 0;
+ }
+ }
+}
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.h
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -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:
- * Florian Zinggeler
- *
- */
-
-#ifndef _InvaderHUDinfo_H__
-#define _InvaderHUDinfo_H__
-
-#include "invader/InvaderPrereqs.h"
-
-#include "tools/interfaces/Tickable.h"
-#include "overlays/OverlayText.h"
-
-namespace orxonox
-{
- class _InvaderExport InvaderHUDinfo : public OverlayText, public Tickable
- {
- public:
- InvaderHUDinfo(Context* context);
-
- virtual void tick(float dt);
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void changedOwner();
-
- inline void setShowLives(bool value)
- { this->bShowLives_ = value; }
- inline bool getShowLives() const
- { return this->bShowLives_; }
-
- inline void setShowLevel(bool value)
- { this->bShowLevel_ = value; }
- inline bool getShowLevel() const
- { return this->bShowLevel_; }
-
- inline void setShowPoints(bool value)
- { this->bShowPoints_ = value; }
- inline bool getShowPoints() const
- { return this->bShowPoints_; }
-
- inline void setShowMultiplier(bool value)
- { this->bShowMultiplier_ = value; }
- inline bool getShowMultiplier() const
- { return this->bShowMultiplier_; }
-
-
- private:
- Invader* InvaderGame;
- bool bShowLives_;
- bool bShowLevel_;
- bool bShowPoints_;
- bool bShowMultiplier_;
- };
-}
-#endif /* _InvaderHUDinfo_H__ */
Copied: code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderHUDinfo.h)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.h (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderHUDinfo.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -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:
+ * Florian Zinggeler
+ *
+ */
+
+#ifndef _InvaderHUDinfo_H__
+#define _InvaderHUDinfo_H__
+
+#include "invader/InvaderPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+ class _InvaderExport InvaderHUDinfo : public OverlayText, public Tickable
+ {
+ public:
+ InvaderHUDinfo(Context* context);
+
+ virtual void tick(float dt);
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void changedOwner();
+
+ inline void setShowLives(bool value)
+ { this->bShowLives_ = value; }
+ inline bool getShowLives() const
+ { return this->bShowLives_; }
+
+ inline void setShowLevel(bool value)
+ { this->bShowLevel_ = value; }
+ inline bool getShowLevel() const
+ { return this->bShowLevel_; }
+
+ inline void setShowPoints(bool value)
+ { this->bShowPoints_ = value; }
+ inline bool getShowPoints() const
+ { return this->bShowPoints_; }
+
+ inline void setShowMultiplier(bool value)
+ { this->bShowMultiplier_ = value; }
+ inline bool getShowMultiplier() const
+ { return this->bShowMultiplier_; }
+
+
+ private:
+ Invader* InvaderGame;
+ bool bShowLives_;
+ bool bShowLevel_;
+ bool bShowPoints_;
+ bool bShowMultiplier_;
+ };
+}
+#endif /* _InvaderHUDinfo_H__ */
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderPrereqs.h
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderPrereqs.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderPrereqs.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,80 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- at file
- at brief
- Shared library macros, enums, constants and forward declarations for the Invader module
-*/
-
-#ifndef _InvaderPrereqs_H__
-#define _InvaderPrereqs_H__
-
-#include "OrxonoxConfig.h"
-#include "OrxonoxPrereqs.h"
-
-//-----------------------------------------------------------------------
-// Shared library settings
-//-----------------------------------------------------------------------
-
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(INVADER_STATIC_BUILD)
-# ifdef INVADER_SHARED_BUILD
-# define _InvaderExport __declspec(dllexport)
-# else
-# if defined( __MINGW32__ )
-# define _InvaderExport
-# else
-# define _InvaderExport __declspec(dllimport)
-# endif
-# endif
-# define _InvaderPrivate
-#elif defined (ORXONOX_GCC_VISIBILITY)
-# define _InvaderExport __attribute__ ((visibility("default")))
-# define _InvaderPrivate __attribute__ ((visibility("hidden")))
-#else
-# define _InvaderExport
-# define _InvaderPrivate
-#endif
-
-//-----------------------------------------------------------------------
-// Forward declarations
-//-----------------------------------------------------------------------
-
-namespace orxonox
-{
- class Invader;
- class InvaderCenterPoint;
- class InvaderShip;
- class InvaderEnemy;
- class InvaderEnemyShooter;
- class InvaderWeapon;
- class InvaderWeaponEnemy;
- class InvaderHUDinfo;
-}
-
-#endif /* _InvaderPrereqs_H__ */
Copied: code/branches/presentationHS14/src/modules/invader/InvaderPrereqs.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderPrereqs.h)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderPrereqs.h (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderPrereqs.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,80 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ at file
+ at brief
+ Shared library macros, enums, constants and forward declarations for the Invader module
+*/
+
+#ifndef _InvaderPrereqs_H__
+#define _InvaderPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(INVADER_STATIC_BUILD)
+# ifdef INVADER_SHARED_BUILD
+# define _InvaderExport __declspec(dllexport)
+# else
+# if defined( __MINGW32__ )
+# define _InvaderExport
+# else
+# define _InvaderExport __declspec(dllimport)
+# endif
+# endif
+# define _InvaderPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
+# define _InvaderExport __attribute__ ((visibility("default")))
+# define _InvaderPrivate __attribute__ ((visibility("hidden")))
+#else
+# define _InvaderExport
+# define _InvaderPrivate
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+ class Invader;
+ class InvaderCenterPoint;
+ class InvaderShip;
+ class InvaderEnemy;
+ class InvaderEnemyShooter;
+ class InvaderWeapon;
+ class InvaderWeaponEnemy;
+ class InvaderHUDinfo;
+}
+
+#endif /* _InvaderPrereqs_H__ */
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderShip.cc
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderShip.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderShip.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,188 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderShip.cc
- @brief Implementation of the InvaderShip class.
-*/
-
-#include "InvaderShip.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "Invader.h"
-
-namespace orxonox
-{
- RegisterClass(InvaderShip);
-
- InvaderShip::InvaderShip(Context* context) : SpaceShip(context)
- {
- RegisterObject(InvaderShip);
-
- speed = 500;
- isFireing = false;
- damping = 10;
- }
-
- void InvaderShip::tick(float dt)
- {
- Vector3 pos = getPosition();
-
- //Movement calculation
- lastTimeFront += dt * damping;
- lastTimeLeft += dt * damping;
- lastTime += dt;
-
- velocity.x = interpolate(clamp(lastTimeLeft, 0.0f, 1.0f), desiredVelocity.x, 0.0f);
- velocity.y = interpolate(clamp(lastTimeFront, 0.0f, 1.0f), desiredVelocity.y, 0.0f);
-
- //Execute movement
- if (this->hasLocalController())
- {
- float dist_y = velocity.y * dt;
- float dist_x = velocity.x * dt;
- if(dist_y + posforeward > -42*3 && dist_y + posforeward < 42*6)
- posforeward += dist_y;
- else
- {
- velocity.y = 0;
- // restart if game ended
- if (getGame())
- if (getGame()->bEndGame)
- {
- getGame()->start();
- return;
- }
- }
- if (pos.z + dist_x > 42*2.5 || pos.z + dist_x < -42*3)
- velocity.x = 0;
- pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
- }
-
- // shoot!
- if (isFireing)
- ControllableEntity::fire(0);
-
- // Camera
- WeakPtr<Camera> camera = this->getCamera();
- if (camera != NULL)
- {
- camera->setPosition(Vector3(-pos.z, -posforeward, 0));
- camera->setOrientation(Vector3::UNIT_Z, Degree(90));
- }
-
-
-
- // bring back on track!
- if(pos.y != 0)
- pos.y = 0;
-
- setPosition(pos);
- setOrientation(Vector3::UNIT_Y, Degree(270));
-
- // Level up!
- if (pos.x > 42000)
- {
- updateLevel();
- setPosition(Vector3(0, 0, pos.z)); // pos - Vector3(30000, 0, 0)
- }
-
- SUPER(InvaderShip, tick, dt);
- }
-
- void InvaderShip::updateLevel()
- {
- lastTime = 0;
- if (getGame())
- getGame()->levelUp();
- }
-
- void InvaderShip::moveFrontBack(const Vector2& value)
- {
- lastTimeLeft = 0;
- desiredVelocity.x = -value.x * speed;
- }
-
- void InvaderShip::moveRightLeft(const Vector2& value)
- {
- lastTimeFront = 0;
- desiredVelocity.y = value.y * speed * 42;
- }
- void InvaderShip::boost(bool bBoost)
- {
- isFireing = bBoost;
- }
- inline bool InvaderShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
- {
- // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint;
- WeakPtr<InvaderEnemy> enemy = orxonox_cast<InvaderEnemy*>(otherObject);
- WeakPtr<Projectile> shot = orxonox_cast<Projectile*>(otherObject);
- // ensure that this gets only called once per enemy.
- if (enemy != NULL && lastEnemy != enemy)
- {
- lastEnemy = enemy;
-
- removeHealth(20);
- if (getGame())
- {
- getGame()->multiplier = 1;
- }
- }
- // was shot, decrease multiplier
- else if (shot != NULL && lastShot != shot)
- {
- if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != NULL)
- {
- if (getGame()->multiplier > 1)
- {
- lastShot = shot;
- getGame()->multiplier -= 1;
- }
- }
- }
- return false;
- // SUPER(InvaderShip, collidesAgainst, otherObject, contactPoint);
- }
-
- WeakPtr<Invader> InvaderShip::getGame()
- {
- if (game == NULL)
- {
- for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
- game = *it;
- }
- return game;
- }
-
- void InvaderShip::death()
- {
- getGame()->costLife();
- SpaceShip::death();
- }
-}
Copied: code/branches/presentationHS14/src/modules/invader/InvaderShip.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderShip.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderShip.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderShip.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,188 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderShip.cc
+ @brief Implementation of the InvaderShip class.
+*/
+
+#include "InvaderShip.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "Invader.h"
+
+namespace orxonox
+{
+ RegisterClass(InvaderShip);
+
+ InvaderShip::InvaderShip(Context* context) : SpaceShip(context)
+ {
+ RegisterObject(InvaderShip);
+
+ speed = 500;
+ isFireing = false;
+ damping = 10;
+ }
+
+ void InvaderShip::tick(float dt)
+ {
+ Vector3 pos = getPosition();
+
+ //Movement calculation
+ lastTimeFront += dt * damping;
+ lastTimeLeft += dt * damping;
+ lastTime += dt;
+
+ velocity.x = interpolate(clamp(lastTimeLeft, 0.0f, 1.0f), desiredVelocity.x, 0.0f);
+ velocity.y = interpolate(clamp(lastTimeFront, 0.0f, 1.0f), desiredVelocity.y, 0.0f);
+
+ //Execute movement
+ if (this->hasLocalController())
+ {
+ float dist_y = velocity.y * dt;
+ float dist_x = velocity.x * dt;
+ if(dist_y + posforeward > -42*3 && dist_y + posforeward < 42*6)
+ posforeward += dist_y;
+ else
+ {
+ velocity.y = 0;
+ // restart if game ended
+ if (getGame())
+ if (getGame()->bEndGame)
+ {
+ getGame()->start();
+ return;
+ }
+ }
+ if (pos.z + dist_x > 42*2.5 || pos.z + dist_x < -42*3)
+ velocity.x = 0;
+ pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
+ }
+
+ // shoot!
+ if (isFireing)
+ ControllableEntity::fire(0);
+
+ // Camera
+ WeakPtr<Camera> camera = this->getCamera();
+ if (camera != NULL)
+ {
+ camera->setPosition(Vector3(-pos.z, -posforeward, 0));
+ camera->setOrientation(Vector3::UNIT_Z, Degree(90));
+ }
+
+
+
+ // bring back on track!
+ if(pos.y != 0)
+ pos.y = 0;
+
+ setPosition(pos);
+ setOrientation(Vector3::UNIT_Y, Degree(270));
+
+ // Level up!
+ if (pos.x > 42000)
+ {
+ updateLevel();
+ setPosition(Vector3(0, 0, pos.z)); // pos - Vector3(30000, 0, 0)
+ }
+
+ SUPER(InvaderShip, tick, dt);
+ }
+
+ void InvaderShip::updateLevel()
+ {
+ lastTime = 0;
+ if (getGame())
+ getGame()->levelUp();
+ }
+
+ void InvaderShip::moveFrontBack(const Vector2& value)
+ {
+ lastTimeLeft = 0;
+ desiredVelocity.x = -value.x * speed;
+ }
+
+ void InvaderShip::moveRightLeft(const Vector2& value)
+ {
+ lastTimeFront = 0;
+ desiredVelocity.y = value.y * speed * 42;
+ }
+ void InvaderShip::boost(bool bBoost)
+ {
+ isFireing = bBoost;
+ }
+ inline bool InvaderShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
+ {
+ // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint;
+ WeakPtr<InvaderEnemy> enemy = orxonox_cast<InvaderEnemy*>(otherObject);
+ WeakPtr<Projectile> shot = orxonox_cast<Projectile*>(otherObject);
+ // ensure that this gets only called once per enemy.
+ if (enemy != NULL && lastEnemy != enemy)
+ {
+ lastEnemy = enemy;
+
+ removeHealth(20);
+ if (getGame())
+ {
+ getGame()->multiplier = 1;
+ }
+ }
+ // was shot, decrease multiplier
+ else if (shot != NULL && lastShot != shot)
+ {
+ if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != NULL)
+ {
+ if (getGame()->multiplier > 1)
+ {
+ lastShot = shot;
+ getGame()->multiplier -= 1;
+ }
+ }
+ }
+ return false;
+ // SUPER(InvaderShip, collidesAgainst, otherObject, contactPoint);
+ }
+
+ WeakPtr<Invader> InvaderShip::getGame()
+ {
+ if (game == NULL)
+ {
+ for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
+ game = *it;
+ }
+ return game;
+ }
+
+ void InvaderShip::death()
+ {
+ getGame()->costLife();
+ SpaceShip::death();
+ }
+}
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderShip.h
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderShip.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderShip.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,90 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderShip.h
- @brief Declaration of the InvaderShip class.
-*/
-
-#ifndef _InvaderShip_H__
-#define _InvaderShip_H__
-
-#include "invader/InvaderPrereqs.h"
-
-#include "worldentities/pawns/SpaceShip.h"
-#include "graphics/Camera.h"
-#include "weapons/projectiles/Projectile.h"
-
-namespace orxonox
-{
- class _InvaderExport InvaderShip : public SpaceShip
- {
- public:
- InvaderShip(Context* context);
-
- virtual void tick(float dt);
-
- // overwrite for 2d movement
- virtual void moveFrontBack(const Vector2& value);
- virtual void moveRightLeft(const Vector2& value);
-
- // Starts or stops fireing
- virtual void boost(bool bBoost);
-
- //no rotation!
- virtual void rotateYaw(const Vector2& value){};
- virtual void rotatePitch(const Vector2& value){};
- //return to main menu if game has ended.
- virtual void rotateRoll(const Vector2& value){if (getGame()) if (getGame()->bEndGame) getGame()->end();};
-
- virtual void updateLevel();
-
- virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
-
- protected:
- virtual void death();
- private:
- WeakPtr<Invader> getGame();
- WeakPtr<Invader> game;
- Camera* camera;
- bool isFireing;
- float speed, damping, posforeward;
- float lastTimeFront, lastTimeLeft, lastTime;
- struct Velocity
- {
- float x;
- float y;
- } velocity, desiredVelocity;
-
- WeakPtr<InvaderEnemy> lastEnemy;
- WeakPtr<Projectile> lastShot;
-
- };
-}
-
-#endif /* _InvaderShip_H__ */
Copied: code/branches/presentationHS14/src/modules/invader/InvaderShip.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderShip.h)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderShip.h (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderShip.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,90 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderShip.h
+ @brief Declaration of the InvaderShip class.
+*/
+
+#ifndef _InvaderShip_H__
+#define _InvaderShip_H__
+
+#include "invader/InvaderPrereqs.h"
+
+#include "worldentities/pawns/SpaceShip.h"
+#include "graphics/Camera.h"
+#include "weapons/projectiles/Projectile.h"
+
+namespace orxonox
+{
+ class _InvaderExport InvaderShip : public SpaceShip
+ {
+ public:
+ InvaderShip(Context* context);
+
+ virtual void tick(float dt);
+
+ // overwrite for 2d movement
+ virtual void moveFrontBack(const Vector2& value);
+ virtual void moveRightLeft(const Vector2& value);
+
+ // Starts or stops fireing
+ virtual void boost(bool bBoost);
+
+ //no rotation!
+ virtual void rotateYaw(const Vector2& value){};
+ virtual void rotatePitch(const Vector2& value){};
+ //return to main menu if game has ended.
+ virtual void rotateRoll(const Vector2& value){if (getGame()) if (getGame()->bEndGame) getGame()->end();};
+
+ virtual void updateLevel();
+
+ virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
+
+ protected:
+ virtual void death();
+ private:
+ WeakPtr<Invader> getGame();
+ WeakPtr<Invader> game;
+ Camera* camera;
+ bool isFireing;
+ float speed, damping, posforeward;
+ float lastTimeFront, lastTimeLeft, lastTime;
+ struct Velocity
+ {
+ float x;
+ float y;
+ } velocity, desiredVelocity;
+
+ WeakPtr<InvaderEnemy> lastEnemy;
+ WeakPtr<Projectile> lastShot;
+
+ };
+}
+
+#endif /* _InvaderShip_H__ */
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderWeapon.cc
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderWeapon.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderWeapon.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,88 +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:
- * Florian Zinggeler
- * Co-authors:
- * --
- *
- */
-
-/**
- @file InvaderWeapon.h
- @brief Implementation of the InvaderWeapon class.
-*/
-
-#include "InvaderWeapon.h"
-
-#include "core/CoreIncludes.h"
-// #include "core/XMLPort.h"
-// #include "core/command/Executor.h"
-
-#include "graphics/Model.h"
-#include "weaponsystem/Weapon.h"
-#include "weaponsystem/WeaponPack.h"
-#include "weaponsystem/WeaponSystem.h"
-#include "worldentities/WorldEntity.h"
-#include "worldentities/pawns/Pawn.h"
-
-#include "weapons/projectiles/Projectile.h"
-#include "weapons/MuzzleFlash.h"
-
-namespace orxonox
-{
- RegisterClass(InvaderWeapon);
-
- InvaderWeapon::InvaderWeapon(Context* context) : HsW01(context)
- {
- RegisterObject(InvaderWeapon);
- }
-
- InvaderWeapon::~InvaderWeapon(){}
-
- void InvaderWeapon::shot()
- {
- assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
-
- // Create the projectile.projectile
- projectile = new Projectile(this->getContext());
- WeakPtr<Model> model = new Model(projectile->getContext());
- model->setMeshSource(mesh_);
- model->setCastShadows(false);
- projectile->attach(model);
- model->setScale(5);
-
- this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
- // only shoot in foreward direction
- projectile->setOrientation(Quaternion(sqrt(0.5f),0,sqrt(0.5f),0));
- projectile->setPosition(this->getMuzzlePosition());
- // only shoot in foreward direction
- projectile->setVelocity(Vector3(1, 0, 0) * 2000);
-
- projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
- projectile->setDamage(this->getDamage());
- projectile->setShieldDamage(this->getShieldDamage());
- projectile->setHealthDamage(this->getHealthDamage());
-
- // Display the muzzle flash.
- this->InvaderWeapon::muzzleflash();
- }
-}
Copied: code/branches/presentationHS14/src/modules/invader/InvaderWeapon.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderWeapon.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderWeapon.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderWeapon.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,88 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * --
+ *
+ */
+
+/**
+ @file InvaderWeapon.h
+ @brief Implementation of the InvaderWeapon class.
+*/
+
+#include "InvaderWeapon.h"
+
+#include "core/CoreIncludes.h"
+// #include "core/XMLPort.h"
+// #include "core/command/Executor.h"
+
+#include "graphics/Model.h"
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "worldentities/WorldEntity.h"
+#include "worldentities/pawns/Pawn.h"
+
+#include "weapons/projectiles/Projectile.h"
+#include "weapons/MuzzleFlash.h"
+
+namespace orxonox
+{
+ RegisterClass(InvaderWeapon);
+
+ InvaderWeapon::InvaderWeapon(Context* context) : HsW01(context)
+ {
+ RegisterObject(InvaderWeapon);
+ }
+
+ InvaderWeapon::~InvaderWeapon(){}
+
+ void InvaderWeapon::shot()
+ {
+ assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
+
+ // Create the projectile.projectile
+ projectile = new Projectile(this->getContext());
+ WeakPtr<Model> model = new Model(projectile->getContext());
+ model->setMeshSource(mesh_);
+ model->setCastShadows(false);
+ projectile->attach(model);
+ model->setScale(5);
+
+ this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
+ // only shoot in foreward direction
+ projectile->setOrientation(Quaternion(sqrt(0.5f),0,sqrt(0.5f),0));
+ projectile->setPosition(this->getMuzzlePosition());
+ // only shoot in foreward direction
+ projectile->setVelocity(Vector3(1, 0, 0) * 2000);
+
+ projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+ projectile->setDamage(this->getDamage());
+ projectile->setShieldDamage(this->getShieldDamage());
+ projectile->setHealthDamage(this->getHealthDamage());
+
+ // Display the muzzle flash.
+ this->InvaderWeapon::muzzleflash();
+ }
+}
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderWeapon.h
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderWeapon.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderWeapon.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,55 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderWeapon.h
- @brief Definition of the InvaderWeapon class.
-*/
-
-#ifndef _InvaderWeapon_H__
-#define _InvaderWeapon_H__
-
-#include "weapons/weaponmodes/HsW01.h"
-#include "weapons/WeaponsPrereqs.h"
-
-#include "tools/Timer.h"
-
-namespace orxonox
-{
- class _InvaderExport InvaderWeapon : public HsW01
- {
- public:
- InvaderWeapon(Context* context);
- virtual ~InvaderWeapon();
- protected:
- virtual void shot();
- WeakPtr<Projectile> projectile;
- };
-}
-
-#endif /* _InvaderWeapon_H__ */
Copied: code/branches/presentationHS14/src/modules/invader/InvaderWeapon.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderWeapon.h)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderWeapon.h (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderWeapon.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,55 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderWeapon.h
+ @brief Definition of the InvaderWeapon class.
+*/
+
+#ifndef _InvaderWeapon_H__
+#define _InvaderWeapon_H__
+
+#include "weapons/weaponmodes/HsW01.h"
+#include "weapons/WeaponsPrereqs.h"
+
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+ class _InvaderExport InvaderWeapon : public HsW01
+ {
+ public:
+ InvaderWeapon(Context* context);
+ virtual ~InvaderWeapon();
+ protected:
+ virtual void shot();
+ WeakPtr<Projectile> projectile;
+ };
+}
+
+#endif /* _InvaderWeapon_H__ */
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.cc
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.cc 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,55 +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:
- * Florian Zinggeler
- * Co-authors:
- * --
- *
- */
-
-/**
- @file InvaderWeaponEnemy.h
- @brief Implementation of the InvaderWeaponEnemy class.
-*/
-
-#include "InvaderWeaponEnemy.h"
-
-namespace orxonox
-{
- RegisterClass(InvaderWeaponEnemy);
-
- InvaderWeaponEnemy::InvaderWeaponEnemy(Context* context) : InvaderWeapon(context)
- {
- RegisterObject(InvaderWeaponEnemy);
- }
-
- void InvaderWeaponEnemy::shot()
- {
- InvaderWeapon::shot();
- // SUPER(InvaderWeaponEnemy, shot);
- // only shoot in foreward direction
- projectile->setVelocity(Vector3(1, 0, 0) * 300);
- // projectile->setOrientation(Quaternion(sqrt(0.5),0,sqrt(0.5),0));
- }
-}
-
-
Copied: code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.cc (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderWeaponEnemy.cc)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.cc (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.cc 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,55 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * --
+ *
+ */
+
+/**
+ @file InvaderWeaponEnemy.h
+ @brief Implementation of the InvaderWeaponEnemy class.
+*/
+
+#include "InvaderWeaponEnemy.h"
+
+namespace orxonox
+{
+ RegisterClass(InvaderWeaponEnemy);
+
+ InvaderWeaponEnemy::InvaderWeaponEnemy(Context* context) : InvaderWeapon(context)
+ {
+ RegisterObject(InvaderWeaponEnemy);
+ }
+
+ void InvaderWeaponEnemy::shot()
+ {
+ InvaderWeapon::shot();
+ // SUPER(InvaderWeaponEnemy, shot);
+ // only shoot in foreward direction
+ projectile->setVelocity(Vector3(1, 0, 0) * 300);
+ // projectile->setOrientation(Quaternion(sqrt(0.5),0,sqrt(0.5),0));
+ }
+}
+
+
Deleted: code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.h
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.h 2014-12-11 14:55:25 UTC (rev 10175)
+++ code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -1,53 +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:
- * Florian Zinggeler
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file InvaderWeaponEnemy.h
- @brief Definition of the InvaderWeaponEnemy class.
-*/
-
-#ifndef _InvaderWeaponEnemy_H__
-#define _InvaderWeaponEnemy_H__
-
-// #include "weapons/weaponmodes/HsW01.h"
-// #include "weapons/WeaponsPrereqs.h"
-#include "invader/InvaderWeapon.h"
-#include "tools/Timer.h"
-
-namespace orxonox
-{
- class _InvaderExport InvaderWeaponEnemy : public InvaderWeapon
- {
- public:
- InvaderWeaponEnemy(Context* context);
- protected:
- virtual void shot();
- };
-}
-
-#endif /* _InvaderWeaponEnemy_H__ */
Copied: code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.h (from rev 10175, code/branches/surfaceraceHS14/src/modules/invader/InvaderWeaponEnemy.h)
===================================================================
--- code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.h (rev 0)
+++ code/branches/presentationHS14/src/modules/invader/InvaderWeaponEnemy.h 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,53 @@
+/*
+ * 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:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file InvaderWeaponEnemy.h
+ @brief Definition of the InvaderWeaponEnemy class.
+*/
+
+#ifndef _InvaderWeaponEnemy_H__
+#define _InvaderWeaponEnemy_H__
+
+// #include "weapons/weaponmodes/HsW01.h"
+// #include "weapons/WeaponsPrereqs.h"
+#include "invader/InvaderWeapon.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+ class _InvaderExport InvaderWeaponEnemy : public InvaderWeapon
+ {
+ public:
+ InvaderWeaponEnemy(Context* context);
+ protected:
+ virtual void shot();
+ };
+}
+
+#endif /* _InvaderWeaponEnemy_H__ */
Copied: code/branches/presentationHS14/svn-commit.tmp (from rev 10175, code/branches/surfaceraceHS14/svn-commit.tmp)
===================================================================
--- code/branches/presentationHS14/svn-commit.tmp (rev 0)
+++ code/branches/presentationHS14/svn-commit.tmp 2014-12-11 15:09:29 UTC (rev 10176)
@@ -0,0 +1,9 @@
+
+--This line, and those below, will be ignored--
+
+M data/levels/DodgeRace.oxw
+A data/levels/DodgeRaceold.oxw
+M data/levels/templates/spaceshipInvader.oxt
+M data/levels/templates/spaceshipDodgeRace.oxt
+A data/levels/DodgeRacePlus.oxw
+D data/levels/DodgeRace
More information about the Orxonox-commit
mailing list