[Orxonox-commit 6559] r11199 - in code/branches/presentationFS16: data/levels data/levels/includes data/levels/templates data/overlays src/modules/hover src/modules/invader src/modules/pickup src/modules/weapons/weaponmodes
fvultier at orxonox.net
fvultier at orxonox.net
Thu May 26 15:13:51 CEST 2016
Author: fvultier
Date: 2016-05-26 15:13:51 +0200 (Thu, 26 May 2016)
New Revision: 11199
Added:
code/branches/presentationFS16/src/modules/hover/TFlagsLivesLevelHUD.cc
code/branches/presentationFS16/src/modules/hover/TFlagsLivesLevelHUD.h
Modified:
code/branches/presentationFS16/data/levels/Hover.oxw
code/branches/presentationFS16/data/levels/emptyLevel.oxw
code/branches/presentationFS16/data/levels/includes/weaponSettingsHover.oxi
code/branches/presentationFS16/data/levels/templates/spaceshipHover.oxt
code/branches/presentationFS16/data/overlays/HoverHUD.oxo
code/branches/presentationFS16/src/modules/hover/CMakeLists.txt
code/branches/presentationFS16/src/modules/hover/Hover.cc
code/branches/presentationFS16/src/modules/hover/Hover.h
code/branches/presentationFS16/src/modules/hover/HoverFlag.cc
code/branches/presentationFS16/src/modules/hover/HoverOrigin.cc
code/branches/presentationFS16/src/modules/hover/HoverOrigin.h
code/branches/presentationFS16/src/modules/hover/HoverShip.cc
code/branches/presentationFS16/src/modules/hover/HoverShip.h
code/branches/presentationFS16/src/modules/invader/Invader.cc
code/branches/presentationFS16/src/modules/pickup/PickupSpawner.h
code/branches/presentationFS16/src/modules/weapons/weaponmodes/HsW01.cc
code/branches/presentationFS16/src/modules/weapons/weaponmodes/HsW01.h
Log:
merged branch hover
Modified: code/branches/presentationFS16/data/levels/Hover.oxw
===================================================================
--- code/branches/presentationFS16/data/levels/Hover.oxw 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/data/levels/Hover.oxw 2016-05-26 13:13:51 UTC (rev 11199)
@@ -2,7 +2,7 @@
name = "Hover level"
description = "Level for Minigame Hover"
tags = "minigame"
- screenshot = "emptylevel.png"
+ screenshot = "hover.png"
/>
<?lua
@@ -19,11 +19,118 @@
<?lua
MAZE_NUM_CELLS = 10
-MAZE_CELL_SIZE = 100
-MAZE_CELL_HEIGHT = 30
+MAZE_CELL_SIZE = 600
+MAZE_CELL_HEIGHT = 180
+MAZE_WALL_THICKNESS = 10
MAZE_SIZE = MAZE_NUM_CELLS*MAZE_CELL_SIZE
?>
+<!-- Shrink Pickup Representation -->
+
+<Template name=smallshrinkpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Sphere2" scale=0.5>
+ <attached>
+ <Billboard position="0,0,0" colour="1.0,0.55,1.0" material="Shrink" scale=0.35 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+
+<Template name=smallshrinkpickup baseclass=ShrinkPickup>
+ <ShrinkPickup
+ representation = "smallshrinkpickup"
+ duration = 10.0
+ shrinkFactor = 2
+ activaionType = "immediate"
+ durationType = "continuous"
+ />
+</Template>
+
+<!-- Speed Pickup Representation -->
+
+<Template name=hugespeedpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.99,0.96,0.52" material="Sphere2" scale=0.5>
+ <attached>
+ <Billboard position="0,0,0" colour="0.98,0.94,0.22" material="3arrowsup" scale=0.7 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=hugespeedpickup baseclass=SpeedPickup>
+ <SpeedPickup
+ representation = "hugespeedpickup"
+ duration = 10.0
+ speedAdd = 0.0
+ SpeedMultiply = 5.0
+ activationType = "immediate"
+ durationType = "continuous"
+ />
+</Template>
+
+<!-- Destroy Carrier Pickup Representation -->
+
+<Template name=destroyhoverpickupRepresentation>
+ <PickupRepresentation>
+ <spawner-representation>
+ <StaticEntity>
+ <attached>
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Sphere2" scale=0.5>
+ <attached>
+ <Billboard position="0,0,0" colour="0.6,0.⁰,0.8" material="Asterisk" scale=0.65 />
+ </attached>
+ </Billboard>
+ </attached>
+ </StaticEntity>
+ </spawner-representation>
+ </PickupRepresentation>
+</Template>
+
+<Template name=destroyhoverpickup baseclass=MetaPickup>
+ <MetaPickup representation="destroyhover" metaType="destroyCarrier" />
+</Template>
+
+<!-- Obstacle (crate) Template -->
+
+<Template name=obstacle baseclass=Pawn>
+ <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=10000000000000 name=box RVName = "Box 4" >
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="15,15,15" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="70,70,70" />
+ </collisionShapes>
+ </Pawn>
+</Template>
+
+<!-- Ground Template -->
+
+<Template name=ground baseclass=StaticEntity>
+ <StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="300,20,300" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="300,10,300" />
+ </collisionShapes>
+ </StaticEntity>
+</Template>
+
<Level
plugins = hover
gametype = Hover
@@ -31,37 +138,58 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+
<?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
skybox = "Orxonox/Starbox"
- gravity = "0, -200, 0"
+ gravity = "0, -300, 0"
>
+ <PickupRepresentation
+ name = "destroyhover"
+ pickupName = "Destroy Hover Pickup"
+ pickupDescription = "destroys you."
+ spawnerTemplate = "destroyhoverpickupRepresentation"
+ inventoryRepresentation = "destroyHoverPickup"
+ />
+
+ <PickupRepresentation
+ name = "hugespeedpickup"
+ pickupName = "Huge Speed Boost"
+ pickupDescription = "Multiplies Speed of the Ship by a huge amount."
+ spawnerTemplate = "hugespeedpickupRepresentation"
+ inventoryRepresentation = "HugeSpeed"
+ />
+
+ <PickupRepresentation
+ name = "smallshrinkpickup"
+ pickupName = "Small Shrink"
+ pickupDescription = "Shrinks the ship by a small amount."
+ spawnerTemplate = "smallshrinkpickupRepresentation"
+ inventoryRepresentation = "SmallShrink"
+ />
+
<StaticEntity position="0,0,0" collisionType="static">
<attached>
<HoverOrigin
numCells="<?lua print(MAZE_NUM_CELLS)?>"
cellSize="<?lua print(MAZE_CELL_SIZE)?>"
cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>"
+ wallThickness="<?lua print(MAZE_WALL_THICKNESS)?>"
+ obstacletemplate=obstacle
+ pickuptemplate=destroyhoverpickup
+ pickuprepresentationtemplate=destroyhoverpickupRepresentation
+ pickuptemplatespeed=hugespeedpickup
+ pickuprepresentationtemplatespeed=hugespeedpickupRepresentation
+ pickuptemplateshrink=smallshrinkpickup
+ pickuprepresentationtemplateshrink=smallshrinkpickupRepresentation
+ groundtemplate=ground
/>
- <Model
- position="<?lua print(MAZE_SIZE/2)?>,-16,<?lua print(MAZE_SIZE/2)?>"
- scale3D="<?lua print(MAZE_SIZE/2)?>,16,<?lua print(MAZE_SIZE/2)?>"
- mesh="CubeGround.mesh"
- />
+
</attached>
- <collisionShapes>
- <BoxCollisionShape
- position="<?lua print(MAZE_SIZE/2)?>,<?lua print(MAZE_CELL_HEIGHT+1)?>,<?lua print(MAZE_SIZE/2)?>"
- halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
- />
- <BoxCollisionShape
- position="<?lua print(MAZE_SIZE/2)?>,-1,<?lua print(MAZE_SIZE/2)?>"
- halfExtents="<?lua print(MAZE_SIZE/2)?>,1,<?lua print(MAZE_SIZE/2)?>"
- />
- </collisionShapes>
+
</StaticEntity>
<Light
@@ -74,12 +202,11 @@
<SpawnPoint
team=0
- position="50,20,50"
- lookat="100,20,100"
+ position="300,120,300"
+ lookat="600,120,600"
spawnclass=HoverShip
pawndesign=spaceshiphover
/>
</Scene>
</Level>
-
Modified: code/branches/presentationFS16/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/presentationFS16/data/levels/emptyLevel.oxw 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/data/levels/emptyLevel.oxw 2016-05-26 13:13:51 UTC (rev 11199)
@@ -13,6 +13,7 @@
<?lua
include("templates/spaceshipEscort.oxt")
+ include("templates/spaceshipHover.oxt")
?>
<Level>
@@ -28,6 +29,14 @@
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
<SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+ <SpaceShip position="0,0,0" lookat="0,0,0" >
+
+ <templates>
+ <Template link=spaceshiphover />
+ </templates>
+
+ </SpaceShip>
</Scene>
</Level>
Modified: code/branches/presentationFS16/data/levels/includes/weaponSettingsHover.oxi
===================================================================
--- code/branches/presentationFS16/data/levels/includes/weaponSettingsHover.oxi 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/data/levels/includes/weaponSettingsHover.oxi 2016-05-26 13:13:51 UTC (rev 11199)
@@ -1,6 +1,6 @@
<weaponslots>
- <WeaponSlot position="-3,2,-3" />
- <WeaponSlot position=" 3,2,-3" />
+ <WeaponSlot position="-10,2,-100" />
+ <WeaponSlot position=" 10,2,-100" />
</weaponslots>
<weaponsets>
<WeaponSet firemode=0 />
@@ -13,10 +13,10 @@
<DefaultWeaponmodeLink firemode=1 weaponmode=1 />
</links>
<Weapon>
- <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="LaserBeam2.mesh" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 speed=2000.0f damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1, 1,-50 " projectileMesh="LaserBeam2.mesh" />
</Weapon>
<Weapon>
- <IceGun mode=0 munitionpershot=0 delay=0 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="LaserBeam2.mesh" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 speed=2000.0f damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.8, 1,-50" projectileMesh="LaserBeam2.mesh" />
</Weapon>
</WeaponPack>
<WeaponPack>
@@ -26,5 +26,5 @@
</WeaponPack>
</weaponpacks>
<munition>
- <IceMunition initialmagazines=1 maxmagazines=1 munitionpermagazine=10/>
+ <LaserMunition initialmagazines=2 maxmagazines=2 munitionpermagazine=20/>
</munition>
Modified: code/branches/presentationFS16/data/levels/templates/spaceshipHover.oxt
===================================================================
--- code/branches/presentationFS16/data/levels/templates/spaceshipHover.oxt 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/data/levels/templates/spaceshipHover.oxt 2016-05-26 13:13:51 UTC (rev 11199)
@@ -17,14 +17,14 @@
reloadrate = 2
reloadwaittime = 0.5
- primaryThrust = 200
- auxilaryThrust = 30
- rotationThrust = 25
+ primaryThrust = 2000
+ auxilaryThrust = 1
+ rotationThrust = 45
- jumpBoost = 90
+ jumpBoost = 450
lift = 1;
- stallSpeed = 220;
+ stallSpeed = 1400;
boostPower = 10
boostPowerRate = 1
@@ -32,7 +32,7 @@
boostCooldownDuration = 10
collisionType = "dynamic"
- mass = 100
+ mass = 1000000
linearDamping = 0.2
angularDamping = 0.9999999
>
@@ -40,17 +40,17 @@
<MultiStateEngine position=" 0, 0, 0" template=spaceshiphoverengine />
</engines>
<attached>
- <Model position="0,0,-20" mesh="hovership_body.mesh" scale="5" yaw=180/>
- <Model position="0,0,-20" mesh="hovership_engine.mesh" scale="5" yaw=180/>
- <Model position="0,0,-20" mesh="hovership_gun.mesh" scale="5" yaw=180/>
+ <Model position="0,0,-120" mesh="hovership_body.mesh" scale="30" yaw=180/>
+ <Model position="0,0,-120" mesh="hovership_engine.mesh" scale="30" yaw=180/>
+ <Model position="0,0,-120" mesh="hovership_gun.mesh" scale="30" yaw=180/>
</attached>
<collisionShapes>
- <BoxCollisionShape position="0,-2 ,7" halfExtents="7, 4 ,30" />
+ <BoxCollisionShape position="0,-12, 42" halfExtents="49, 24 ,180" />
</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" scale=2 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" scale=12 />
<ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
<ExplosionPart mesh="explosionparts/pirate_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
@@ -68,8 +68,8 @@
<Template name=spaceshiphovercameras defaults=0>
<SpaceShip>
<camerapositions>
- <CameraPosition position="0,8, 5" drag=true mouselook=true />
- <CameraPosition position="0,8,5" yaw="180" drag=true mouselook=true />
+ <CameraPosition position="0, 48, 30" drag=true mouselook=true />
+ <CameraPosition position="0, 48, 30" yaw="180" drag=true mouselook=true />
</camerapositions>
</SpaceShip>
</Template>
@@ -78,15 +78,15 @@
<MultiStateEngine
boostfactor = 2
- speedfront = 90
- speedback = 40
- speedleftright = 40
- speedupdown = 40
+ speedfront = 1400
+ speedback = 800
+ speedleftright = 700
+ speedupdown = 700
- accelerationfront = 500
- accelerationbrake = 500
- accelerationback = 125
- accelerationleftright = 125
+ accelerationfront = 1000
+ accelerationbrake = 1000
+ accelerationback = 250
+ accelerationleftright = 350
accelerationupdown = 125
>
<EffectContainer condition="not idle">
Modified: code/branches/presentationFS16/data/overlays/HoverHUD.oxo
===================================================================
--- code/branches/presentationFS16/data/overlays/HoverHUD.oxo 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/data/overlays/HoverHUD.oxo 2016-05-26 13:13:51 UTC (rev 11199)
@@ -38,9 +38,105 @@
correctaspect = true
iconmaterial = "Orxonox/BarIconHealth"
>
+
<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>
+
+
+
+ <OverlayText
+ position = "0.02, 0.08"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ caption = "Total Flags: "
+ />
+
+ <OverlayText
+ position = "0.02, 0.12"
+ 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.16"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ caption = "Level: "
+ />
+
+ <TFlagsLivesLevelHUD
+ 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"
+ showFlags = true
+ showLives = false
+ showLevel = false
+ levelUpgrade = false
+
+ />
+
+ <TFlagsLivesLevelHUD
+ position = "0.14, 0.04"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ showFlags = false
+ showLives = true
+ showLevel = false
+ levelUpgrade = false
+
+ />
+
+ <TFlagsLivesLevelHUD
+ position = "0.14, 0.06"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ showFlags = false
+ showLives = false
+ showLevel = true
+ levelUpgrade = false
+
+ />
+
+ <TFlagsLivesLevelHUD
+ position = "0.3, 0.45"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "left"
+ showFlags = false
+ showLives = false
+ showLevel = false
+ levelUpgrade = true
+
+ />
+
+
+ </OverlayGroup>
+
</Template>
+
+
+
+
Modified: code/branches/presentationFS16/src/modules/hover/CMakeLists.txt
===================================================================
--- code/branches/presentationFS16/src/modules/hover/CMakeLists.txt 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/hover/CMakeLists.txt 2016-05-26 13:13:51 UTC (rev 11199)
@@ -7,6 +7,7 @@
TimeHUD.cc
FlagHUD.cc
MazeGenerator.cc
+ TFlagsLivesLevelHUD.cc
)
ORXONOX_ADD_LIBRARY(hover
@@ -16,5 +17,6 @@
orxonox
objects
overlays
+ pickup
SOURCE_FILES ${Hover_SRC_FILES}
)
Modified: code/branches/presentationFS16/src/modules/hover/Hover.cc
===================================================================
--- code/branches/presentationFS16/src/modules/hover/Hover.cc 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/hover/Hover.cc 2016-05-26 13:13:51 UTC (rev 11199)
@@ -23,6 +23,7 @@
* Manuel Meier
* Co-authors:
* Cyrill Burgener
+ * Tomer Gidron
*
*/
@@ -32,13 +33,18 @@
*/
#include "Hover.h"
-
+#include "chat/ChatManager.h"
#include "HoverOrigin.h"
#include "HoverWall.h"
#include "HoverFlag.h"
#include "MazeGenerator.h"
#include "core/CoreIncludes.h"
+#include "gamestates/GSLevel.h"
+#include "HoverShip.h"
+#include "pickup/PickupSpawner.h"
+#include "pickup/Pickup.h"
+
namespace orxonox
{
RegisterUnloadableClass(Hover);
@@ -50,22 +56,37 @@
this->origin_ = nullptr;
this->numberOfFlags_ = 1;
this->firstTick_ = true;
+ level = 1; //start at level 1
+ flagsTaken = 0;// took 0 flags in the beginning
+ lives = 3;
+ numCells = 0;
+ cellSize = 0;
+ cellHeight = 0;
+
+ bLevelUpgradeHUD = false;
+
+ totFlags = 0;
+
this->setHUDTemplate("HoverHUD");
+
}
- void Hover::tick(float dt)
+ void Hover::start()
{
- SUPER(Hover, tick, dt);
-
+ Gametype::start();
if(this->firstTick_ && this->origin_)
{
this->firstTick_ = false;
- int numCells = this->origin_->getNumCells();
- int cellSize = this->origin_->getCellSize();
- int cellHeight = this->origin_->getCellHeight();
+ numCells = this->origin_->getNumCells();
+ cellSize = this->origin_->getCellSize();
+ cellHeight = this->origin_->getCellHeight();
+ //TODO
+ //create boolean array/vector to assert that no two objects are placed in the same way
+
+
MazeGenerator generator(numCells);
generator.generateMaze();
generator.renderMaze();
@@ -80,36 +101,188 @@
(new HoverWall(origin_->getContext()))->init(i+1, numCells, cellSize, cellHeight, 2);
}
+
+ //Ground
+ for(int i = 0; i<numCells; i++){
+ for(int j = 0; j<numCells; j++){
+ StaticEntity* groundCell = new StaticEntity(origin_->getContext());
+
+ groundCell->addTemplate(origin_->getGroundTemplate());
+ groundCell->setPosition(get3dCoordinates(i,j,-60));
+ }
+
+ }
+
+
+
//Generate inner Walls according to levelcode
for(int y=0; y<numCells; y++){
for(int x=0; x<numCells; x++){
- switch(levelcode[ y * numCells + x ]){
+ switch(levelcode[ y * numCells + x ])
+ {
case 1: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
- break;
+ break;
case 3: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);
case 2: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);
- default: break;
+ default:
+ break;
}
- }
+ }
}
- //Generate 5 flags randomly
- for ( int i = 0; i < 5; i++ )
+ createFlags();
+
+ //Generate 3 PickupSpawners randomly (destroy hover pickup)
+ for (int i = 0; i<3; i++)
{
- HoverFlag* flag = new HoverFlag(origin_->getContext());
- flag->init(rand()%numCells, rand()%numCells, cellSize);
- flags_.push_back(flag);
+ PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext());
+
+ pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 0.0f));
+ pickupSpawner->setPickupTemplateName(origin_->getPickupTemplate());
+ pickupSpawner->setMaxSpawnedItems(3);
+ pickupSpawner->setRespawnTime(30);
+ pickupSpawner->setTriggerDistance(40);
+ // Add pickup spawner to the pickup spawner list
+ pickupSpawners_.push_back(pickupSpawner);
}
+
+ //Generate 3 PickupSpawners randomly (speed pickup)
+ for (int i = 0; i<3; i++)
+ {
+ PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext());
- }//firsttick end
+ pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 0.0f));
+ pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateSpeed());
+ pickupSpawner->setMaxSpawnedItems(3);
+ pickupSpawner->setRespawnTime(30);
+ pickupSpawner->setTriggerDistance(40);
+ // Add pickup spawner to the pickup spawner list
+ pickupSpawners_.push_back(pickupSpawner);
+ }
+ //Generate 3 PickupSpawners randomly (shrink pickup)
+ for (int i = 0; i<3; i++)
+ {
+ PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext());
+
+ pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 0.0f));
+ pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateShrink());
+ pickupSpawner->setMaxSpawnedItems(3);
+ pickupSpawner->setRespawnTime(30);
+ pickupSpawner->setTriggerDistance(40);
+ // Add pickup spawner to the pickup spawner list
+ pickupSpawners_.push_back(pickupSpawner);
+ }
+
+ //*****************************************************************************
+
+ //Generate destroyable crates randomly on field
+
+ for (int i = 0; i<10; i++){
+
+ Pawn* crate = new Pawn(origin_->getContext());
+
+ crate->addTemplate(origin_->getObstacleTemplate());
+ crate->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 43.0f));
+
+
+ }
+
+
+
+
+ //If no lives are left, end game
+ if(lives <= 0)
+ {
+ GSLevel::startMainMenu();
+ }
+
+ }
+ }
+
+
+ // generate new Flags
+ void Hover::createFlags()
+ {
+ //TODO
+ //Generate flags randomly using bool array
+
+ //Generate 5 flags randomly on field
+ for ( int i = 0; i < 5; i++ )
+ {
+ HoverFlag* flag = new HoverFlag(origin_->getContext());
+ flag->init(rand()%numCells, rand()%numCells, cellSize);
+ flags_.push_back(flag);
+
+
+
+ if(flags_[i]->getPosition() == get3dCoordinates(0,0,-60))
+ {
+ flags_[i]->destroyLater();
+ flags_.erase(flags_.begin()+i);
+ }
+ }
+
+ }
+
+ void Hover::tick(float dt)
+ {
+ SUPER(Hover, tick, dt);
+
+
// Check if ship collided with one of the flags
- for ( unsigned int i = 0; i < flags_.size(); i++ ){
- if(flags_[i]->getCollided()){
+ for ( unsigned int i = 0; i < flags_.size(); i++ )
+ {
+ if(flags_[i]->getCollided())
+ {
flags_[i]->destroyLater();
flags_.erase (flags_.begin()+i);
+ totFlags++;
+ if(flags_.size()<=0){
+ //ChatManager::message("Level Up!");
+
+ levelUp();
+ }
}
+
}
numberOfFlags_ = flags_.size();
+
+ if(lives <= 0){
+ GSLevel::startMainMenu();
+ }
}
+
+ //start new level - call to create new flags
+ void Hover::levelUp()
+ {
+ level++;
+ //increment lives after every 4 levels
+ if(level%4 == 0)
+ {
+ lives++;
+ }
+ createFlags();
+ toggleShowLevel();
+ showLevelTimer.setTimer(2.0f, false, createExecutor(createFunctor(&Hover::toggleShowLevel, this)));
+
+ //spawn one additional crate randomly
+ Pawn* crate = new Pawn(origin_->getContext());
+ crate->addTemplate(origin_->getObstacleTemplate());
+ crate->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 43.0f));
+
+ }
+
+ Vector3 Hover::get3dCoordinates(int x, int y, float heightOffset)
+ {
+ return Vector3(x*cellSize*1.0f + cellSize/2, heightOffset, y*cellSize*1.0f + cellSize/2);
+ }
+
+ //if killed, subtract number of lives. If lives == 0, end game
+ void Hover::costLife()
+ {
+ lives--;
+ if (lives <= 0)
+ GSLevel::startMainMenu();
+ }
}
Modified: code/branches/presentationFS16/src/modules/hover/Hover.h
===================================================================
--- code/branches/presentationFS16/src/modules/hover/Hover.h 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/hover/Hover.h 2016-05-26 13:13:51 UTC (rev 11199)
@@ -23,6 +23,7 @@
* Manuel Meier
* Co-authors:
* Cyrill Burgener
+ * Tomer Gidron
*
*/
@@ -36,11 +37,13 @@
#define _Hover_H__
#include "HoverPrereqs.h"
+#include "HoverShip.h"
#include <vector>
#include "gametypes/Gametype.h"
#include "HoverOrigin.h"
+#include "pickup/PickupSpawner.h"
namespace orxonox
{
@@ -54,14 +57,49 @@
void setOrigin(HoverOrigin* origin)
{ this->origin_ = origin; }
+ void start();
+ void createFlags();
+ void levelUp();
+ void endLevel();
+ void costLife();
+
inline int getNumberOfFlags() const
{ return this->numberOfFlags_; }
+ virtual Vector3 get3dCoordinates(int x, int y, float heightOffset);
+
+ inline int getTotFlags() const
+ { return this->totFlags; }
+
+ inline int getLives() const
+ { return this->lives; }
+
+ inline int getLevel() const
+ { return this->level; }
+
+ bool bLevelUpgradeHUD;
+
private:
+
WeakPtr<HoverOrigin> origin_;
std::vector<HoverFlag*> flags_;
int numberOfFlags_;
bool firstTick_;
+ int level;
+ int lives;
+ int flagsTaken;
+
+ int cellSize;
+ int cellHeight;
+ int numCells;
+
+ int totFlags;
+
+ std::vector<PickupSpawner*> pickupSpawners_;
+
+ void toggleShowLevel(){bLevelUpgradeHUD = !bLevelUpgradeHUD;}
+
+ Timer showLevelTimer;
};
}
Modified: code/branches/presentationFS16/src/modules/hover/HoverFlag.cc
===================================================================
--- code/branches/presentationFS16/src/modules/hover/HoverFlag.cc 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/hover/HoverFlag.cc 2016-05-26 13:13:51 UTC (rev 11199)
@@ -86,13 +86,13 @@
{
model_ = new Model(this->getContext());
model_->setMeshSource("ss_flag_eu.mesh");
- model_->setScale3D(Vector3(5, 5, 5));
- model_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,10.0f,yCoordinate*cellSize*1.0f + cellSize/2));
+ model_->setScale3D(Vector3(30, 30, 30));
+ model_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,50.0f,yCoordinate*cellSize*1.0f + cellSize/2));
this->attach(model_);
cs_ = new BoxCollisionShape(this->getContext());
- cs_->setHalfExtents(Vector3(5, 5, 5));
+ cs_->setHalfExtents(Vector3(30, 30, 30));
cs_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,0.0f,yCoordinate*cellSize*1.0f + cellSize/2));
this->attachCollisionShape(cs_);
Modified: code/branches/presentationFS16/src/modules/hover/HoverOrigin.cc
===================================================================
--- code/branches/presentationFS16/src/modules/hover/HoverOrigin.cc 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/hover/HoverOrigin.cc 2016-05-26 13:13:51 UTC (rev 11199)
@@ -22,7 +22,7 @@
* Author:
* Manuel Meier
* Co-authors:
- * ...
+ * Tomer Gidron
*
*/
@@ -44,6 +44,18 @@
{
RegisterObject(HoverOrigin);
checkGametype();
+
+ //Initialization of variables (not really needed)
+
+ pickupTemplate_ = "";
+ pickupRepresentationTemplate_ = "";
+
+ pickupTemplateSpeed_ = "";
+ pickupRepresentationTemplateSpeed_ = "";
+
+
+ pickupTemplateShrink_ = "";
+ pickupRepresentationTemplateShrink_ = "";
}
void HoverOrigin::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -53,8 +65,18 @@
XMLPortParam(HoverOrigin, "numCells", setNumCells, getNumCells, xmlelement, mode);
XMLPortParam(HoverOrigin, "cellSize", setCellSize, getCellSize, xmlelement, mode);
XMLPortParam(HoverOrigin, "cellHeight", setCellHeight, getCellHeight, xmlelement, mode);
+ XMLPortParam(HoverOrigin, "wallThickness", setWallThickness, getWallThickness, xmlelement, mode);
+ XMLPortParam(HoverOrigin, "pickuptemplate", setPickupTemplate, getPickupTemplate, xmlelement, mode);
+ XMLPortParam(HoverOrigin, "pickuprepresentationtemplate", setPickupRepresentationTemplate, getPickupRepresentationTemplate, xmlelement, mode);
+ XMLPortParam(HoverOrigin, "pickuptemplatespeed", setPickupTemplateSpeed, getPickupTemplateSpeed, xmlelement, mode);
+ XMLPortParam(HoverOrigin, "pickuprepresentationtemplatespeed", setPickupRepresentationTemplateSpeed, getPickupRepresentationTemplateSpeed, xmlelement, mode);
+ XMLPortParam(HoverOrigin, "obstacletemplate", setObstacleTemplate, getObstacleTemplate, xmlelement, mode);
+ XMLPortParam(HoverOrigin, "pickuptemplateshrink", setPickupTemplateShrink, getPickupTemplateShrink, xmlelement, mode);
+ XMLPortParam(HoverOrigin, "pickuprepresentationtemplateshrink", setPickupRepresentationTemplateShrink, getPickupRepresentationTemplateShrink, xmlelement, mode);
+ XMLPortParam(HoverOrigin, "groundtemplate", setGroundTemplate, getGroundTemplate, xmlelement, mode);
}
+
void HoverOrigin::checkGametype()
{
if (getGametype() != nullptr && this->getGametype()->isA(Class(Hover)))
Modified: code/branches/presentationFS16/src/modules/hover/HoverOrigin.h
===================================================================
--- code/branches/presentationFS16/src/modules/hover/HoverOrigin.h 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/hover/HoverOrigin.h 2016-05-26 13:13:51 UTC (rev 11199)
@@ -22,7 +22,7 @@
* Author:
* Manuel Meier
* Co-authors:
- * ...
+ * Tomer Gidron
*
*/
@@ -65,12 +65,88 @@
inline int getCellHeight() const
{ return this->cellHeight_; }
+ inline void setWallTickness(int wallTickness)
+ { this->wallTickness_ = wallTickness; }
+ inline int getWallTickness() const
+ { return this->wallTickness_; }
+
+ //pickup template set and get for destroy hover pickup
+
+ inline void setPickupTemplate(std::string pickupTemplate)
+ { this->pickupTemplate_ = pickupTemplate; }
+ inline std::string getPickupTemplate() const
+ { return this->pickupTemplate_; }
+
+ inline void setPickupRepresentationTemplate(std::string pickupRepresenationaTemplate)
+ { this->pickupRepresentationTemplate_ = pickupRepresenationaTemplate; }
+ inline std::string getPickupRepresentationTemplate() const
+ { return this->pickupRepresentationTemplate_; }
+
+ //pickup template get and set for damage hover pickup
+
+ inline void setPickupTemplateSpeed(std::string pickupTemplateSpeed)
+ { this->pickupTemplateSpeed_ = pickupTemplateSpeed; }
+ inline std::string getPickupTemplateSpeed() const
+ { return this->pickupTemplateSpeed_; }
+
+ inline void setPickupRepresentationTemplateSpeed(std::string pickupRepresenationaTemplateSpeed)
+ { this->pickupRepresentationTemplateSpeed_ = pickupRepresenationaTemplateSpeed; }
+ inline std::string getPickupRepresentationTemplateSpeed() const
+ { return this->pickupRepresentationTemplateSpeed_; }
+
+
+ //pickup template get and set for shrink hover pickup
+
+ inline void setPickupTemplateShrink(std::string pickupTemplateShrink)
+ { this->pickupTemplateShrink_ = pickupTemplateShrink; }
+ inline std::string getPickupTemplateShrink() const
+ { return this->pickupTemplateShrink_; }
+
+ inline void setPickupRepresentationTemplateShrink(std::string pickupRepresenationaTemplateShrink)
+ { this->pickupRepresentationTemplateShrink_ = pickupRepresenationaTemplateShrink; }
+ inline std::string getPickupRepresentationTemplateShrink() const
+ { return this->pickupRepresentationTemplateShrink_; }
+
+ //get and set for obstacle template
+
+ inline void setObstacleTemplate(std::string obstacleTemplate)
+ { this->obstacleTemplate_ = obstacleTemplate; }
+ inline std::string getObstacleTemplate() const
+ { return this->obstacleTemplate_; }
+
+ //get and set for ground template
+
+ inline void setGroundTemplate(std::string groundTemplate)
+ { this->groundTemplate_ = groundTemplate; }
+ inline std::string getGroundTemplate() const
+ { return this->groundTemplate_; }
+
private:
void checkGametype();
+
int numCells_;
int cellSize_;
int cellHeight_;
+ int wallThickness_;
+
+ // Tempaltes for the destroy hover pickup
+ std::string pickupTemplate_;
+ std::string pickupRepresentationTemplate_;
+
+ // Tempaltes for the damage hover pickup
+ std::string pickupTemplateSpeed_;
+ std::string pickupRepresentationTemplateSpeed_;
+
+ // Tempaltes for the shrink hover pickup
+ std::string pickupTemplateShrink_;
+ std::string pickupRepresentationTemplateShrink_;
+
+ //Template for crate obstacle
+ std::string obstacleTemplate_;
+
+ //Template for ground cell
+ std::string groundTemplate_;
};
}
Modified: code/branches/presentationFS16/src/modules/hover/HoverShip.cc
===================================================================
--- code/branches/presentationFS16/src/modules/hover/HoverShip.cc 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/hover/HoverShip.cc 2016-05-26 13:13:51 UTC (rev 11199)
@@ -32,6 +32,8 @@
#include "HoverShip.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
+#include "Hover.h"
+//#include "NewHumanController.h"
#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
@@ -111,6 +113,7 @@
void HoverShip::boost(bool bBoost) {
if (bBoost && this->isFloor_)
{
+
this->setVelocity(
this->getVelocity().x,
jumpBoost_,
@@ -119,4 +122,20 @@
this->isFloor_ = false;
}
}
+
+ Hover* HoverShip::getGame()
+ {
+ if (game == nullptr)
+ {
+ for (Hover* hover : ObjectList<Hover>())
+ game = hover;
+ }
+ return game;
+ }
+
+ void HoverShip::death()
+ {
+ getGame()->costLife();
+ SpaceShip::death();
+ }
}
Modified: code/branches/presentationFS16/src/modules/hover/HoverShip.h
===================================================================
--- code/branches/presentationFS16/src/modules/hover/HoverShip.h 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/hover/HoverShip.h 2016-05-26 13:13:51 UTC (rev 11199)
@@ -33,6 +33,7 @@
#define _HoverShip_H__
#include "HoverPrereqs.h"
+#include "Hover.h"
#include "worldentities/pawns/SpaceShip.h"
@@ -68,7 +69,12 @@
virtual void boost(bool bBoost) override;
+ protected:
+ virtual void death() override;
+
private:
+ Hover* getGame();
+ WeakPtr<Hover> game;
float jumpBoost_;
bool isFloor_;
};
Copied: code/branches/presentationFS16/src/modules/hover/TFlagsLivesLevelHUD.cc (from rev 11197, code/branches/tgidronFS16/src/modules/hover/TFlagsLivesLevelHUD.cc)
===================================================================
--- code/branches/presentationFS16/src/modules/hover/TFlagsLivesLevelHUD.cc (rev 0)
+++ code/branches/presentationFS16/src/modules/hover/TFlagsLivesLevelHUD.cc 2016-05-26 13:13:51 UTC (rev 11199)
@@ -0,0 +1,122 @@
+/*
+ * 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:
+ * Tomer Gidron
+ *
+ */
+
+#include "TFlagsLivesLevelHUD.h"
+#include "HoverFlag.h"
+#include "Hover.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "util/Convert.h"
+
+namespace orxonox
+{
+ RegisterClass(TFlagsLivesLevelHUD);
+
+ TFlagsLivesLevelHUD::TFlagsLivesLevelHUD(Context* context) : OverlayText(context)
+ {
+ RegisterObject(TFlagsLivesLevelHUD);
+
+ this->hoverGame_ = nullptr;
+ this->totFlags_ = 0;
+ showLives_ = true;
+ showLevel_ = true;
+ showTotFlags_= true;
+ levelUpgrade_ = true;
+ }
+
+ void TFlagsLivesLevelHUD::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(TFlagsLivesLevelHUD, XMLPort, xmlelement, mode);
+
+ XMLPortParam(TFlagsLivesLevelHUD,"showPoints", setShowTot, getShowTot, xmlelement, mode);
+ XMLPortParam(TFlagsLivesLevelHUD, "showLives", setShowLives, getShowLives, xmlelement, mode);
+ XMLPortParam(TFlagsLivesLevelHUD, "showLevel", setShowLevel, getShowLevel, xmlelement, mode);
+ XMLPortParam(TFlagsLivesLevelHUD, "levelUpgrade", setLevelUpgrade, getLevelUpgrade, xmlelement, mode);
+ }
+
+ void TFlagsLivesLevelHUD::tick(float dt)
+ {
+ SUPER(TFlagsLivesLevelHUD, tick, dt);
+
+ const std::string& flags = multi_cast<std::string>(this->hoverGame_->getTotFlags());
+ const std::string& lives = multi_cast<std::string>(this->hoverGame_->getLives());
+ const std::string& level = multi_cast<std::string>(this->hoverGame_->getLevel());
+
+ //Display total Flags taken
+ if(showTotFlags_ == true){
+ setTextSize(0.04);
+ setPosition(Vector2(0.18, 0.08));
+ this->setColour(ColourValue(1, 1, 1, 1));
+ this->setCaption(flags);
+ }
+
+ //Display remaining lives
+ if(showLives_ == true){
+ setTextSize(0.04);
+ setPosition(Vector2(0.18, 0.12));
+ this->setColour(ColourValue(1, 1, 1, 1));
+ this->setCaption(lives);
+ }
+
+ //Display current level
+ if(showLevel_ == true){
+ setTextSize(0.04);
+ setPosition(Vector2(0.18, 0.16));
+ this->setColour(ColourValue(1, 1, 1, 1));
+ this->setCaption(level);
+
+ }
+
+ //New Level pop up
+ if(this->hoverGame_->bLevelUpgradeHUD && levelUpgrade_)
+ {
+ setTextSize(0.2);
+ setPosition(Vector2(0.3, 0.45));
+ std::stringstream sstm;
+ sstm << "Level " << level;
+ this->setCaption(sstm.str());
+
+ //TODO
+ //make others stop blinking when new level pop-up is activated
+ }
+
+ }
+
+ void TFlagsLivesLevelHUD::changedOwner()
+ {
+ SUPER(TFlagsLivesLevelHUD, changedOwner);
+
+ if (this->getOwner() && this->getOwner()->getGametype())
+ {
+ this->hoverGame_ = orxonox_cast<Hover*>(this->getOwner()->getGametype());
+ }
+ else
+ {
+ this->hoverGame_ = nullptr;
+ }
+ }
+}
Copied: code/branches/presentationFS16/src/modules/hover/TFlagsLivesLevelHUD.h (from rev 11197, code/branches/tgidronFS16/src/modules/hover/TFlagsLivesLevelHUD.h)
===================================================================
--- code/branches/presentationFS16/src/modules/hover/TFlagsLivesLevelHUD.h (rev 0)
+++ code/branches/presentationFS16/src/modules/hover/TFlagsLivesLevelHUD.h 2016-05-26 13:13:51 UTC (rev 11199)
@@ -0,0 +1,105 @@
+/*
+ * 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:
+ * Tomer Gidron
+ *
+ */
+
+ /**
+ @file TFlagsLivesLevelHUD.h
+ @brief Declaration of the TFlagsLivesLevelHUD class.
+*/
+
+#ifndef _TFlagsLivesLevelHUD_H__
+#define _TFlagsLivesLevelHUD_H__
+
+
+#include "HoverPrereqs.h"
+
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayText.h"
+
+namespace orxonox
+{
+ class _HoverExport TFlagsLivesLevelHUD : public OverlayText, public Tickable
+ {
+ public:
+ TFlagsLivesLevelHUD(Context* context);
+
+ virtual void tick(float dt) override;
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+ virtual void changedOwner() override;
+
+ /// sets TOTAL flags taken
+ inline void setShowTot(int totFlags)
+ { this->totFlags_ = totFlags; }
+ /// returns TOTAL flags >=0
+ inline int getShowTot() const
+ { return this->totFlags_; }
+
+ /// sets show tot lives
+ void setShowLives(const bool showLives)
+ { showLives_ = showLives; }
+ /// gets show tot lives
+ const bool getShowLives() const
+ { return showLives_; }
+
+ /// sets show level
+ void setShowLevel(const bool showLevel)
+ { showLevel_ = showLevel; }
+ /// gets show level
+ const bool getShowLevel() const
+ { return showLevel_; }
+
+ /// sets show tot flags
+ void setShowTotFlags(const bool showTotFlags)
+ { showTotFlags_ = showTotFlags; }
+ /// gets show tot flags
+ const bool getShowTotFlags() const
+ { return showTotFlags_; }
+
+ /// sets Game Level
+ inline void setTotLevel(int totLevel)
+ { this->totLevel_ = totLevel; }
+ /// returns level >=0
+ inline int getTotLevel() const
+ { return this->totLevel_; }
+
+ /// sets level Upgrade
+ void setLevelUpgrade(const bool levelUpgrade)
+ { levelUpgrade_ = levelUpgrade; }
+ /// gets level Upgrade
+ const bool getLevelUpgrade() const
+ { return levelUpgrade_; }
+
+
+ private:
+ Hover* hoverGame_;
+ int totFlags_;
+ int totLevel_;
+ bool showLives_;
+ bool showLevel_;
+ bool showTotFlags_;
+ bool levelUpgrade_;
+ };
+}
+#endif /* _TFlagsLivesLevelHUD_H__ */
\ No newline at end of file
Modified: code/branches/presentationFS16/src/modules/invader/Invader.cc
===================================================================
--- code/branches/presentationFS16/src/modules/invader/Invader.cc 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/invader/Invader.cc 2016-05-26 13:13:51 UTC (rev 11199)
@@ -70,7 +70,7 @@
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)));
+ comboTimer.setTimer(3.0f, false, createExecutor(createFunctor(&Invader::comboControll, this)));
this->setHUDTemplate("InvaderHUD");
}
Modified: code/branches/presentationFS16/src/modules/pickup/PickupSpawner.h
===================================================================
--- code/branches/presentationFS16/src/modules/pickup/PickupSpawner.h 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/pickup/PickupSpawner.h 2016-05-26 13:13:51 UTC (rev 11199)
@@ -113,6 +113,26 @@
inline Template* getPickupTemplate() const
{return this->pickupTemplate_; }
+
+ void setPickupTemplateName(const std::string& name);
+ void setPickupTemplate(Template* temp);
+
+
+/**
+ @brief Set the distance in which to trigger.
+ @param value The new distance in which to trigger.
+ */
+ inline void setTriggerDistance(float value)
+ { this->triggerDistance_ = value; }
+ /**
+ @brief Set the time to respawn.
+ @param time New time after which this gets re-actived.
+ */
+ inline void setRespawnTime(float time)
+ { this->respawnTime_ = time; }
+
+ void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items.
+
private:
void initialize(void);
@@ -130,24 +150,10 @@
void block(PickupCarrier* carrier, unsigned int time = DEFAULT_BLOCKED_TIME)
{ this->blocked_.insert(std::pair<PickupCarrier*, std::time_t>(carrier, std::time(0)+time)); }
- /**
- @brief Set the distance in which to trigger.
- @param value The new distance in which to trigger.
- */
- inline void setTriggerDistance(float value)
- { this->triggerDistance_ = value; }
- /**
- @brief Set the time to respawn.
- @param time New time after which this gets re-actived.
- */
- inline void setRespawnTime(float time)
- { this->respawnTime_ = time; }
+
+
- void setMaxSpawnedItems(int items); //!< Sets the maximum number of spawned items.
- void setPickupTemplateName(const std::string& name);
- void setPickupTemplate(Template* temp);
-
Pickupable* createPickup(void); //!< Creates a new Pickupable.
void setPickupable(Pickupable* pickup); //!< Sets a Pickupable for the PickupSpawner to spawn.
Modified: code/branches/presentationFS16/src/modules/weapons/weaponmodes/HsW01.cc
===================================================================
--- code/branches/presentationFS16/src/modules/weapons/weaponmodes/HsW01.cc 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/weapons/weaponmodes/HsW01.cc 2016-05-26 13:13:51 UTC (rev 11199)
@@ -84,6 +84,7 @@
XMLPortParam(HsW01, "material", setMaterial, getMaterial, xmlelement, mode);
XMLPortParam(HsW01, "projectileMesh", setMesh, getMesh, xmlelement, mode);
XMLPortParam(HsW01, "sound", setSound, getSound, xmlelement, mode);
+ XMLPortParam(HsW01, "speed", setSpeed, getSpeed, xmlelement, mode);
}
/**
Modified: code/branches/presentationFS16/src/modules/weapons/weaponmodes/HsW01.h
===================================================================
--- code/branches/presentationFS16/src/modules/weapons/weaponmodes/HsW01.h 2016-05-26 13:12:04 UTC (rev 11198)
+++ code/branches/presentationFS16/src/modules/weapons/weaponmodes/HsW01.h 2016-05-26 13:13:51 UTC (rev 11199)
@@ -111,6 +111,22 @@
virtual void shot();
void muzzleflash();
+ /**
+ @brief Set the firing speed.
+ @param speed The speed of the shot
+ */
+
+ void setSpeed(const float speed)
+ { this->speed_ = speed; }
+
+ /**
+ @brief Get the firing speed.
+ @return Returns the speed of the shot
+ */
+
+ const float getSpeed() const
+ { return this->speed_; }
+
std::string material_; //!< The material.
std::string mesh_; //!< The mesh.
std::string sound_; //!< The sound.
More information about the Orxonox-commit
mailing list