[Orxonox-commit 5237] r9900 - in code/branches/presentationHS13: . data/levels data/levels/includes data/levels/templates data/overlays src/modules src/modules/invader src/modules/weapons/weaponmodes src/orxonox/gametypes src/orxonox/graphics src/orxonox/worldentities src/orxonox/worldentities/pawns
smerkli at orxonox.net
smerkli at orxonox.net
Mon Dec 16 13:33:09 CET 2013
Author: smerkli
Date: 2013-12-16 13:33:09 +0100 (Mon, 16 Dec 2013)
New Revision: 9900
Added:
code/branches/presentationHS13/data/levels/Invaders.oxw
code/branches/presentationHS13/data/levels/_temp.oxw
code/branches/presentationHS13/data/levels/includes/invaderWeapon.oxi
code/branches/presentationHS13/data/levels/includes/invaderWeaponEnemy.oxi
code/branches/presentationHS13/data/levels/templates/.shipmodels
code/branches/presentationHS13/data/levels/templates/enemyInvader.oxt
code/branches/presentationHS13/data/levels/templates/enemyInvaderShooter.oxt
code/branches/presentationHS13/data/levels/templates/spaceshipInvader.oxt
code/branches/presentationHS13/data/overlays/InvaderHUD.oxo
code/branches/presentationHS13/src/modules/invader/
code/branches/presentationHS13/src/modules/invader/CMakeLists.txt
code/branches/presentationHS13/src/modules/invader/Invader.cc
code/branches/presentationHS13/src/modules/invader/Invader.h
code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.cc
code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.h
code/branches/presentationHS13/src/modules/invader/InvaderEnemy.cc
code/branches/presentationHS13/src/modules/invader/InvaderEnemy.h
code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.cc
code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.h
code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.cc
code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.h
code/branches/presentationHS13/src/modules/invader/InvaderPrereqs.h
code/branches/presentationHS13/src/modules/invader/InvaderShip.cc
code/branches/presentationHS13/src/modules/invader/InvaderShip.h
code/branches/presentationHS13/src/modules/invader/InvaderWeapon.cc
code/branches/presentationHS13/src/modules/invader/InvaderWeapon.h
code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.cc
code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.h
Removed:
code/branches/presentationHS13/src/modules/invader/CMakeLists.txt
code/branches/presentationHS13/src/modules/invader/Invader.cc
code/branches/presentationHS13/src/modules/invader/Invader.h
code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.cc
code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.h
code/branches/presentationHS13/src/modules/invader/InvaderEnemy.cc
code/branches/presentationHS13/src/modules/invader/InvaderEnemy.h
code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.cc
code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.h
code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.cc
code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.h
code/branches/presentationHS13/src/modules/invader/InvaderPrereqs.h
code/branches/presentationHS13/src/modules/invader/InvaderShip.cc
code/branches/presentationHS13/src/modules/invader/InvaderShip.h
code/branches/presentationHS13/src/modules/invader/InvaderWeapon.cc
code/branches/presentationHS13/src/modules/invader/InvaderWeapon.h
code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.cc
code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.h
Modified:
code/branches/presentationHS13/
code/branches/presentationHS13/src/modules/CMakeLists.txt
code/branches/presentationHS13/src/modules/weapons/weaponmodes/HsW01.h
code/branches/presentationHS13/src/orxonox/gametypes/Gametype.cc
code/branches/presentationHS13/src/orxonox/graphics/ParticleEmitter.cc
code/branches/presentationHS13/src/orxonox/graphics/ParticleEmitter.h
code/branches/presentationHS13/src/orxonox/worldentities/BigExplosion.cc
code/branches/presentationHS13/src/orxonox/worldentities/BigExplosion.h
code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.cc
Log:
Merged the invaders branch of Florian
Property changes on: code/branches/presentationHS13
___________________________________________________________________
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/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/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/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/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/steering:5949-6091,8140-8595
/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/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/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/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/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/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/steering:5949-6091,8140-8595
/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
Copied: code/branches/presentationHS13/data/levels/Invaders.oxw (from rev 9896, code/branches/invaders/data/levels/Invaders.oxw)
===================================================================
--- code/branches/presentationHS13/data/levels/Invaders.oxw (rev 0)
+++ code/branches/presentationHS13/data/levels/Invaders.oxw 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,77 @@
+<LevelInfo
+ name = "Orxonox Arcade"
+ description = "2D Arcade shooter. Maximise your points!!!\nTip: try to keep the multiplier high by avoiding shots and enemies."
+ tags = "minigame"
+ screenshot = "emptylevel.png"
+/>
+<?lua
+ include("stats.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipInvader.oxt")
+ include("templates/enemyInvader.oxt")
+ include("templates/enemyInvaderShooter.oxt")
+ include("overlays/InvaderHUD.oxo")
+?>
+
+<Level gametype = Invader>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <!-- ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox" -->
+ <Scene
+ ambientlight = "0.8, 0.7, 0.4"
+ skybox = "Orxonox/skyBoxBasic"
+ >
+
+ <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="1100, 11000, -7000" lookat="0, 0, 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=InvaderShip pawndesign=spaceshipinvader />
+
+ <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=10 stayActive="true" delay=0 />
+
+
+ <InvaderCenterPoint name=invadercenter />
+
+ <?lua
+ for i = 1, 300, 1 do
+ j = math.random()
+ ?>
+
+ <MovableEntity
+ position = "<?lua print(math.random()* 40000 + 1000) ?>,-1000,<?lua print(math.random() * 4000 - 2000) ?>"
+ collisionType = dynamic
+ linearDamping = 0.8
+ angularDamping = 0
+ scale = "<?lua print(j * 150)?>"
+ collisiondamage = 0
+ enablecollisiondamage = true
+ >
+ <attached>
+ <Model mass="<?lua print(j * 1000) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="<?lua print(j * 350) ?>" />
+ </collisionShapes>
+ </MovableEntity>
+
+ <?lua
+ end
+ ?>
+
+ </Scene>
+</Level>
+
Copied: code/branches/presentationHS13/data/levels/_temp.oxw (from rev 9896, code/branches/invaders/data/levels/_temp.oxw)
===================================================================
--- code/branches/presentationHS13/data/levels/_temp.oxw (rev 0)
+++ code/branches/presentationHS13/data/levels/_temp.oxw 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,377 @@
+<LevelInfo
+ name = "Surface Race Presentation"
+ description = "just awesome 2.0"
+ screenshot = "surfaceRace.png"
+ tags = "gametype, shipselection"
+ startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser, spaceshiprace"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+ include("templates/spaceshipRace.oxt")
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipGhost.oxt")
+ include("templates/spaceshipSpacecruiser.oxt")
+ include("templates/pickupRepresentationTemplates.oxt")
+
+?>
+
+<Level
+gametype = SpaceRace
+>
+
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "2.0, 2.0, 2.0"
+ skybox = "Orxonox/skyBoxClouds"
+ gravity = "0,-75,0"
+ negativeWorldRange = "-100000, -100000, -100000"
+ positiveWorldRange = " 100000, 100000, 100000"
+ hasPhysics = true
+ >
+
+ <Template name=PortalDefault>
+ <PortalEndPoint>
+ <attached>
+ <Model mesh="Spacegate.mesh" scale="3"/>
+ </attached>
+ </PortalEndPoint>
+ </Template>
+
+ <PortalEndPoint position="6000,8050,2500" id="1" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+ <PortalEndPoint position="6100,8050,-4500" id="2" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+ <PortalLink fromID="1" toID="2" />
+ <PortalLink fromID="2" toID="1" />
+
+ <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"/>
+
+
+ <Model position="4200,8050,-1000" scale=10 mesh="debris-pile01.mesh" shadow=true />
+ <Model position="4200,8050,-1000" scale=10 mesh="debris-pile02.mesh" shadow=true />
+ <Model position="4200,8050,-1000" scale=10 mesh="debris-pile03.mesh" shadow=true />
+
+ <MovableEntity position="-700,8090,-300" velocity="80,0,0" rotationaxis="1,0,1" rotationrate=200>
+ <attached>
+ <Model position="0,0,-20" scale=10 mesh="cokebottle.mesh" />
+ </attached>
+ </MovableEntity>
+
+
+<SpaceRaceManager>
+ <checkpoints>
+ <RaceCheckPoint name="checkpoint1" position="0,8050,-1000" direction="0,1,0" collisionType="static" scale="4" distance="150" checkpointindex="0" islast="false" nextcheckpoints="1,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint2" position="1000,8050,-4000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="1" islast="false" nextcheckpoints="2,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint3" position="3000,8050,-4000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="2" islast="false" nextcheckpoints="3,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint4" position="4000,8050,-1000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="3" islast="false" nextcheckpoints="4,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint5" position="4000,8050,0" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="4" islast="false" nextcheckpoints="5,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint6" position="3000,8050,1000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="5" islast="false" nextcheckpoints="6,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint7" position="0,8050,2000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="6" islast="false" nextcheckpoints="7,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint8" position="-4000,8050,3000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="7" islast="false" nextcheckpoints="8,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint9" position="-4000,8050,5000" direction="0,1,0" roll="-45" collisionType="static" scale="4" distance="150" checkpointindex="8" islast="false" nextcheckpoints="9,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint10" position="-3000,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="150" checkpointindex="9" islast="false" nextcheckpoints="10,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint11" position="0,8050,6000" direction="0,1,0" roll="90" collisionType="static" scale="4" distance="120" checkpointindex="10" islast="false" nextcheckpoints="11,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint12" position="6000,8050,6000" direction="0,1,0" roll="45" collisionType="static" scale="4" distance="150" checkpointindex="11" islast="false" nextcheckpoints="12,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint13" position="5500,8050,3000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="12" islast="false" nextcheckpoints="13,-1,-1">
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+
+ <RaceCheckPoint name="checkpoint14" position="6000,8050,-5000" direction="0,1,0" roll="0" collisionType="static" scale="4" distance="150" checkpointindex="13" islast="true" >
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="0,0,-220" halfExtents="220, 40, 40" />
+ <BoxCollisionShape position="220,0,0" halfExtents="40, 40, 220" />
+ <BoxCollisionShape position="-220,0,0" halfExtents="40, 40, 220" />
+ </collisionShapes>
+ </RaceCheckPoint>
+</checkpoints>
+</SpaceRaceManager>
+
+ <SpawnPoint team=0 position="0,8050,0" lookat="0,8000,-8000" spawnclass=SpaceShip pawndesign=spaceshipspacecruiser />
+
+
+ <!-- -----------------------Zylinder---------------------------- -->
+<StaticEntity position="2750,8050,6000" direction="1,0,0" roll="90" scale="4" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="cylinder.mesh" scale3D="100,100,400" />
+ <!--
+ <Model position="0,80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+ <Model position="0,-80,600" mesh="testcube.mesh" scale3D="90,18,-600" />
+ <Model position="80,0,600" mesh="testcube.mesh" scale3D="18,90,-600" />
+ <Model position="-80,0,600" mesh="testcube.mesh" scale3D="18,09,-600" />
+ -->
+
+ </attached>
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,320,2400" halfExtents="360,72,2400" />
+ <BoxCollisionShape position="0,-320,2400" halfExtents="360,72,2400" />
+ <BoxCollisionShape position="320,0,2400" halfExtents="72,360,2400" />
+ <BoxCollisionShape position="-320,0,2400" halfExtents="72,360,2400" />
+
+
+
+ </collisionShapes>
+
+ </StaticEntity>
+
+<!-- ------------------Cube between gate 4 and 5----------------- -->
+<StaticEntity position="4465,8050,-500" direction="0,0,0" scale="1" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+ <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+ -->
+
+ </attached>
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,0" halfExtents="450,600,50" />
+
+ </collisionShapes>
+
+ </StaticEntity>
+
+<StaticEntity position="3535,8050,-500" direction="0,0,0" scale="1" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="blackcube.mesh" scale3D="450,600,50" />
+<!--
+ <Model position="0,0,0" mesh="testcube.mesh" scale3D="450,600,50" />
+ -->
+
+ </attached>
+
+
+ <collisionShapes>
+
+
+ <BoxCollisionShape position="0,0,0" halfExtents="450,600,50" />
+
+ </collisionShapes>
+
+ </StaticEntity>
+
+
+
+
+ <!-- ------------------Boden----------------- -->
+ <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000 friction=0.01>
+ <attached>
+ <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="8000,8000,8000" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,50,0" halfExtents="8000,8000,8000" />um j?:P"{
+
+ </collisionShapes>
+</StaticEntity>
+
+
+<!-- ---------------------PickUp---------------------- -->
+
+
+ <PickupSpawner pickup=smallspeedpickup position="4000,8050,0" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+ <PickupSpawner pickup=mediumspeedpickup position="5500,8100,2000" triggerDistance="40" respawnTime="10" maxSpawnedItems="99" scale="8" />
+ <PickupSpawner pickup="mediumshrinkpickup" position="3000,8050,-4000" triggerDistance="40" respawnTime="60" maxSpawnedItems="5" scale="8" />
+
+
+
+
+ <!-- ---------------asteroid ellipse----------------- -->
+
+ <?lua
+ max = 15
+ for i = 0, max, 1
+ do
+ x=-12000
+ y=10000
+ z=-12000
+
+ ?>
+ <?lua
+ for k = 1, 15, 1
+ do
+ j = math.random()
+ ?>
+
+ <MovableEntity
+ position = "<?lua print(x + math.random() * 20000) ?>,<?lua print(y + math.random() * 5000) ?>,<?lua print(z + math.random() * 20000) ?>"
+ collisionType = "dynamic"
+ linearDamping = "0.5"
+ angularDamping = "0.5"
+ collisiondamage = "100"
+ enablecollisiondamage = "true"
+ scale="<?lua print(j * 5) ?>" >
+ <attached>
+ <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
+ <?lua if k == 0 then ?><attached><!-- ---------asteroid fog----- -->
+ <ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
+ </attached> <?lua end ?>
+ </Model>
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="<?lua print(j * 80) ?>" />
+ </collisionShapes>
+ </MovableEntity>
+ <?lua
+ end
+ ?>
+ <?lua end ?>
+
+ </Scene>
+</Level>
+
+
Copied: code/branches/presentationHS13/data/levels/includes/invaderWeapon.oxi (from rev 9896, code/branches/invaders/data/levels/includes/invaderWeapon.oxi)
===================================================================
--- code/branches/presentationHS13/data/levels/includes/invaderWeapon.oxi (rev 0)
+++ code/branches/presentationHS13/data/levels/includes/invaderWeapon.oxi 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,27 @@
+ <weaponslots>
+ <WeaponSlot position="-9.2,2,-13" />
+ <WeaponSlot position=" 9.2,2,-13" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+ </weaponsets>
+ <weapons>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ </links>
+ <Weapon>
+ <InvaderWeapon mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="laserbeam.mesh" />
+ </Weapon>
+ <Weapon>
+ <InvaderWeapon mode=0 munitionpershot=0 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="laserbeam.mesh" />
+ </Weapon>
+ </WeaponPack>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+ </links>
+ </WeaponPack>
+ </weapons>
Copied: code/branches/presentationHS13/data/levels/includes/invaderWeaponEnemy.oxi (from rev 9896, code/branches/invaders/data/levels/includes/invaderWeaponEnemy.oxi)
===================================================================
--- code/branches/presentationHS13/data/levels/includes/invaderWeaponEnemy.oxi (rev 0)
+++ code/branches/presentationHS13/data/levels/includes/invaderWeaponEnemy.oxi 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,27 @@
+ <weaponslots>
+ <WeaponSlot position="-9.2,2,-13" />
+ <WeaponSlot position=" 9.2,2,-13" />
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+ </weaponsets>
+ <weapons>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ </links>
+ <Weapon>
+ <InvaderWeaponEnemy mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="laserbeam.mesh" />
+ </Weapon>
+ <Weapon>
+ <InvaderWeaponEnemy mode=0 munitionpershot=0 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="laserbeam.mesh" />
+ </Weapon>
+ </WeaponPack>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=1 weaponmode=0 />
+ </links>
+ </WeaponPack>
+ </weapons>
Copied: code/branches/presentationHS13/data/levels/templates/.shipmodels (from rev 9896, code/branches/invaders/data/levels/templates/.shipmodels)
===================================================================
--- code/branches/presentationHS13/data/levels/templates/.shipmodels (rev 0)
+++ code/branches/presentationHS13/data/levels/templates/.shipmodels 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,16 @@
+spaceshipTransporterSL
+spaceshipTurret
+spaceshipGhost
+spaceshipEscort
+spaceshipSwallow
+spaceshipAssff
+spaceshipSpacecruiser
+spaceshipHXY
+spaceshipH2
+spaceshipHXYSL
+spaceshipCollateralDamage
+spaceshipAssff2
+spaceshipPirate
+spaceshipRace
+spaceshipTransporter
+spaceshipInvader
Copied: code/branches/presentationHS13/data/levels/templates/enemyInvader.oxt (from rev 9896, code/branches/invaders/data/levels/templates/enemyInvader.oxt)
===================================================================
--- code/branches/presentationHS13/data/levels/templates/enemyInvader.oxt (rev 0)
+++ code/branches/presentationHS13/data/levels/templates/enemyInvader.oxt 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,120 @@
+<Template name=enemyinvader>
+ <InvaderEnemy
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipescortcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 4
+
+ health = 10
+ maxhealth = 10
+ initialhealth = 10
+
+ shieldhealth = 10
+ initialshieldhealth = 10
+ maxshieldhealth = 10
+ shieldabsorption = 0.9
+ 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 = 0.00001
+ linearDamping = 0
+ angularDamping = 0
+
+ collisiondamage = 100
+ enablecollisiondamage = true
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipescortengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipescortengine />
+ </engines>
+ <attached>
+ <Model position="0,0,0" yaw=180 pitch=270 roll=0 scale=2 mesh="swallow_mat.mesh" />
+ <Model position="0,0,0" yaw=180 pitch=270 roll=0 scale=2 mesh="escortWeapon.mesh" />
+<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
+
+swallow_mat.mesh
+"ghost.mesh"
+
+<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")
+?>
+ </InvaderEnemy>
+</Template>
+
+<!-- <Template name=spaceshipescortcameras defaults=0>
+ <InvaderEnemy>
+ <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,300,-100" direction="0, -1, 0" drag=false mouselook=true />
+ </camerapositions>
+ </InvaderEnemy>
+</Template> -->
+
+<Template name=spaceshipescortengine 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>
Copied: code/branches/presentationHS13/data/levels/templates/enemyInvaderShooter.oxt (from rev 9896, code/branches/invaders/data/levels/templates/enemyInvaderShooter.oxt)
===================================================================
--- code/branches/presentationHS13/data/levels/templates/enemyInvaderShooter.oxt (rev 0)
+++ code/branches/presentationHS13/data/levels/templates/enemyInvaderShooter.oxt 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,120 @@
+<Template name=enemyinvadershooter>
+ <InvaderEnemyShooter
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipescortcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 4
+
+ health = 20
+ maxhealth = 20
+ initialhealth = 20
+
+ shieldhealth = 20
+ initialshieldhealth = 20
+ maxshieldhealth = 20
+ shieldabsorption = 0.9
+ 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 = 100
+ linearDamping = 0
+ angularDamping = 0
+
+ collisiondamage = 100
+ enablecollisiondamage = true
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipescortengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipescortengine />
+ </engines>
+ <attached>
+ <Model position="0,0,0" yaw=180 pitch=270 roll=0 scale=2 mesh="ghost.mesh" />
+ <Model position="0,0,0" yaw=180 pitch=270 roll=0 scale=2 mesh="escortWeapon.mesh" />
+<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
+
+swallow_mat.mesh
+"ghost.mesh"
+
+<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/invaderWeaponEnemy.oxi")
+?>
+ </InvaderEnemyShooter>
+</Template>
+
+<!-- <Template name=spaceshipescortcameras defaults=0>
+ <InvaderEnemyShooter>
+ <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,300,-100" direction="0, -1, 0" drag=false mouselook=true />
+ </camerapositions>
+ </InvaderEnemyShooter>
+</Template> -->
+
+<Template name=spaceshipescortengine 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>
Copied: code/branches/presentationHS13/data/levels/templates/spaceshipInvader.oxt (from rev 9896, code/branches/invaders/data/levels/templates/spaceshipInvader.oxt)
===================================================================
--- code/branches/presentationHS13/data/levels/templates/spaceshipInvader.oxt (rev 0)
+++ code/branches/presentationHS13/data/levels/templates/spaceshipInvader.oxt 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,116 @@
+<Template name=spaceshipinvader>
+ <InvaderShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipescortcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 4
+
+ health = 80
+ maxhealth = 200
+ initialhealth = 80
+
+ shieldhealth = 35
+ initialshieldhealth = 35
+ maxshieldhealth = 60
+ shieldabsorption = 0.9
+ 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.7
+ 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")
+?>
+ </InvaderShip>
+</Template>
+
+<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,300,-100" direction="0, -1, 0" drag=false mouselook=true />
+ </camerapositions>
+ </InvaderShip>
+</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>
Copied: code/branches/presentationHS13/data/overlays/InvaderHUD.oxo (from rev 9896, code/branches/invaders/data/overlays/InvaderHUD.oxo)
===================================================================
--- code/branches/presentationHS13/data/overlays/InvaderHUD.oxo (rev 0)
+++ code/branches/presentationHS13/data/overlays/InvaderHUD.oxo 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,108 @@
+<Template name="InvaderHUD">
+ <OverlayGroup name="InvaderHUD" scale = "1, 1">
+ <InvaderHUDinfo
+ 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"
+
+ showlives = true
+ showlevel = false
+ showpoints = false
+ />
+ <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 = "Lives: "
+ />
+
+ <OverlayText
+ position = "0.02, 0.055"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ caption = "Level: "
+ />
+
+ <InvaderHUDinfo
+ position = "0.14, 0.055"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+
+ showlives = false
+ showlevel = true
+ showpoints = false
+ />
+
+ <OverlayText
+ position = "0.02, 0.1"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ caption = "Points: "
+ />
+
+ <InvaderHUDinfo
+ position = "0.14, 0.1"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+
+ showlives = false
+ showlevel = false
+ showpoints = true
+ />
+
+ <InvaderHUDinfo
+ position = "0.25, 0.1"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+
+ showMultiplier = true
+ />
+ </OverlayGroup>
+</Template>
+
+
+<Template name="spaceshiphud">
+ <OverlayGroup name = "spaceshiphud" scale = "1, 1">
+ <HUDHealthBar
+ name = "HealthBar1"
+ background = "Orxonox/HealthBarBackground"
+ size = "0.35, 0.0875"
+ position = "0.0 , 0.9 "
+ pickpoint = "0, 1"
+ bartexture = "healthbar_bar.png"
+ textfont = "VeraMono"
+ textusebarcolour = true
+ textsize = 0.039
+ textoffset = "0.315, 0.05"
+ textpickpoint = "0, 0"
+ textalign = "right"
+ correctaspect = false
+ textcorrectaspect = false
+ >
+ <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
+ <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
+ <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
+ </HUDHealthBar>
+ </OverlayGroup>
+</Template>
\ No newline at end of file
Modified: code/branches/presentationHS13/src/modules/CMakeLists.txt
===================================================================
--- code/branches/presentationHS13/src/modules/CMakeLists.txt 2013-12-16 12:29:30 UTC (rev 9899)
+++ code/branches/presentationHS13/src/modules/CMakeLists.txt 2013-12-16 12:33:09 UTC (rev 9900)
@@ -38,3 +38,4 @@
ADD_SUBDIRECTORY(weapons)
ADD_SUBDIRECTORY(docking)
ADD_SUBDIRECTORY(towerdefense)
+ADD_SUBDIRECTORY(invader)
Deleted: code/branches/presentationHS13/src/modules/invader/CMakeLists.txt
===================================================================
--- code/branches/invaders/src/modules/invader/CMakeLists.txt 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/CMakeLists.txt 2013-12-16 12:33:09 UTC (rev 9900)
@@ -1,22 +0,0 @@
-SET_SOURCE_FILES(Invader_SRC_FILES
-BUILD_UNIT InvaderBuildUnit.cc
- Invader.cc
- InvaderCenterPoint.cc
- InvaderShip.cc
- InvaderEnemy.cc
- InvaderEnemyShooter.cc
- InvaderWeapon.cc
- InvaderWeaponEnemy.cc
- InvaderHUDinfo.cc
-END_BUILD_UNIT
-)
-
-ORXONOX_ADD_LIBRARY(Invader
- MODULE
- FIND_HEADER_FILES
- LINK_LIBRARIES
- orxonox
- overlays
- weapons
- SOURCE_FILES ${Invader_SRC_FILES}
-)
Copied: code/branches/presentationHS13/src/modules/invader/CMakeLists.txt (from rev 9896, code/branches/invaders/src/modules/invader/CMakeLists.txt)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/CMakeLists.txt (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/CMakeLists.txt 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,22 @@
+SET_SOURCE_FILES(Invader_SRC_FILES
+BUILD_UNIT InvaderBuildUnit.cc
+ Invader.cc
+ InvaderCenterPoint.cc
+ InvaderShip.cc
+ InvaderEnemy.cc
+ InvaderEnemyShooter.cc
+ InvaderWeapon.cc
+ InvaderWeaponEnemy.cc
+ InvaderHUDinfo.cc
+END_BUILD_UNIT
+)
+
+ORXONOX_ADD_LIBRARY(Invader
+ MODULE
+ FIND_HEADER_FILES
+ LINK_LIBRARIES
+ orxonox
+ overlays
+ weapons
+ SOURCE_FILES ${Invader_SRC_FILES}
+)
Deleted: code/branches/presentationHS13/src/modules/invader/Invader.cc
===================================================================
--- code/branches/invaders/src/modules/invader/Invader.cc 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/Invader.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -1,186 +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->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 * 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;
- srand(player->getPosition().x + player->getPosition().y);
- for (int i = 0; i < (3*log10(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 + 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/presentationHS13/src/modules/invader/Invader.cc (from rev 9896, code/branches/invaders/src/modules/invader/Invader.cc)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/Invader.cc (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/Invader.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,186 @@
+/*
+ * 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->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 * 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;
+ srand(player->getPosition().x + player->getPosition().y);
+ for (int i = 0; i < (3*log10(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 + 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/presentationHS13/src/modules/invader/Invader.h
===================================================================
--- code/branches/invaders/src/modules/invader/Invader.h 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/Invader.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -1,93 +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();
-
- 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/presentationHS13/src/modules/invader/Invader.h (from rev 9896, code/branches/invaders/src/modules/invader/Invader.h)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/Invader.h (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/Invader.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -0,0 +1,93 @@
+/*
+ * 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();
+
+ 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/presentationHS13/src/modules/invader/InvaderCenterPoint.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderCenterPoint.cc 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderCenterPoint.cc (from rev 9896, code/branches/invaders/src/modules/invader/InvaderCenterPoint.cc)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.cc (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderCenterPoint.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderCenterPoint.h 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderCenterPoint.h (from rev 9896, code/branches/invaders/src/modules/invader/InvaderCenterPoint.h)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.h (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderCenterPoint.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderEnemy.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderEnemy.cc 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderEnemy.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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.01, 2) + 1) * (player->getPosition().z - getPosition().z);
- setVelocity(Vector3(1000 - 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/presentationHS13/src/modules/invader/InvaderEnemy.cc (from rev 9896, code/branches/invaders/src/modules/invader/InvaderEnemy.cc)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderEnemy.cc (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderEnemy.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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.01, 2) + 1) * (player->getPosition().z - getPosition().z);
+ setVelocity(Vector3(1000 - 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/presentationHS13/src/modules/invader/InvaderEnemy.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderEnemy.h 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderEnemy.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderEnemy.h (from rev 9896, code/branches/invaders/src/modules/invader/InvaderEnemy.h)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderEnemy.h (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderEnemy.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderEnemyShooter.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderEnemyShooter.cc 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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.01, 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/presentationHS13/src/modules/invader/InvaderEnemyShooter.cc (from rev 9896, code/branches/invaders/src/modules/invader/InvaderEnemyShooter.cc)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.cc (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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.01, 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/presentationHS13/src/modules/invader/InvaderEnemyShooter.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderEnemyShooter.h 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderEnemyShooter.h (from rev 9896, code/branches/invaders/src/modules/invader/InvaderEnemyShooter.h)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.h (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderEnemyShooter.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderHUDinfo.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderHUDinfo.cc 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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.01 + 0.04);
- }
- }
- }
-
- 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/presentationHS13/src/modules/invader/InvaderHUDinfo.cc (from rev 9896, code/branches/invaders/src/modules/invader/InvaderHUDinfo.cc)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.cc (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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.01 + 0.04);
+ }
+ }
+ }
+
+ 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/presentationHS13/src/modules/invader/InvaderHUDinfo.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderHUDinfo.h 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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 "overlays/OverlaysPrereqs.h"
-
-#include "tools/interfaces/Tickable.h"
-#include "overlays/OverlayText.h"
-
-namespace orxonox
-{
- class _OverlaysExport 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/presentationHS13/src/modules/invader/InvaderHUDinfo.h (from rev 9896, code/branches/invaders/src/modules/invader/InvaderHUDinfo.h)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.h (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderHUDinfo.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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 "overlays/OverlaysPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+ class _OverlaysExport 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/presentationHS13/src/modules/invader/InvaderPrereqs.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderPrereqs.h 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderPrereqs.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderPrereqs.h (from rev 9896, code/branches/invaders/src/modules/invader/InvaderPrereqs.h)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderPrereqs.h (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderPrereqs.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderShip.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderShip.cc 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderShip.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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
- 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/presentationHS13/src/modules/invader/InvaderShip.cc (from rev 9896, code/branches/invaders/src/modules/invader/InvaderShip.cc)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderShip.cc (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderShip.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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
+ 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/presentationHS13/src/modules/invader/InvaderShip.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderShip.h 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderShip.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderShip.h (from rev 9896, code/branches/invaders/src/modules/invader/InvaderShip.h)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderShip.h (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderShip.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderWeapon.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderWeapon.cc 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderWeapon.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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.5),0,sqrt(0.5),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/presentationHS13/src/modules/invader/InvaderWeapon.cc (from rev 9896, code/branches/invaders/src/modules/invader/InvaderWeapon.cc)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderWeapon.cc (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderWeapon.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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.5),0,sqrt(0.5),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/presentationHS13/src/modules/invader/InvaderWeapon.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderWeapon.h 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderWeapon.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderWeapon.h (from rev 9896, code/branches/invaders/src/modules/invader/InvaderWeapon.h)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderWeapon.h (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderWeapon.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderWeaponEnemy.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderWeaponEnemy.cc 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderWeaponEnemy.cc (from rev 9896, code/branches/invaders/src/modules/invader/InvaderWeaponEnemy.cc)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.cc (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderWeaponEnemy.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderWeaponEnemy.h 2013-12-15 15:03:05 UTC (rev 9896)
+++ code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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/presentationHS13/src/modules/invader/InvaderWeaponEnemy.h (from rev 9896, code/branches/invaders/src/modules/invader/InvaderWeaponEnemy.h)
===================================================================
--- code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.h (rev 0)
+++ code/branches/presentationHS13/src/modules/invader/InvaderWeaponEnemy.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -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__ */
Modified: code/branches/presentationHS13/src/modules/weapons/weaponmodes/HsW01.h
===================================================================
--- code/branches/presentationHS13/src/modules/weapons/weaponmodes/HsW01.h 2013-12-16 12:29:30 UTC (rev 9899)
+++ code/branches/presentationHS13/src/modules/weapons/weaponmodes/HsW01.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -58,7 +58,7 @@
virtual void fire();
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- private:
+ protected:
/**
@brief Set the mesh.
@param mesh The mesh name.
@@ -108,7 +108,7 @@
float getDelay() const
{ return this->delay_; }
- void shot();
+ virtual void shot();
void muzzleflash();
std::string material_; //!< The material.
Modified: code/branches/presentationHS13/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/gametypes/Gametype.cc 2013-12-16 12:29:30 UTC (rev 9899)
+++ code/branches/presentationHS13/src/orxonox/gametypes/Gametype.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -170,7 +170,6 @@
entity->setPosition(oldentity->getWorldPosition());
entity->setOrientation(oldentity->getWorldOrientation());
}
-
it->first->startControl(entity);
}
else
Modified: code/branches/presentationHS13/src/orxonox/graphics/ParticleEmitter.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/graphics/ParticleEmitter.cc 2013-12-16 12:29:30 UTC (rev 9899)
+++ code/branches/presentationHS13/src/orxonox/graphics/ParticleEmitter.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -44,7 +44,7 @@
{
RegisterClass(ParticleEmitter);
- ParticleEmitter::ParticleEmitter(Context* context) : StaticEntity(context)
+ ParticleEmitter::ParticleEmitter(Context* context) : MovableEntity(context)
{
RegisterObject(ParticleEmitter);
Modified: code/branches/presentationHS13/src/orxonox/graphics/ParticleEmitter.h
===================================================================
--- code/branches/presentationHS13/src/orxonox/graphics/ParticleEmitter.h 2013-12-16 12:29:30 UTC (rev 9899)
+++ code/branches/presentationHS13/src/orxonox/graphics/ParticleEmitter.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -32,11 +32,11 @@
#include "OrxonoxPrereqs.h"
#include <string>
-#include "worldentities/StaticEntity.h"
+#include "worldentities/MovableEntity.h"
namespace orxonox
{
- class _OrxonoxExport ParticleEmitter : public StaticEntity
+ class _OrxonoxExport ParticleEmitter : public MovableEntity
{
public:
ParticleEmitter(Context* context);
Modified: code/branches/presentationHS13/src/orxonox/worldentities/BigExplosion.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/worldentities/BigExplosion.cc 2013-12-16 12:29:30 UTC (rev 9899)
+++ code/branches/presentationHS13/src/orxonox/worldentities/BigExplosion.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -42,7 +42,7 @@
{
RegisterClass(BigExplosion);
- BigExplosion::BigExplosion(Context* context) : StaticEntity(context)
+ BigExplosion::BigExplosion(Context* context) : MobileEntity(context)
{
RegisterObject(BigExplosion);
@@ -77,6 +77,42 @@
this->registerVariables();
}
+ BigExplosion::BigExplosion(Context* context, Vector3 initVelocity) : MobileEntity(context)
+ {
+ RegisterObject(BigExplosion);
+ this->setVelocity(initVelocity);
+
+ if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
+ ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
+
+ this->bStop_ = false;
+ this->LOD_ = LODParticle::Normal;
+
+ if ( GameMode::showsGraphics() )
+ {
+ try
+ {
+ this->init();
+ }
+ catch (const std::exception& ex)
+ {
+ orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl;
+ this->initZero();
+ }
+ }
+ else
+ {
+ this->initZero();
+ }
+
+ if (GameMode::isMaster())
+ {
+ this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
+ }
+
+ this->registerVariables();
+ }
+
void BigExplosion::init()
{
this->debrisEntity1_ = new MovableEntity(this->getContext());
@@ -99,7 +135,7 @@
this->debris3_->setSyncMode(0);
this->debris4_->setSyncMode(0);
- this->explosion_ = new StaticEntity(this->getContext());
+ this->explosion_ = new MobileEntity(this->getContext());
this->explosion_->setSyncMode(0);
this->debrisSmoke1_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/smoke7", this->LOD_);
@@ -147,13 +183,19 @@
this->debrisEntity3_->attach(debris3_);
this->debrisEntity4_->attach(debris4_);
+ // ///////////////////////
+ // TODO: particleSpawner is a static entity. It should probably be dynamic, for better explosions.
+ //
ParticleSpawner* effect = new ParticleSpawner(this->getContext());
+ orxout() << "vel " << this->getVelocity() << endl;
+ // effect->setVelocity(this->getVelocity());
effect->setDestroyAfterLife(true);
effect->setSource("Orxonox/explosion2b");
effect->setLifetime(4.0f);
effect->setSyncMode(0);
ParticleSpawner* effect2 = new ParticleSpawner(this->getContext());
+ // effect2->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10, 200));
effect2->setDestroyAfterLife(true);
effect2->setSource("Orxonox/smoke6");
effect2->setLifetime(4.0f);
Modified: code/branches/presentationHS13/src/orxonox/worldentities/BigExplosion.h
===================================================================
--- code/branches/presentationHS13/src/orxonox/worldentities/BigExplosion.h 2013-12-16 12:29:30 UTC (rev 9899)
+++ code/branches/presentationHS13/src/orxonox/worldentities/BigExplosion.h 2013-12-16 12:33:09 UTC (rev 9900)
@@ -21,7 +21,7 @@
*
* Author:
* Benjamin de Capitani
- * Co-authors:
+ * Co-authors:ยง
* ...
*
*/
@@ -32,14 +32,15 @@
#include "OrxonoxPrereqs.h"
#include "tools/Timer.h"
-#include "StaticEntity.h"
+#include "MobileEntity.h"
namespace orxonox
{
- class _OrxonoxExport BigExplosion : public StaticEntity
+ class _OrxonoxExport BigExplosion : public MobileEntity
{
public:
BigExplosion(Context* context);
+ BigExplosion(Context* context, Vector3 initVelocity);
virtual ~BigExplosion();
inline void setLOD(LODParticle::Value level)
@@ -59,7 +60,7 @@
bool bStop_;
- StaticEntity* explosion_;
+ MobileEntity* explosion_;
MovableEntity* debrisEntity1_;
MovableEntity* debrisEntity2_;
Modified: code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.cc 2013-12-16 12:29:30 UTC (rev 9899)
+++ code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.cc 2013-12-16 12:33:09 UTC (rev 9900)
@@ -364,8 +364,10 @@
this->bAlive_ = false;
this->setDestroyWhenPlayerLeft(false);
- BigExplosion* chunk = new BigExplosion(this->getContext());
+ orxout() << "big explosion: " << this->getVelocity() << endl;
+ BigExplosion* chunk = new BigExplosion(this->getContext(), this->getVelocity());
chunk->setPosition(this->getPosition());
+ // chunk->setVelocity(this->getVelocity());
}
void Pawn::deatheffect()
@@ -375,6 +377,7 @@
ParticleSpawner* effect = new ParticleSpawner(this->getContext());
effect->setPosition(this->getPosition());
effect->setOrientation(this->getOrientation());
+ effect->setVelocity(this->getVelocity());
effect->setDestroyAfterLife(true);
effect->setSource("Orxonox/explosion2b");
effect->setLifetime(4.0f);
@@ -383,6 +386,7 @@
ParticleSpawner* effect = new ParticleSpawner(this->getContext());
effect->setPosition(this->getPosition());
effect->setOrientation(this->getOrientation());
+ effect->setVelocity(this->getVelocity());
effect->setDestroyAfterLife(true);
effect->setSource("Orxonox/smoke6");
effect->setLifetime(4.0f);
@@ -391,6 +395,7 @@
ParticleSpawner* effect = new ParticleSpawner(this->getContext());
effect->setPosition(this->getPosition());
effect->setOrientation(this->getOrientation());
+ effect->setVelocity(this->getVelocity());
effect->setDestroyAfterLife(true);
effect->setSource("Orxonox/sparks");
effect->setLifetime(4.0f);
More information about the Orxonox-commit
mailing list