[Orxonox-commit 6972] r11593 - in code/branches/Asteroid_HS17: . data/levels data/levels/templates data/tcl src/modules src/modules/asteroids2D src/modules/minigametest
vyang at orxonox.net
vyang at orxonox.net
Mon Nov 27 14:00:37 CET 2017
Author: vyang
Date: 2017-11-27 14:00:29 +0100 (Mon, 27 Nov 2017)
New Revision: 11593
Added:
code/branches/Asteroid_HS17/data/levels/Asteroids2D.oxw
code/branches/Asteroid_HS17/data/levels/MiniGameTest.oxw
code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt
code/branches/Asteroid_HS17/data/levels/templates/spaceshipMiniGameTest.oxt
code/branches/Asteroid_HS17/data/tcl/core
code/branches/Asteroid_HS17/src/modules/asteroids2D/
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.cc
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.h
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.cc
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.h
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.cc
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.h
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.cc
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.h
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DPrereqs.h
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h
code/branches/Asteroid_HS17/src/modules/asteroids2D/CMakeLists.txt
code/branches/Asteroid_HS17/src/modules/minigametest/
code/branches/Asteroid_HS17/src/modules/minigametest/CMakeLists.txt
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTest.cc
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTest.h
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCenterPoint.cc
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCenterPoint.h
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCube.cc
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCube.h
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestHUDinfo.cc
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestHUDinfo.h
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestPrereqs.h
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestShip.cc
code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestShip.h
code/branches/Asteroid_HS17/svn-commit.tmp
Removed:
code/branches/Asteroid_HS17/data/levels/Asteroids.oxw
code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids.oxt
code/branches/Asteroid_HS17/src/modules/asteroids/
Modified:
code/branches/Asteroid_HS17/src/modules/CMakeLists.txt
Log:
MiniGameTest Minigame erstellt -> Kopie von DodgeRace, Namen von Asteroid zu Asteroid 2D geaendert, da schon eine Klasse mit dem selben Namen existiert
Deleted: code/branches/Asteroid_HS17/data/levels/Asteroids.oxw
===================================================================
--- code/branches/Asteroid_HS17/data/levels/Asteroids.oxw 2017-11-27 12:41:13 UTC (rev 11592)
+++ code/branches/Asteroid_HS17/data/levels/Asteroids.oxw 2017-11-27 13:00:29 UTC (rev 11593)
@@ -1,61 +0,0 @@
-<LevelInfo
- name = "Asteroids"
- description = "Try to prevent asteroids from colliding into your spaceshuttle. Be prepared to dodge all asteroids or destroy them."
- tags = "minigame"
- screenshot = "emptylevel.png"
-/>
-
-
-<!--wird immer gebraucht-->
-<?lua
- include("stats.oxo")
- include("templates/lodInformation.oxt")
-?>
-
-
-<?lua
- include("templates/spaceshipAsteroids.oxt")
-?>
-
-<!--Templates schreiben oder von spaceship kopieren-->
-
-<Level
- plugin = asteroids
- gametype = Asteroids
->
- <templates>
- <Template link=lodtemplate_default />
- </templates>
- <?lua include("includes/notifications.oxi") ?>
-
- <!-- ambientlight = "0.8, 0.8, 0.8"
- skybox = "Orxonox/Starbox"
- WorldRange lieber im src einschraenken-->
- <Scene
- ambientlight = "0.8, 0.7, 0.4"
- skybox = "Orxonox/skyBoxBasic"
- negativeWorldRange = "-100000, -100000, -100000"
- positiveWorldRange = " 100000, 100000, 100000"
- >
-
- <WorldAmbientSound
- source="Earth.ogg"
- looping="true"
- playOnLoad="true"
- />
-
- <!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> -->
- <Light type=directional position="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="0,0,0" lookat="0,0,0" spawnclass=AsteroidsShip pawndesign=spaceshipasteroids/>
-
- <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=10 stayActive="true" delay=0 />
-
- <AsteroidsCenterPoint name=asteroidscenter />
-
- <Model mesh="axes.mesh" scale=10 position="0,0,-100" />
-
-
- </Scene>
-</Level>
-
Added: code/branches/Asteroid_HS17/data/levels/Asteroids2D.oxw
===================================================================
--- code/branches/Asteroid_HS17/data/levels/Asteroids2D.oxw (rev 0)
+++ code/branches/Asteroid_HS17/data/levels/Asteroids2D.oxw 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,53 @@
+<LevelInfo
+ name = "Asteroids2D"
+ description = "Try to prevent asteroids from colliding into your spaceshuttle. Be prepared to dodge all asteroids or destroy them."
+ tags = "minigame"
+ screenshot = "emptylevel.png"
+/>
+
+
+<!--wird immer gebraucht-->
+<?lua
+ include("stats.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+
+<?lua
+ include ("overlays/HUDTemplates3.oxo")
+ include("templates/spaceshipAsteroids2D.oxt")
+?>
+
+<!--Templates schreiben oder von spaceship kopieren-->
+
+<Level
+ plugin = asteroids2D
+ gametype = Asteroids2D
+>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <!-- ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ WorldRange lieber im src einschraenken-->
+ <Scene
+ ambientlight = "0.8, 0.7, 0.4"
+ skybox = "Orxonox/skyBoxBasic"
+ >
+
+ <!-- <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="0,0,0" lookat="0,0,0" spawnclass=Asteroids2DShip pawndesign=spaceshipasteroids2D/>
+
+ <Asteroids2DCenterPoint name=asteroids2Dcenter />
+
+ <Model mesh="axes.mesh" scale=10 position="0,0,-100" />
+
+
+ </Scene>
+</Level>
+
+
Added: code/branches/Asteroid_HS17/data/levels/MiniGameTest.oxw
===================================================================
--- code/branches/Asteroid_HS17/data/levels/MiniGameTest.oxw (rev 0)
+++ code/branches/Asteroid_HS17/data/levels/MiniGameTest.oxw 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,67 @@
+<LevelInfo
+ name = "MiniGameTest"
+ description = "Try to come as far as possible"
+ tags = "minigame"
+ screenshot = "DodgeRace.png"
+/>
+<?lua
+ include("stats.oxo")
+ include("templates/lodInformation.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipMiniGameTest.oxt")
+ include("templates/enemyInvader.oxt")
+ include("templates/DodgeRacePattern.oxt")
+ include("overlays/DodgeRaceHUD.oxo")
+?>
+
+<Level
+ plugins = minigametest
+ gametype = MiniGameTest
+>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <Scene
+ ambientlight = "1.0, 1.0, 1.0"
+ skybox = "Orxonox/skyBoxClouds"
+ negativeWorldRange = "-100000, -100000, -100000"
+ positiveWorldRange = " 100000, 100000, 100000"
+ >
+
+ <WorldAmbientSound
+ source="Earth.ogg"
+ looping="true"
+ playOnLoad="true"
+ />
+
+ <!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> -->
+ <Light type=directional position="-100, 10000, -700" lookat="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
+ <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass= MiniGameTestShip pawndesign=spaceshipdodgerace />
+
+ <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=10 stayActive="true" delay=0 />
+
+
+ <MiniGameTestCenterPoint name=invadercenter />
+
+ <StaticEntity position="0,-50,0" direction="0,0,0" scale="1" collisionType=static mass=1 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="plane.mesh" scale3D="100000,0,100000" />
+ </attached>
+
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="1,1,1" />
+ </collisionShapes>
+
+ </StaticEntity>
+
+
+
+ </Scene>
+</Level>
+
Deleted: code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids.oxt
===================================================================
--- code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids.oxt 2017-11-27 12:41:13 UTC (rev 11592)
+++ code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids.oxt 2017-11-27 13:00:29 UTC (rev 11593)
@@ -1,129 +0,0 @@
-<Template name=spaceshipasteroids>
- <SpaceShip
- hudtemplate = spaceshiphud
- camerapositiontemplate = spaceshipescortcameras
- spawnparticlesource = "Orxonox/fairytwirl"
- spawnparticleduration = 3
- explosionchunks = 10
-
- health = 80
- maxhealth = 200
- initialhealth = 80
-
- shieldhealth = 35
- initialshieldhealth = 35
- maxshieldhealth = 60
- shieldabsorption = 0.9
- shieldrechargerate = 1
- shieldrechargewaittime = 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 = 80
- linearDamping = 0.7
- angularDamping = 0.9999999
- >
- <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=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>
- <explosion>
- <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
- <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
- <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
-
- <ExplosionPart mesh="explosionparts/escort_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
- <ExplosionPart mesh="explosionparts/escort_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
- <ExplosionPart mesh="explosionparts/escort_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
- <ExplosionPart mesh="explosionparts/escort_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
- <ExplosionPart mesh="explosionparts/escort_part_5.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
- <ExplosionPart mesh="explosionparts/escort_part_6.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
- </explosion>
-<?lua
- include("../includes/weaponSettingsEscort.oxi")
-?>
- </SpaceShip>
-</Template>
-
-<Template name=spaceshipescortcameras defaults=0>
- <SpaceShip>
- <camerapositions>
- <CameraPosition position="0,300,0" pitch=-90 absolute=true />
- <CameraPosition position="0,50,160" drag=true mouselook=true />
- <CameraPosition position="0,40,125" drag=true mouselook=true />
- <CameraPosition position="0,30, 90" drag=true mouselook=true />
- </camerapositions>
- </SpaceShip>
-</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/>
- />
- <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=150 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
- <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=15 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
- </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, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=5 length=1500 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
- <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=1 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>
Added: code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt
===================================================================
--- code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt (rev 0)
+++ code/branches/Asteroid_HS17/data/levels/templates/spaceshipAsteroids2D.oxt 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,129 @@
+<Template name=spaceshipasteroids2D>
+ <SpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipescortcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 10
+
+ health = 80
+ maxhealth = 200
+ initialhealth = 80
+
+ shieldhealth = 35
+ initialshieldhealth = 35
+ maxshieldhealth = 60
+ shieldabsorption = 0.9
+ shieldrechargerate = 1
+ shieldrechargewaittime = 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 = 80
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+ >
+ <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=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>
+ <explosion>
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+
+ <ExplosionPart mesh="explosionparts/escort_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_5.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="explosionparts/escort_part_6.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ </explosion>
+<?lua
+ include("../includes/weaponSettingsEscort.oxi")
+?>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipescortcameras defaults=0>
+ <SpaceShip>
+ <camerapositions>
+ <CameraPosition position="0,600,0" pitch=-90 absolute=true />
+ <CameraPosition position="0,50,160" drag=true mouselook=false />
+ <CameraPosition position="0,40,125" drag=true mouselook=false/>
+ <CameraPosition position="0,30, 90" drag=true mouselook=false/>
+ </camerapositions>
+ </SpaceShip>
+</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/>
+ />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=150 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 0.5, 0.65, 1.0" width=15 length=15 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=2 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </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, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=5 length=1500 lifetime=2 elements=1 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, -2, 14" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=1 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>
Added: code/branches/Asteroid_HS17/data/levels/templates/spaceshipMiniGameTest.oxt
===================================================================
--- code/branches/Asteroid_HS17/data/levels/templates/spaceshipMiniGameTest.oxt (rev 0)
+++ code/branches/Asteroid_HS17/data/levels/templates/spaceshipMiniGameTest.oxt 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,128 @@
+<Template name=spaceshipdodgerace>
+ <MiniGameTestShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipescortcameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 3
+ explosionchunks = 4
+
+ health = 40
+ maxhealth = 40
+ initialhealth = 40
+
+ shieldhealth = 20
+ initialshieldhealth = 20
+ maxshieldhealth = 20
+ shieldabsorption = 0.1
+ shieldrechargerate = 1
+ shieldrechargewaittime = 1
+
+ primaryThrust = 150
+ auxilaryThrust = 30
+ rotationThrust = 50
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 20
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ shakeFrequency = 15
+ shakeAmplitude = 6
+
+ collisionType = "dynamic"
+ mass = 4200000
+ linearDamping = 0.9999999
+ angularDamping = 0.9999999
+
+ collisiondamage = 100
+ enablecollisiondamage = true
+
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipinvaderengine />
+ <MultiStateEngine position="-7.6, 0, 0" template=spaceshipinvaderengine />
+ </engines>
+ <attached>
+ <Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=4 mesh="escortShip.mesh" />
+ <Model position="0,0,0" yaw=180 pitch=90 roll=0 scale=4 mesh="escortWeapon.mesh" />
+<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
+<Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="-12.6,-2,3" scale3D="2.8,2.8,11" />
+<Model mesh="cube.mesh" mass=10 position="0,0,-12" scale3D="4,4,7" /-->
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0 ,0 , 3" halfExtents="10, 4,8" />
+ <BoxCollisionShape position="12.6 ,-2, 3" halfExtents="2.8,2.8,11"/>
+ <BoxCollisionShape position="-12.6,-2, 3" halfExtents="2.8,2.8,11"/>
+ <BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" />
+ </collisionShapes>
+ <explosion >
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="Orxonox/explosion2b" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ </explosion>
+<?lua
+ include("../includes/invaderWeapon.oxi")
+?>
+ </MiniGameTestShip>
+</Template>
+
+<Template name=spaceshipescortcameras defaults=0>
+ <MiniGameTestShip>
+ <camerapositions>
+ <CameraPosition position="0,100,180" direction="0, -0.2, -1" drag=false mouselook=true />
+ <CameraPosition position="0,200,250" direction="0, -0.4, -1" drag=false mouselook=true />
+ <CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true />
+ <CameraPosition position="0,1300,-100" direction="0, -1, 0" drag=false mouselook=true />
+ </camerapositions>
+ </MiniGameTestShip>
+</Template>
+
+<Template name=spaceshipinvaderengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2.2
+
+ speedfront = 200
+ speedback = 70
+ speedleftright = 70
+ speedupdown = 70
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+
+ accelerationfront = 700
+ accelerationbrake = 700
+ accelerationback = 125
+ accelerationleftright = 125
+ accelerationupdown = 125
+ >
+ <EffectContainer condition="idle">
+ <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
+ </EffectContainer>
+ <EffectContainer condition="not idle">
+ <FadingBillboard mainstate=activity active=false scale=0.09 position="12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.09 position="-12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ </EffectContainer>
+ <EffectContainer condition="normal or brake">
+
+ </EffectContainer>
+ <EffectContainer condition="normal or boost">
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ </EffectContainer>
+ <EffectContainer condition="boost">
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ </EffectContainer>
+
+ </MultiStateEngine>
+</Template>
\ No newline at end of file
Added: code/branches/Asteroid_HS17/data/tcl/core
===================================================================
(Binary files differ)
Index: code/branches/Asteroid_HS17/data/tcl/core
===================================================================
--- code/branches/Asteroid_HS17/data/tcl/core 2017-11-27 12:41:13 UTC (rev 11592)
+++ code/branches/Asteroid_HS17/data/tcl/core 2017-11-27 13:00:29 UTC (rev 11593)
Property changes on: code/branches/Asteroid_HS17/data/tcl/core
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: code/branches/Asteroid_HS17/src/modules/CMakeLists.txt
===================================================================
--- code/branches/Asteroid_HS17/src/modules/CMakeLists.txt 2017-11-27 12:41:13 UTC (rev 11592)
+++ code/branches/Asteroid_HS17/src/modules/CMakeLists.txt 2017-11-27 13:00:29 UTC (rev 11593)
@@ -45,3 +45,4 @@
ADD_SUBDIRECTORY(dodgerace)
ADD_SUBDIRECTORY(hover)
ADD_SUBDIRECTORY(superorxobros)
+ADD_SUBDIRECTORY(minigametest)
\ No newline at end of file
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,94 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file Asteroids2D.cc
+ @brief Implementation of the Asteroids2D class.
+*/
+
+#include "Asteroids2D.h"
+#include "Asteroids2DShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
+#include "core/CoreIncludes.h"
+
+
+namespace orxonox
+{
+ RegisterUnloadableClass(Asteroids2D);
+
+ Asteroids2D::Asteroids2D(Context* context) : Deathmatch(context)
+ {
+ RegisterObject(Asteroids2D);
+ this->bEndGame = false;
+
+ }
+
+ void Asteroids2D::tick(float dt)
+ {
+
+ SUPER(Asteroids2D, tick, dt);
+ }
+
+ Asteroids2DShip* Asteroids2D::getPlayer()
+ {
+ if (player == nullptr)
+ {
+ for (Asteroids2DShip* ship : ObjectList<Asteroids2DShip>())
+ {
+ player = ship;
+ }
+ }
+ return player;
+ }
+
+ void Asteroids2D::start()
+ {
+ orxout() << "start" << endl;
+
+ // Set variable to temporarily force the player to spawn.
+ this->bForceSpawn_ = false;
+
+ if (this->center_ == nullptr) // abandon mission!
+ {
+ orxout(internal_error) << "Asteroids2D: No Centerpoint specified." << endl;
+ GSLevel::startMainMenu();
+ return;
+ }
+ // Call start for the parent class.
+ Deathmatch::start();
+ }
+
+ void Asteroids2D::end()
+ {
+ // DON'T CALL THIS!
+ // Deathmatch::end();
+ // It will misteriously crash the game!
+ // Instead startMainMenu, this won't crash.
+ orxout() << "Asteroids2D Game has ended" << endl;
+ GSLevel::startMainMenu();
+ }
+}
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2D.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,112 @@
+/*
+ * 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 Asteroids2D.h
+ @brief Gametype.
+ @ingroup Asteroids2D
+*/
+
+#ifndef _Asteroids2D_H__
+#define _Asteroids2D_H__
+
+#include "asteroids2D/Asteroids2DPrereqs.h"
+
+#include "Asteroids2DCenterPoint.h" // Necessary for WeakPointer??
+//#include "Asteroids2DShip.h" DO NOT include in Header. Will cause forward declaration issues
+
+//#include "Asteroids2DHUDinfo.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 "core/command/ConsoleCommand.h"
+
+#include "gametypes/Deathmatch.h"
+
+namespace orxonox
+{
+
+ class _Asteroids2DExport Asteroids2D : public Deathmatch
+ {
+ public:
+ Asteroids2D(Context* context);
+
+ virtual void start() override;
+ virtual void end() override;
+ virtual void tick(float dt) override;
+
+ void setCenterpoint(Asteroids2DCenterPoint* center)
+ { this->center_ = center; }
+
+ virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
+ bool bEndGame;
+
+ private:
+
+
+ Asteroids2DShip* getPlayer();
+ WeakPtr<Asteroids2DShip> player;
+ WeakPtr<Asteroids2DCenterPoint> center_;
+
+
+ /*
+
+ //void spawnEnemy();
+
+
+
+
+
+
+
+
+
+
+
+
+ private:
+
+
+
+
+ //Context* context;
+ */
+ };
+}
+
+#endif /* _Asteroids2D_H__ */
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,59 @@
+/*
+ * 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 Asteroids2DCenterPoint.cc
+ @brief Implementation of the Asteroids2DCenterPoint class.
+*/
+
+#include "Asteroids2DCenterPoint.h"
+
+#include "core/CoreIncludes.h"
+
+#include "Asteroids2D.h"
+
+namespace orxonox
+{
+ RegisterClass(Asteroids2DCenterPoint);
+
+ Asteroids2DCenterPoint::Asteroids2DCenterPoint(Context* context) : StaticEntity(context)
+ {
+ RegisterObject(Asteroids2DCenterPoint);
+
+ this->checkGametype();
+ }
+
+ void Asteroids2DCenterPoint::checkGametype()
+ {
+ if (this->getGametype() != nullptr && this->getGametype()->isA(Class(Asteroids2D)))
+ {
+ Asteroids2D* Asteroids2DGametype = orxonox_cast<Asteroids2D*>(this->getGametype());
+ Asteroids2DGametype->setCenterpoint(this);
+ }
+ }
+}
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCenterPoint.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -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 Asteroids2DCenterPoint.h
+ @brief Declaration of the Asteroids2DCenterPoint class.
+ @ingroup Asteroids2D
+*/
+
+#ifndef _Asteroids2DCenterPoint_H__
+#define _Asteroids2DCenterPoint_H__
+
+#include "asteroids2D/Asteroids2DPrereqs.h"
+
+//#include "Asteroids2D.h"
+//#include "Asteroids2DHUDinfo.h"
+
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+ class _Asteroids2DExport Asteroids2DCenterPoint : public StaticEntity
+ {
+ public:
+ Asteroids2DCenterPoint(Context* context); //checks whether the gametype is actually Asteroids2D.
+
+ private:
+ void checkGametype();
+
+ };
+}
+
+#endif /* _Asteroids2DCenterPoint_H__ */
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,47 @@
+/* ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Samuel Riedel
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file Asteroids2D.cc
+ @brief Implementation of the Asteroids2D class.
+*/
+
+#include "Asteroids2DCube.h"
+#include "Asteroids2D.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+ RegisterClass(Asteroids2DCube);
+
+ Asteroids2DCube::Asteroids2DCube(Context* context) : MovableEntity(context)
+ {
+ RegisterObject(Asteroids2DCube);
+ }
+
+
+}
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DCube.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,54 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Samuel Riedel
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file Asteroids2D.h
+ @brief Gametype.
+ @ingroup Asteroids2D
+*/
+
+#ifndef _Asteroids2DCube_H__
+#define _Asteroids2DCube_H__
+
+#include "asteroids2D/Asteroids2DPrereqs.h"
+
+#include "worldentities/MovableEntity.h"
+
+
+namespace orxonox
+{
+ class _Asteroids2DExport Asteroids2DCube : public MovableEntity
+ {
+ public:
+ Asteroids2DCube(Context* context);
+
+ private:
+ };
+}
+
+#endif /* _Asteroids2DCube_H__ */
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,91 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ *
+ */
+
+#include "DodgeRaceHUDinfo.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+//#include "DodgeRace.h"
+
+namespace orxonox
+{
+ RegisterClass(DodgeRaceHUDinfo);
+
+ DodgeRaceHUDinfo::DodgeRaceHUDinfo(Context* context) : OverlayText(context)
+ {
+ RegisterObject(DodgeRaceHUDinfo);
+
+ this->DodgeRaceGame = nullptr;
+ this->bShowPoints_ = true;
+ }
+
+ void DodgeRaceHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(DodgeRaceHUDinfo, XMLPort, xmlelement, mode);
+
+ XMLPortParam(DodgeRaceHUDinfo,"showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);
+ }
+
+ void DodgeRaceHUDinfo::tick(float dt)
+ {
+ SUPER(DodgeRaceHUDinfo, tick, dt);
+
+
+ if(this->bShowPoints_)
+ {
+ const std::string& points = multi_cast<std::string>(this->DodgeRaceGame->getPoints());
+ if (this->DodgeRaceGame->lives <= 0)
+ {
+ setTextSize(0.2);
+ setPosition(Vector2(0.1, 0.02));
+ this->setCaption("Final score:\n" + points);
+ this->setColour(ColourValue(1, 0, 0, 1));
+ }
+ else
+ {
+ setTextSize(0.04);
+ setPosition(Vector2(0.14, 0.02));
+ this->setColour(ColourValue(1, 1, 1, 1));
+ this->setCaption(points);
+ }
+ }
+ }
+
+ void DodgeRaceHUDinfo::changedOwner()
+ {
+ SUPER(DodgeRaceHUDinfo, changedOwner);
+
+ if (this->getOwner() && this->getOwner()->getGametype())
+ {
+ this->DodgeRaceGame = orxonox_cast<DodgeRace*>(this->getOwner()->getGametype());
+ }
+ else
+ {
+ this->DodgeRaceGame = nullptr;
+ }
+ }
+}
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,61 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ *
+ */
+
+#ifndef _Asteroids2DHUDinfo_H__
+#define _Asteroids2DHUDinfo_H__
+
+//#include "Asteroids2DShip.h"
+#include "Asteroids2D.h"
+//#include "Asteroids2DCenterPoint.h"
+
+#include "asteroids2D/Asteroids2DPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+ class _Asteroids2DExport Asteroids2DHUDinfo : public OverlayText, public Tickable
+ {
+ public:
+ Asteroids2DHUDinfo(Context* context);
+
+ virtual void tick(float dt) override;
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+ virtual void changedOwner() override;
+
+ inline void setShowPoints(bool value)
+ { this->bShowPoints_ = value; }
+ inline bool getShowPoints() const
+ { return this->bShowPoints_; }
+
+
+ private:
+ Asteroids2D* Asteroids2DGame;
+ bool bShowPoints_;
+ };
+}
+#endif /* _Asteroids2DHUDinfo_H__ */
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DPrereqs.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DPrereqs.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DPrereqs.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,81 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ at file
+ at brief
+ Shared library macros, enums, constants and forward declarations for the Asteroids2D module
+*/
+
+#ifndef _Asteroids2DPrereqs_H__
+#define _Asteroids2DPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ASTEROIDS2D_STATIC_BUILD)
+# ifdef ASTEROIDS2D_SHARED_BUILD
+# define _Asteroids2DExport __declspec(dllexport)
+# else
+# if defined( __MINGW32__ )
+# define _Asteroids2DExport
+# else
+# define _Asteroids2DExport __declspec(dllimport)
+# endif
+# endif
+# define _Asteroids2DPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
+# define _Asteroids2DExport __attribute__ ((visibility("default")))
+# define _Asteroids2DPrivate __attribute__ ((visibility("hidden")))
+#else
+# define _Asteroids2DExport
+# define _Asteroids2DPrivate
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+ class Asteroids2D;
+ class Asteroids2DCenterPoint;
+ class Asteroids2DShip;
+ class Asteroids2DCube;
+ //class Asteroids2DEnemy;
+ //class Asteroids2DEnemyShooter;
+ //class Asteroids2DWeapon;
+ //class Asteroids2DWeaponEnemy;
+ //class Asteroids2DHUDinfo;
+}
+
+#endif /* _Asteroids2DPrereqs_H__*/
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,144 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file Asteroids2DShip.cc
+ @brief Implementation of the Asteroids2DShip class.
+*/
+
+#include "Asteroids2DShip.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+ RegisterClass(Asteroids2DShip);
+
+ Asteroids2DShip::Asteroids2DShip(Context* context) : SpaceShip(context)
+ {
+ RegisterObject(Asteroids2DShip);
+
+ speed = 830;
+ isFireing = false;
+ damping = 10;
+
+ // not sure if has to be zero?
+ lastTimeFront = 0;
+ lastTimeLeft = 0;
+ lastTime = 0;
+ }
+
+ void Asteroids2DShip::tick(float dt)
+ {
+ Vector3 pos = getPosition();
+
+ //Movement calculation
+ lastTimeFront += dt * damping;
+ lastTimeLeft += dt * damping;
+ lastTime += dt;
+
+ velocity.x = interpolate(clamp(lastTimeLeft, 0.0f, 1.0f), desiredVelocity.x, 0.0f);
+ velocity.y = interpolate(clamp(lastTimeFront, 0.0f, 1.0f), desiredVelocity.y, 0.0f);
+
+ //Execute movement
+ if (this->hasLocalController())
+ {
+ float dist_y = velocity.y * dt;
+ //float dist_x = velocity.x * dt;
+ if(dist_y + posforeward > -42*3 && dist_y + posforeward < 42*6)
+ posforeward += dist_y;
+ else
+ {
+ velocity.y = 0;
+ // restart if game ended
+/*
+ if (getGame())
+ if (getGame()->bEndGame)
+ {
+ getGame()->start();
+ return;
+ }*/
+ }
+
+ pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
+ }
+
+ // bring back on track!
+ if(pos.y != 0)
+ {
+ pos.y = 0;
+ }
+
+ setPosition(pos);
+ setOrientation(Vector3::UNIT_Y, Degree(270));
+
+ SUPER(Asteroids2DShip, tick, dt);
+ }
+
+ void Asteroids2DShip::moveFrontBack(const Vector2& value)
+ {
+ //lastTimeFront = 0;
+ //desiredVelocity.y = value.y * speed * 42;
+
+ }
+
+ void Asteroids2DShip::moveRightLeft(const Vector2& value)
+ {
+ lastTimeLeft = 0;
+ desiredVelocity.x = value.x * speed;
+ }
+ void Asteroids2DShip::boost(bool bBoost)
+ {
+ //getGame()->bEndGame = bBoost;
+ }
+
+ inline bool Asteroids2DShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
+ {
+
+ removeHealth(100);
+ this->death();
+ return false;
+ }
+
+ Asteroids2D* Asteroids2DShip::getGame()
+ {
+ if (game == nullptr)
+ {
+ for (Asteroids2D* race : ObjectList<Asteroids2D>())
+ {
+ game = race;
+ }
+ }
+ return game;
+ }
+
+ void Asteroids2DShip::death()
+ {
+ //getGame()->costLife();
+ SpaceShip::death();
+ }
+}
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,91 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file Asteroids2DShip.h
+ @brief Declaration of the Asteroids2DShip class.
+*/
+
+#ifndef _Asteroids2DShip_H__
+#define _Asteroids2DShip_H__
+
+
+#include "asteroids2D/Asteroids2DPrereqs.h"
+
+#include "core/XMLPort.h"
+#include "worldentities/pawns/SpaceShip.h"
+#include "graphics/Camera.h"
+
+#include "Asteroids2D.h" // Is necessary for getGame function
+//#include "Asteroids2DCenterPoint.h"
+
+namespace orxonox
+{
+ class _Asteroids2DExport Asteroids2DShip : public SpaceShip
+ {
+ public:
+ Asteroids2DShip(Context* context);
+
+ virtual void tick(float dt) override;
+
+ // overwrite for 2d movement
+ virtual void moveFrontBack(const Vector2& value) override;
+ virtual void moveRightLeft(const Vector2& value) override;
+
+ // Starts or stops fireing
+ virtual void boost(bool bBoost) override;
+
+ //no rotation!
+ virtual void rotatePitch(const Vector2& value) override{};
+
+ //return to main menu if game has ended.
+ virtual void rotateRoll(const Vector2& value) override{if (getGame()) if (getGame()->bEndGame) getGame()->end();};
+
+ virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
+
+ float speed, damping, posforeward;
+ bool isFireing;
+
+ protected:
+ virtual void death() override;
+
+ private:
+ Asteroids2D* getGame();
+ WeakPtr<Asteroids2D> game;
+ WeakPtr<WorldEntity> lastEntity;
+ float lastTimeFront, lastTimeLeft, lastTime;
+ struct Velocity
+ {
+ float x;
+ float y;
+ } velocity, desiredVelocity;
+
+ };
+}
+
+#endif /* _Asteroids2DShip_H__ */
Added: code/branches/Asteroid_HS17/src/modules/asteroids2D/CMakeLists.txt
===================================================================
--- code/branches/Asteroid_HS17/src/modules/asteroids2D/CMakeLists.txt (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/asteroids2D/CMakeLists.txt 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,14 @@
+SET_SOURCE_FILES(Asteroids2D_SRC_FILES
+Asteroids2D.cc
+Asteroids2DCenterPoint.cc
+Asteroids2DShip.cc
+)
+
+ORXONOX_ADD_LIBRARY(asteroids2D
+ PLUGIN
+ FIND_HEADER_FILES
+ LINK_LIBRARIES
+ orxonox
+ overlays
+ SOURCE_FILES ${ASTEROIDS2D_SRC_FILES}
+)
Added: code/branches/Asteroid_HS17/src/modules/minigametest/CMakeLists.txt
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/CMakeLists.txt (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/CMakeLists.txt 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,16 @@
+SET_SOURCE_FILES(MINIGAMESTEST_SRC_FILES
+MiniGameTest.cc
+MiniGameTestCenterPoint.cc
+MiniGameTestShip.cc
+MiniGameTestCube.cc
+MiniGameTestHUDinfo.cc
+)
+
+ORXONOX_ADD_LIBRARY(minigametest
+ PLUGIN
+ FIND_HEADER_FILES
+ LINK_LIBRARIES
+ orxonox
+ overlays
+ SOURCE_FILES ${MINIGAMESTEST_SRC_FILES}
+)
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTest.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTest.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTest.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,235 @@
+/*
+ * 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 MiniGameTest.cc
+ @brief Implementation of the MiniGameTest class.
+*/
+
+#include "MiniGameTest.h"
+#include "MiniGameTestShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
+#include "MiniGameTestCube.h"
+#include "core/CoreIncludes.h"
+#include "Highscore.h"
+
+namespace orxonox
+{
+ RegisterUnloadableClass(MiniGameTest);
+
+ MiniGameTest::MiniGameTest(Context* context) : Deathmatch(context)
+ {
+ RegisterObject(MiniGameTest);
+
+ bEndGame = false;
+ lives = 1;
+ level = 1;
+ point = 0;
+ bShowLevel = false;
+ multiplier = 1;
+ b_combo = false;
+ counter = 5000;
+ pattern = 1;
+ lastPosition = 0;
+ // spawn enemy every 3.5 seconds
+ //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&MiniGameTest::spawnEnemy, this)));
+ comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&MiniGameTest::comboControll, this)));
+ this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
+ this->center_ = nullptr;
+
+ this->setHUDTemplate("MiniGameTestHUD");
+ }
+
+ void MiniGameTest::levelUp()
+ {
+ level++;
+ if (getPlayer() != nullptr)
+ {
+ for (int i = 0; i < 7; i++)
+ {
+ WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
+ chunk5->setPosition(Vector3(600, 0, 100.f * i - 300));
+ chunk5->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
+ chunk5->setScale(10);
+ chunk5->setEffect1("Orxonox/explosion2b");
+ chunk5->setEffect2("Orxonox/smoke6");
+ chunk5->Explode();
+
+ }
+ }
+ addPoints(multiplier * 42);
+ multiplier *= 2;
+ toggleShowLevel();
+ showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&MiniGameTest::toggleShowLevel, this)));
+ }
+
+ void MiniGameTest::tick(float dt)
+ {
+ if (getPlayer() != nullptr)
+ {
+ currentPosition = getPlayer()->getWorldPosition().x;
+ counter = counter + (currentPosition - lastPosition);
+ lastPosition = currentPosition;
+ point = (int) currentPosition;
+ getPlayer()->speed = 830.0f - (point / 1000);
+
+ for(unsigned int i=0; i < cubeList.size();i++)
+ {
+ if(cubeList.at(i)->getPosition().x < currentPosition-3000)
+ {
+ cubeList.at(i)->destroy();
+ cubeList.erase(cubeList.begin()+i);
+ }
+ }
+
+ if(counter >= 3000)
+ {
+ counter = 0;
+ for(int i = 0; i<6; i++)
+ {
+ MiniGameTestCube* cube = new MiniGameTestCube(this->center_->getContext());
+ cubeList.push_back(cube);
+ switch(pattern)
+ {
+ case 1: cube->addTemplate("MiniGameTestCube01");
+ break;
+ case 2: cube->addTemplate("MiniGameTestCube02");
+ break;
+
+ }
+
+ cube->setPosition(getPlayer()->getWorldPosition() + Vector3(5000.0f, 0.0f, -3600.0f + (i*1200)));
+ //stEntity->setScale3D(50,50,50);
+ }
+
+
+ pattern %= 2;
+ pattern ++;
+
+ }
+
+ }
+ SUPER(MiniGameTest, tick, dt);
+ }
+
+ MiniGameTestShip* MiniGameTest::getPlayer()
+ {
+ if (player == nullptr)
+ {
+ for (MiniGameTestShip* ship : ObjectList<MiniGameTestShip>())
+ {
+ player = ship;
+ }
+ }
+ return player;
+ }
+
+ void MiniGameTest::costLife()
+ {
+ //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&MiniGameTest::end, this)));
+ lives = 0;
+ };
+
+ void MiniGameTest::comboControll()
+ {
+ if (b_combo)
+ multiplier++;
+ // if no combo was performed before, reset multiplier
+ else
+ multiplier = 1;
+ b_combo = false;
+ }
+
+ void MiniGameTest::start()
+ {
+ orxout() << "start" << endl;
+ for(unsigned int i=0; i< cubeList.size();i++)
+ {
+ cubeList.at(i)->destroy();
+ cubeList.erase(cubeList.begin()+i);
+
+ }
+ cubeList.clear();
+ // Set variable to temporarily force the player to spawn.
+ this->bForceSpawn_ = false;
+
+ if (this->center_ == nullptr) // abandon mission!
+ {
+ orxout(internal_error) << "MiniGameTest: No Centerpoint specified." << endl;
+ GSLevel::startMainMenu();
+ return;
+ }
+ // Call start for the parent class.
+ Deathmatch::start();
+ }
+
+ void MiniGameTest::playerPreSpawn(PlayerInfo* player)
+ {
+ if(lives <= 0)
+ {
+ this->end();
+ }
+
+ // Reset all the cubes
+ /*
+ orxout() << "prespawn" << endl;
+ for(int i=0; i< cubeList.size();i++)
+ {
+ cubeList.at(i)->destroy();
+ cubeList.erase(cubeList.begin()+i);
+ }
+ cubeList.clear();
+ lives = 1;
+ point = 0;
+ lastPosition = 0;
+ */
+ }
+
+ void MiniGameTest::addPoints(int numPoints)
+ {
+ if (!bEndGame)
+ {
+ point += numPoints * multiplier;
+ b_combo = true;
+ }
+ }
+
+ void MiniGameTest::end()
+ {
+ // DON'T CALL THIS!
+ // Deathmatch::end();
+ // It will misteriously crash the game!
+ // Instead startMainMenu, this won't crash.
+ if (Highscore::exists()){
+ int score = this->getPoints();
+ if(score > Highscore::getInstance().getHighestScoreOfGame("Dodge Race"))
+ Highscore::getInstance().storeHighscore("Dodge Race",score);
+
+ }
+ GSLevel::startMainMenu();
+ }
+}
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTest.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTest.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTest.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,145 @@
+/*
+ * 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 MiniGameTest.h
+ @brief Gametype.
+ @ingroup MiniGameTest
+*/
+
+#ifndef _MiniGameTest_H__
+#define _MiniGameTest_H__
+
+#include "minigametest/MiniGameTestPrereqs.h"
+
+#include "MiniGameTestCenterPoint.h" // Necessary for WeakPointer??
+//#include "MiniGameTestShip.h" DO NOT include in Header. Will cause forward declaration issues
+
+//#include "MiniGameTestHUDinfo.h"
+
+
+#include "core/EventIncludes.h"
+#include "core/command/Executor.h"
+#include "core/config/ConfigValueIncludes.h"
+
+#include "gamestates/GSLevel.h"
+#include "chat/ChatManager.h"
+#include <vector>
+
+// ! HACK
+#include "infos/PlayerInfo.h"
+
+#include "core/command/ConsoleCommand.h"
+
+#include "gametypes/Deathmatch.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+
+ class _MiniGameTestExport MiniGameTest : public Deathmatch
+ {
+ public:
+ MiniGameTest(Context* context);
+
+ virtual void start() override;
+ virtual void end() override;
+
+ virtual void tick(float dt) override;
+
+ virtual void playerPreSpawn(PlayerInfo* player) override;
+
+ void levelUp();
+
+ int getLives(){return this->lives;}
+ int getLevel(){return this->level;}
+ int getPoints(){return this->point;}
+ int getMultiplier(){return this->multiplier;}
+
+ void setCenterpoint(MiniGameTestCenterPoint* center)
+ { this->center_ = center; }
+ virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
+
+ // checks if multiplier should be reset.
+ void comboControll();
+ void costLife();
+
+ bool bEndGame;
+ bool bShowLevel;
+ int lives;
+ int multiplier;
+ float counter;
+ int pattern;
+ float currentPosition;
+ float lastPosition;
+
+ private:
+ Timer endGameTimer;
+
+ MiniGameTestShip* getPlayer();
+ WeakPtr<MiniGameTestShip> player;
+ std::vector<MiniGameTestCube*> cubeList;
+ void toggleShowLevel(){bShowLevel = !bShowLevel;}
+ void addPoints(int numPoints);
+
+ WeakPtr<MiniGameTestCenterPoint> center_;
+ int level;
+ int point;
+ bool b_combo;
+
+ Timer enemySpawnTimer;
+ Timer comboTimer;
+ Timer showLevelTimer;
+
+
+ /*
+
+ //void spawnEnemy();
+
+
+
+
+
+
+
+
+
+
+
+
+ private:
+
+
+
+
+ //Context* context;
+ */
+ };
+}
+
+#endif /* _MiniGameTest_H__ */
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCenterPoint.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCenterPoint.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCenterPoint.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,59 @@
+/*
+ * 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 MiniGameTestCenterPoint.cc
+ @brief Implementation of the MiniGameTestCenterPoint class.
+*/
+
+#include "MiniGameTestCenterPoint.h"
+
+#include "core/CoreIncludes.h"
+
+#include "MiniGameTest.h"
+
+namespace orxonox
+{
+ RegisterClass(MiniGameTestCenterPoint);
+
+ MiniGameTestCenterPoint::MiniGameTestCenterPoint(Context* context) : StaticEntity(context)
+ {
+ RegisterObject(MiniGameTestCenterPoint);
+
+ this->checkGametype();
+ }
+
+ void MiniGameTestCenterPoint::checkGametype()
+ {
+ if (this->getGametype() != nullptr && this->getGametype()->isA(Class(MiniGameTest)))
+ {
+ MiniGameTest* MiniGameTestGametype = orxonox_cast<MiniGameTest*>(this->getGametype());
+ MiniGameTestGametype->setCenterpoint(this);
+ }
+ }
+}
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCenterPoint.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCenterPoint.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCenterPoint.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -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 MiniGameTestCenterPoint.h
+ @brief Declaration of the MiniGameTestCenterPoint class.
+ @ingroup MiniGameTest
+*/
+
+#ifndef _MiniGameTestCenterPoint_H__
+#define _MiniGameTestCenterPoint_H__
+
+#include "minigametest/MiniGameTestPrereqs.h"
+
+//#include "MiniGameTest.h"
+//#include "MiniGameTestHUDinfo.h"
+
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+ class _MiniGameTestExport MiniGameTestCenterPoint : public StaticEntity
+ {
+ public:
+ MiniGameTestCenterPoint(Context* context); //checks whether the gametype is actually MiniGameTest.
+
+ private:
+ void checkGametype();
+
+ };
+}
+
+#endif /* _MiniGameTestCenterPoint_H__ */
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCube.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCube.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCube.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,47 @@
+/* ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Samuel Riedel
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file MiniGameTest.cc
+ @brief Implementation of the MiniGameTest class.
+*/
+
+#include "MiniGameTestCube.h"
+#include "MiniGameTest.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+ RegisterClass(MiniGameTestCube);
+
+ MiniGameTestCube::MiniGameTestCube(Context* context) : MovableEntity(context)
+ {
+ RegisterObject(MiniGameTestCube);
+ }
+
+
+}
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCube.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCube.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestCube.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,54 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Samuel Riedel
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file MiniGameTest.h
+ @brief Gametype.
+ @ingroup MiniGameTest
+*/
+
+#ifndef _MiniGameTestCube_H__
+#define _MiniGameTestCube_H__
+
+#include "minigametest/MiniGameTestPrereqs.h"
+
+#include "worldentities/MovableEntity.h"
+
+
+namespace orxonox
+{
+ class _MiniGameTestExport MiniGameTestCube : public MovableEntity
+ {
+ public:
+ MiniGameTestCube(Context* context);
+
+ private:
+ };
+}
+
+#endif /* _MiniGameTestCube_H__ */
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestHUDinfo.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestHUDinfo.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestHUDinfo.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,91 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ *
+ */
+
+#include "MiniGameTestHUDinfo.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+//#include "MiniGameTest.h"
+
+namespace orxonox
+{
+ RegisterClass(MiniGameTestHUDinfo);
+
+ MiniGameTestHUDinfo::MiniGameTestHUDinfo(Context* context) : OverlayText(context)
+ {
+ RegisterObject(MiniGameTestHUDinfo);
+
+ this->MiniGameTestGame = nullptr;
+ this->bShowPoints_ = true;
+ }
+
+ void MiniGameTestHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(MiniGameTestHUDinfo, XMLPort, xmlelement, mode);
+
+ XMLPortParam(MiniGameTestHUDinfo,"showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);
+ }
+
+ void MiniGameTestHUDinfo::tick(float dt)
+ {
+ SUPER(MiniGameTestHUDinfo, tick, dt);
+
+
+ if(this->bShowPoints_)
+ {
+ const std::string& points = multi_cast<std::string>(this->MiniGameTestGame->getPoints());
+ if (this->MiniGameTestGame->lives <= 0)
+ {
+ setTextSize(0.2);
+ setPosition(Vector2(0.1, 0.02));
+ this->setCaption("Final score:\n" + points);
+ this->setColour(ColourValue(1, 0, 0, 1));
+ }
+ else
+ {
+ setTextSize(0.04);
+ setPosition(Vector2(0.14, 0.02));
+ this->setColour(ColourValue(1, 1, 1, 1));
+ this->setCaption(points);
+ }
+ }
+ }
+
+ void MiniGameTestHUDinfo::changedOwner()
+ {
+ SUPER(MiniGameTestHUDinfo, changedOwner);
+
+ if (this->getOwner() && this->getOwner()->getGametype())
+ {
+ this->MiniGameTestGame = orxonox_cast<MiniGameTest*>(this->getOwner()->getGametype());
+ }
+ else
+ {
+ this->MiniGameTestGame = nullptr;
+ }
+ }
+}
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestHUDinfo.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestHUDinfo.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestHUDinfo.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,61 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ *
+ */
+
+#ifndef _MiniGameTestHUDinfo_H__
+#define _MiniGameTestHUDinfo_H__
+
+//#include "MiniGameTestShip.h"
+#include "MiniGameTest.h"
+//#include "MiniGameTestCenterPoint.h"
+
+#include "minigametest/MiniGameTestPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+ class _MiniGameTestExport MiniGameTestHUDinfo : public OverlayText, public Tickable
+ {
+ public:
+ MiniGameTestHUDinfo(Context* context);
+
+ virtual void tick(float dt) override;
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+ virtual void changedOwner() override;
+
+ inline void setShowPoints(bool value)
+ { this->bShowPoints_ = value; }
+ inline bool getShowPoints() const
+ { return this->bShowPoints_; }
+
+
+ private:
+ MiniGameTest* MiniGameTestGame;
+ bool bShowPoints_;
+ };
+}
+#endif /* _MiniGameTestHUDinfo_H__ */
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestPrereqs.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestPrereqs.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestPrereqs.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,81 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ at file
+ at brief
+ Shared library macros, enums, constants and forward declarations for the MiniGameTest module
+*/
+
+#ifndef _MiniGameTestPrereqs_H__
+#define _MiniGameTestPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(MINIGAMETEST_STATIC_BUILD)
+# ifdef MINIGAMETEST_SHARED_BUILD
+# define _MiniGameTestExport __declspec(dllexport)
+# else
+# if defined( __MINGW32__ )
+# define _MiniGameTestExport
+# else
+# define _MiniGameTestExport __declspec(dllimport)
+# endif
+# endif
+# define _MiniGameTestPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
+# define _MiniGameTestExport __attribute__ ((visibility("default")))
+# define _MiniGameTestPrivate __attribute__ ((visibility("hidden")))
+#else
+# define _MiniGameTestExport
+# define _MiniGameTestPrivate
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+ class MiniGameTest;
+ class MiniGameTestCenterPoint;
+ class MiniGameTestShip;
+ class MiniGameTestCube;
+ //class MiniGameTestEnemy;
+ //class MiniGameTestEnemyShooter;
+ //class MiniGameTestWeapon;
+ //class MiniGameTestWeaponEnemy;
+ //class MiniGameTestHUDinfo;
+}
+
+#endif /* _MiniGameTestPrereqs_H__*/
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestShip.cc
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestShip.cc (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestShip.cc 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,169 @@
+/*
+ * 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 MiniGameTestShip.cc
+ @brief Implementation of the MiniGameTestShip class.
+*/
+
+#include "MiniGameTestShip.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+ RegisterClass(MiniGameTestShip);
+
+ MiniGameTestShip::MiniGameTestShip(Context* context) : SpaceShip(context)
+ {
+ RegisterObject(MiniGameTestShip);
+
+ speed = 830;
+ isFireing = false;
+ damping = 10;
+
+ // not sure if has to be zero?
+ lastTimeFront = 0;
+ lastTimeLeft = 0;
+ lastTime = 0;
+ }
+
+ void MiniGameTestShip::tick(float dt)
+ {
+ Vector3 pos = getPosition();
+
+ //Movement calculation
+ lastTimeFront += dt * damping;
+ lastTimeLeft += dt * damping;
+ lastTime += dt;
+
+ velocity.x = interpolate(clamp(lastTimeLeft, 0.0f, 1.0f), desiredVelocity.x, 0.0f);
+ velocity.y = interpolate(clamp(lastTimeFront, 0.0f, 1.0f), desiredVelocity.y, 0.0f);
+
+ //Execute movement
+ if (this->hasLocalController())
+ {
+ float dist_y = velocity.y * dt;
+ //float dist_x = velocity.x * dt;
+ if(dist_y + posforeward > -42*3 && dist_y + posforeward < 42*6)
+ posforeward += dist_y;
+ else
+ {
+ velocity.y = 0;
+ // restart if game ended
+/*
+ if (getGame())
+ if (getGame()->bEndGame)
+ {
+ getGame()->start();
+ return;
+ }*/
+ }
+
+ pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
+ }
+
+
+ // Camera
+ Camera* camera = this->getCamera();
+ if (camera != nullptr)
+ {
+ // camera->setPosition(Vector3(-pos.z, -posforeward, 0));
+ camera->setOrientation(Vector3::UNIT_Z, Degree(0));
+ }
+
+
+
+ // bring back on track!
+ if(pos.y != 0)
+ {
+ pos.y = 0;
+ }
+
+ setPosition(pos);
+ setOrientation(Vector3::UNIT_Y, Degree(270));
+
+ // Level up!
+ if (pos.x > 42000)
+ {
+ updateLevel();
+ setPosition(Vector3(0, 0, pos.z)); // pos - Vector3(30000, 0, 0)
+ }
+
+ SUPER(MiniGameTestShip, tick, dt);
+ }
+
+ void MiniGameTestShip::updateLevel()
+ {
+ lastTime = 0;
+ if (getGame())
+ getGame()->levelUp();
+ }
+
+ void MiniGameTestShip::moveFrontBack(const Vector2& value)
+ {
+ //lastTimeFront = 0;
+ //desiredVelocity.y = value.y * speed * 42;
+
+ }
+
+ void MiniGameTestShip::moveRightLeft(const Vector2& value)
+ {
+ lastTimeLeft = 0;
+ desiredVelocity.x = value.x * speed;
+ }
+ void MiniGameTestShip::boost(bool bBoost)
+ {
+ //getGame()->bEndGame = bBoost;
+ }
+
+ inline bool MiniGameTestShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
+ {
+
+ removeHealth(100);
+ this->death();
+ return false;
+ }
+
+ MiniGameTest* MiniGameTestShip::getGame()
+ {
+ if (game == nullptr)
+ {
+ for (MiniGameTest* race : ObjectList<MiniGameTest>())
+ {
+ game = race;
+ }
+ }
+ return game;
+ }
+
+ void MiniGameTestShip::death()
+ {
+ getGame()->costLife();
+ SpaceShip::death();
+ }
+}
Added: code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestShip.h
===================================================================
--- code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestShip.h (rev 0)
+++ code/branches/Asteroid_HS17/src/modules/minigametest/MiniGameTestShip.h 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,95 @@
+/*
+ * 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 MiniGameTestShip.h
+ @brief Declaration of the MiniGameTestShip class.
+*/
+
+#ifndef _MiniGameTestShip_H__
+#define _MiniGameTestShip_H__
+
+
+#include "minigametest/MiniGameTestPrereqs.h"
+
+#include "core/XMLPort.h"
+#include "worldentities/pawns/SpaceShip.h"
+#include "graphics/Camera.h"
+
+#include "MiniGameTest.h" // Is necessary for getGame function
+//#include "MiniGameTestCenterPoint.h"
+
+namespace orxonox
+{
+ class _MiniGameTestExport MiniGameTestShip : public SpaceShip
+ {
+ public:
+ MiniGameTestShip(Context* context);
+
+ virtual void tick(float dt) override;
+
+ // overwrite for 2d movement
+ virtual void moveFrontBack(const Vector2& value) override;
+ virtual void moveRightLeft(const Vector2& value) override;
+
+ // Starts or stops fireing
+ virtual void boost(bool bBoost) override;
+
+ //no rotation!
+ virtual void rotateYaw(const Vector2& value) override{};
+ virtual void rotatePitch(const Vector2& value) override{};
+
+ //return to main menu if game has ended.
+ virtual void rotateRoll(const Vector2& value) override{if (getGame()) if (getGame()->bEndGame) getGame()->end();};
+
+ virtual void updateLevel();
+
+ virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
+
+ float speed, damping, posforeward;
+ bool isFireing;
+
+ protected:
+ virtual void death() override;
+
+ private:
+ MiniGameTest* getGame();
+ WeakPtr<MiniGameTest> game;
+ WeakPtr<WorldEntity> lastEntity;
+ Camera* camera;
+ float lastTimeFront, lastTimeLeft, lastTime;
+ struct Velocity
+ {
+ float x;
+ float y;
+ } velocity, desiredVelocity;
+
+ };
+}
+
+#endif /* _MiniGameTestShip_H__ */
Added: code/branches/Asteroid_HS17/svn-commit.tmp
===================================================================
--- code/branches/Asteroid_HS17/svn-commit.tmp (rev 0)
+++ code/branches/Asteroid_HS17/svn-commit.tmp 2017-11-27 13:00:29 UTC (rev 11593)
@@ -0,0 +1,7 @@
+
+--This line, and those below, will be ignored--
+
+A src/modules/asteroids
+A src/modules/asteroids/Asteroids.cc
+A src/modules/asteroids/Asteroids.h
+A src/modules/asteroids/CMakeLists.txt
More information about the Orxonox-commit
mailing list