[Orxonox-commit 5448] r10111 - code/branches/pickupsFS14/src/modules/jump
fvultier at orxonox.net
fvultier at orxonox.net
Wed Nov 5 16:06:09 CET 2014
Author: fvultier
Date: 2014-11-05 16:06:09 +0100 (Wed, 05 Nov 2014)
New Revision: 10111
Modified:
code/branches/pickupsFS14/src/modules/jump/Jump.cc
code/branches/pickupsFS14/src/modules/jump/Jump.h
code/branches/pickupsFS14/src/modules/jump/JumpBoots.cc
code/branches/pickupsFS14/src/modules/jump/JumpBoots.h
code/branches/pickupsFS14/src/modules/jump/JumpCenterpoint.cc
code/branches/pickupsFS14/src/modules/jump/JumpCenterpoint.h
code/branches/pickupsFS14/src/modules/jump/JumpEnemy.cc
code/branches/pickupsFS14/src/modules/jump/JumpEnemy.h
code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc
code/branches/pickupsFS14/src/modules/jump/JumpFigure.h
code/branches/pickupsFS14/src/modules/jump/JumpItem.cc
code/branches/pickupsFS14/src/modules/jump/JumpItem.h
code/branches/pickupsFS14/src/modules/jump/JumpPlatform.cc
code/branches/pickupsFS14/src/modules/jump/JumpPlatform.h
code/branches/pickupsFS14/src/modules/jump/JumpPlatformDisappear.cc
code/branches/pickupsFS14/src/modules/jump/JumpPlatformDisappear.h
code/branches/pickupsFS14/src/modules/jump/JumpPlatformFake.cc
code/branches/pickupsFS14/src/modules/jump/JumpPlatformFake.h
code/branches/pickupsFS14/src/modules/jump/JumpPlatformHMove.cc
code/branches/pickupsFS14/src/modules/jump/JumpPlatformHMove.h
code/branches/pickupsFS14/src/modules/jump/JumpPlatformStatic.cc
code/branches/pickupsFS14/src/modules/jump/JumpPlatformStatic.h
code/branches/pickupsFS14/src/modules/jump/JumpPlatformTimer.cc
code/branches/pickupsFS14/src/modules/jump/JumpPlatformTimer.h
code/branches/pickupsFS14/src/modules/jump/JumpPlatformVMove.cc
code/branches/pickupsFS14/src/modules/jump/JumpPlatformVMove.h
code/branches/pickupsFS14/src/modules/jump/JumpPrereqs.h
code/branches/pickupsFS14/src/modules/jump/JumpProjectile.cc
code/branches/pickupsFS14/src/modules/jump/JumpProjectile.h
code/branches/pickupsFS14/src/modules/jump/JumpPropeller.cc
code/branches/pickupsFS14/src/modules/jump/JumpPropeller.h
code/branches/pickupsFS14/src/modules/jump/JumpRocket.cc
code/branches/pickupsFS14/src/modules/jump/JumpRocket.h
code/branches/pickupsFS14/src/modules/jump/JumpScore.cc
code/branches/pickupsFS14/src/modules/jump/JumpScore.h
code/branches/pickupsFS14/src/modules/jump/JumpShield.cc
code/branches/pickupsFS14/src/modules/jump/JumpShield.h
code/branches/pickupsFS14/src/modules/jump/JumpSpring.cc
code/branches/pickupsFS14/src/modules/jump/JumpSpring.h
Log:
Modified: code/branches/pickupsFS14/src/modules/jump/Jump.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/Jump.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/Jump.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,19 +28,16 @@
/**
@file Jump.cc
- @brief Implementation of the Jump class.
+ @brief This is the gametype for the awesome minigame. Here the level is randomly created, the camera is shifted, ...
*/
#include "Jump.h"
-
#include "core/CoreIncludes.h"
#include "core/EventIncludes.h"
#include "core/command/Executor.h"
#include "core/config/ConfigValueIncludes.h"
-
#include "gamestates/GSLevel.h"
#include "chat/ChatManager.h"
-
#include "JumpCenterpoint.h"
#include "JumpPlatform.h"
#include "JumpPlatformStatic.h"
@@ -58,21 +55,12 @@
#include "JumpPropeller.h"
#include "JumpBoots.h"
#include "JumpShield.h"
-
#include "infos/PlayerInfo.h"
namespace orxonox
{
- // Events to allow to react to scoring of a player, in the level-file.
- CreateEventName(JumpCenterpoint, right);
- CreateEventName(JumpCenterpoint, left);
-
RegisterUnloadableClass(Jump);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
Jump::Jump(Context* context) : Deathmatch(context)
{
RegisterObject(Jump);
@@ -80,17 +68,11 @@
center_ = 0;
figure_ = 0;
camera = 0;
-
setHUDTemplate("JumpHUD");
- scoreLimit_ = 10;
setConfigValues();
}
- /**
- @brief
- Destructor. Cleans up, if initialized.
- */
Jump::~Jump()
{
if (isInitialized())
@@ -102,72 +84,65 @@
void Jump::tick(float dt)
{
SUPER(Jump, tick, dt);
+
if (figure_ != NULL)
{
Vector3 figurePosition = figure_->getPosition();
Vector3 figureVelocity = figure_->getVelocity();
- float boundary = totalScreenShift+center_->getCameraOffset();
+ float boundary = totalScreenShift_+center_->getCameraOffset();
if (figurePosition.z > boundary)
{
- screenShiftSinceLastUpdate += figurePosition.z - boundary;
- totalScreenShift = figurePosition.z - center_->getCameraOffset();
+ screenShiftSinceLastUpdate_ += figurePosition.z - boundary;
+ totalScreenShift_ = figurePosition.z - center_->getCameraOffset();
- // Falls noetig neue Platformen im neuen Bereich einfuegen
- if (screenShiftSinceLastUpdate > center_->getSectionLength())
+ // Create new platforms if needed
+ if (screenShiftSinceLastUpdate_ > center_->getSectionLength())
{
- screenShiftSinceLastUpdate -= center_->getSectionLength();
- if (sectionNumber_ > 2 && sectionNumber_%4 == 0 && rand()%2 == 0)
+ if (sectionNumber_ > 2 && sectionNumber_%4 == 0 && rand()%2 == 0 && figure_->propellerActive_ == false && figure_->rocketActive_ == false && addAdventure(adventureNumber_) == true)
{
- if (addAdventure(adventureNumber_) == false)
- {
- addSection();
- }
- else
- {
- ++ adventureNumber_;
- }
+ screenShiftSinceLastUpdate_ -= 2*center_->getSectionLength();
+ ++ adventureNumber_;
}
else
{
+ screenShiftSinceLastUpdate_ -= center_->getSectionLength();
addSection();
}
}
}
- // Spiel verloren wegen Ansturz?
- if (figurePosition.z < totalScreenShift - center_->getFieldDimension().y + platformHeight_ && figureVelocity.z < 0)
+ if (figurePosition.z < totalScreenShift_ - center_->getFieldDimension().y + platformHeight_ && figureVelocity.z < 0)
{
- end();
+ figure_->dead_ = true;
}
- // Schiessen
-
- if (figure_->fireSignal)
+ if (figure_->fireSignal_ == true)
{
- figure_->fireSignal = false;
- addProjectile(figurePosition.x, figurePosition.z + figure_->getPropellerPos());
+ if (figure_->dead_ == true)
+ {
+ end();
+ }
+ else
+ {
+ figure_->fireSignal_ = false;
+ addProjectile(figurePosition.x, figurePosition.z + figure_->getPropellerPos());
+ }
}
if (camera != NULL)
{
- Vector3 cameraPosition = Vector3(0, totalScreenShift, 0);
+ Vector3 cameraPosition = Vector3(0, totalScreenShift_, 0);
camera->setPosition(cameraPosition);
}
else
{
orxout() << "No camera found." << endl;
- //camera = figure_->getCamera();
}
}
- else
- {
- //orxout() << "No figure found." << endl;
- }
- // Platformen, die zu weit unten sind entfernen
ObjectList<JumpPlatform>::iterator beginPlatform = ObjectList<JumpPlatform>::begin();
ObjectList<JumpPlatform>::iterator endPlatform = ObjectList<JumpPlatform>::end();
ObjectList<JumpPlatform>::iterator itPlatform = beginPlatform;
@@ -176,7 +151,7 @@
while (itPlatform != endPlatform)
{
platformPosition = itPlatform->getPosition();
- if (platformPosition.z < totalScreenShift - center_->getFieldDimension().y)
+ if (platformPosition.z < totalScreenShift_ - center_->getFieldDimension().y)
{
ObjectList<JumpPlatform>::iterator temp = itPlatform;
++ itPlatform;
@@ -189,20 +164,7 @@
}
}
- // DAS GEHT NICHT!!! it++ funktioniert nicht, falls eine Platform geloescht wurde -> Segmentation Error
- /*
- for (ObjectList<JumpPlatformDisappear>::iterator it = ObjectList<JumpPlatformDisappear>::begin(); orxout() << "E" << endl, it != ObjectList<JumpPlatformDisappear>::end(); orxout() << "F" << endl, ++it)
- {
- if (!it->isActive())
- {
- // Entferne Platform
- center_->detach(*it);
- it->destroy();
- }
- }
- */
-
- // Deaktivierte Platformen entfernen
+ // Deleted deactivated platforms
ObjectList<JumpPlatformDisappear>::iterator beginDisappear = ObjectList<JumpPlatformDisappear>::begin();
ObjectList<JumpPlatformDisappear>::iterator endDisappear = ObjectList<JumpPlatformDisappear>::end();
ObjectList<JumpPlatformDisappear>::iterator itDisappear = beginDisappear;
@@ -222,7 +184,6 @@
}
}
- // Abgelaufene Timer-Platformen entfernen
ObjectList<JumpPlatformTimer>::iterator beginTimer = ObjectList<JumpPlatformTimer>::begin();
ObjectList<JumpPlatformTimer>::iterator endTimer = ObjectList<JumpPlatformTimer>::end();
ObjectList<JumpPlatformTimer>::iterator itTimer = beginTimer;
@@ -242,7 +203,6 @@
}
}
- // Projektile, die zu weit oben sind entfernen
ObjectList<JumpProjectile>::iterator beginProjectile = ObjectList<JumpProjectile>::begin();
ObjectList<JumpProjectile>::iterator endProjectile = ObjectList<JumpProjectile>::end();
ObjectList<JumpProjectile>::iterator itProjectile = beginProjectile;
@@ -251,7 +211,7 @@
while (itProjectile != endProjectile)
{
projectilePosition = itProjectile->getPosition();
- if (projectilePosition.z > totalScreenShift + 5*center_->getFieldDimension().y)
+ if (projectilePosition.z > totalScreenShift_ + 5*center_->getFieldDimension().y)
{
ObjectList<JumpProjectile>::iterator temp = itProjectile;
++ itProjectile;
@@ -264,7 +224,6 @@
}
}
- // Gegner, die zu weit unten oder abgeschossen sind entfernen
ObjectList<JumpEnemy>::iterator beginEnemy = ObjectList<JumpEnemy>::begin();
ObjectList<JumpEnemy>::iterator endEnemy = ObjectList<JumpEnemy>::end();
ObjectList<JumpEnemy>::iterator itEnemy = beginEnemy;
@@ -273,7 +232,7 @@
while (itEnemy != endEnemy)
{
enemyPosition = itEnemy->getPosition();
- if (enemyPosition.z < totalScreenShift - center_->getFieldDimension().y || itEnemy->dead_ == true)
+ if (enemyPosition.z < totalScreenShift_ - center_->getFieldDimension().y || itEnemy->dead_ == true)
{
ObjectList<JumpEnemy>::iterator temp = itEnemy;
++ itEnemy;
@@ -286,7 +245,6 @@
}
}
- // Items, die zu weit unten sind entfernen
ObjectList<JumpItem>::iterator beginItem = ObjectList<JumpItem>::begin();
ObjectList<JumpItem>::iterator endItem = ObjectList<JumpItem>::end();
ObjectList<JumpItem>::iterator itItem = beginItem;
@@ -298,7 +256,7 @@
WorldEntity* parent = itItem->getParent();
- if (itItem->attachedToFigure_ == false && itemPosition.z < totalScreenShift - center_->getFieldDimension().y && parent == center_)
+ if (itItem->attachedToFigure_ == false && itemPosition.z < totalScreenShift_ - center_->getFieldDimension().y && parent == center_)
{
ObjectList<JumpItem>::iterator temp = itItem;
++ itItem;
@@ -312,22 +270,8 @@
}
}
- void Jump::setConfigValues()
- {
- SetConfigValue(scoreLimit_, 10).description("The player first reaching those points wins.");
- }
-
- /**
- @brief
- Cleans up the Gametype by destroying the ball and the bats.
- */
void Jump::cleanup()
{
- if (figure_ != NULL)
- {
- //this->figure_->destroy();
- //this->figure_ = 0;
- }
camera = 0;
}
@@ -353,23 +297,16 @@
return;
}
- // Set variable to temporarily force the player to spawn.
- bool temp = bForceSpawn_;
- bForceSpawn_ = true;
-
// Call start for the parent class.
Deathmatch::start();
- // Reset the variable.
- bForceSpawn_ = temp;
-
if (figure_ != NULL)
{
camera = figure_->getCamera();
}
- totalScreenShift = 0.0;
- screenShiftSinceLastUpdate = 0.0;
+ totalScreenShift_ = 0.0;
+ screenShiftSinceLastUpdate_ = 0.0;
sectionNumber_ = 0;
adventureNumber_ = 0;
@@ -378,61 +315,25 @@
addSection();
}
- /**
- @brief
- Ends the Jump minigame.
- */
void Jump::end()
{
cleanup();
GSLevel::startMainMenu();
- // Call end for the parent class.
Deathmatch::end();
}
- /**
- @brief
- Spawns the input player.
- @param player
- The player to be spawned.
- */
void Jump::spawnPlayer(PlayerInfo* player)
{
assert(player);
- // If the first (left) bat has no player.
- if (this->figure_->getPlayer() == NULL)
+ if (figure_->getPlayer() == NULL)
{
- player->startControl(this->figure_);
- this->players_[player].state_ = PlayerState::Alive;
+ player->startControl(figure_);
+ players_[player].state_ = PlayerState::Alive;
}
}
- /**
- @brief
- Is called when the player scored.
- */
- void Jump::playerScored(PlayerInfo* player, int score)
- {
-
- }
-
- /**
- @brief
- Starts the ball with some default speed.
- */
- void Jump::startBall()
- {
-
- }
-
- /**
- @brief
- Get the left player.
- @return
- Returns a pointer to the player playing on the left. If there is no left player, NULL is returned.
- */
PlayerInfo* Jump::getPlayer() const
{
if (this->figure_ != NULL)
@@ -493,7 +394,7 @@
JumpPlatformTimer* Jump::addPlatformTimer(float xPosition, float zPosition, float time, float variance)
{
- float additionalTime = (float)(rand()%100)/(100*variance) - variance/2;
+ float additionalTime = (float)(rand()%100)/100.0*variance - variance/2.0;
JumpPlatformTimer* newPlatform = new JumpPlatformTimer(center_->getContext());
newPlatform->setProperties(time + additionalTime);
@@ -751,23 +652,25 @@
itemType = ITEM_SPRING;
}
else if (rand()%2 == 0 && sectionNumber_ > 3)
- switch(rand()%4)
- {
- case 0:
- itemType = ITEM_PROPELLER;
- break;
- case 1:
- itemType = ITEM_ROCKET;
- break;
- case 2:
- itemType = ITEM_BOOTS;
- break;
- case 3:
- itemType = ITEM_SHIELD;
- break;
- default:
- break;
- }
+ {
+ switch(rand()%4)
+ {
+ case 0:
+ itemType = ITEM_PROPELLER;
+ break;
+ case 1:
+ itemType = ITEM_ROCKET;
+ break;
+ case 2:
+ itemType = ITEM_BOOTS;
+ break;
+ case 3:
+ itemType = ITEM_SHIELD;
+ break;
+ default:
+ break;
+ }
+ }
switch((sectionNumber_ > 28) ? rand()%29 : rand()%(sectionNumber_+1))
{
@@ -893,12 +796,12 @@
break;
}
- // Fill Matrix with selected platform types
+ // Fill matrix with selected platform types
for (int i = 0; i < numI; ++ i)
{
for (int j = 0; j < numJ; ++ j)
{
- if (rand()%(sectionNumber_+1) == 0)
+ if (rand()%3 == 0)
{
matrix[i][j].type = platformtype1;
}
@@ -910,26 +813,71 @@
}
}
- // Delete some platforms or replace them with fake platforms
- if (platformtype1 == platformtype2 && sectionNumber_ > 10)
+ if (platformtype1 == platformtype2 && sectionNumber_ > 10 && rand()%2 == 0)
{
- int j = rand()%numJ;
- if (rand()%2 == 0)
- {
- for (int i = 0; i <= j; ++ i)
- {
- matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
- }
- }
- else
- {
- for (int i = 0; i <= j; ++ i)
- {
- matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
- }
- }
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
}
+ // Delete some planned platforms or replace them with fake platforms
+ if (sectionNumber_ > 5)
+ {
+ if (rand()%2 == 0)
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
+ }
+ else
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
+ }
+ }
+ else if (sectionNumber_ > 10)
+ {
+ if (rand()%2 == 0)
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
+ }
+ else
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
+ }
+ if (rand()%2 == 0)
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
+ }
+ else
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
+ }
+ }
+ else if (sectionNumber_ > 15)
+ {
+ if (rand()%2 == 0)
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
+ }
+ else
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
+ }
+ if (rand()%2 == 0)
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
+ }
+ else
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
+ }
+ if (rand()%2 == 0)
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
+ }
+ else
+ {
+ matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
+ }
+ }
+
std::vector<JumpPlatform*> platformList;
for (int i = 0; i < numI; ++ i)
@@ -967,7 +915,7 @@
case PLATFORM_TIMER:
xPosition = randomXPosition(numJ, j);
zPosition = sectionBegin + i*sectionLength/numI;
- platformList.push_back(addPlatformTimer(xPosition, zPosition, 10.0, 1.5));
+ platformList.push_back(addPlatformTimer(xPosition, zPosition, 12.0, 1.5));
matrix[i][j].done = true;
break;
case PLATFORM_DISAPPEAR:
@@ -1043,40 +991,10 @@
}
break;
default:
- // ERROR
+ //ERROR
break;
}
-
- /*if (platformtype1 != PLATFORM_TIMER && platformtype2 != PLATFORM_TIMER)
- {
- switch (itemType)
- {
- case ITEM_SPRING:
- addSpring(xPosition, zPosition, leftBoundary, rightBoundary, lowerBoundary, upperBoundary, xVelocity, zVelocity);
- itemType = ITEM_NOTHING;
- break;
- case ITEM_ROCKET:
- addRocket(xPosition, zPosition, leftBoundary, rightBoundary, lowerBoundary, upperBoundary, xVelocity, zVelocity);
- itemType = ITEM_NOTHING;
- break;
- case ITEM_PROPELLER:
- addPropeller(xPosition, zPosition, leftBoundary, rightBoundary, lowerBoundary, upperBoundary, xVelocity, zVelocity);
- itemType = ITEM_NOTHING;
- break;
- case ITEM_BOOTS:
- addBoots(xPosition, zPosition, leftBoundary, rightBoundary, lowerBoundary, upperBoundary, xVelocity, zVelocity);
- itemType = ITEM_NOTHING;
- break;
- case ITEM_SHIELD:
- addShield(xPosition, zPosition, leftBoundary, rightBoundary, lowerBoundary, upperBoundary, xVelocity, zVelocity);
- itemType = ITEM_NOTHING;
- break;
- default:
- // ERROR
- break;
- }
- }*/
}
}
}
@@ -1084,50 +1002,93 @@
//Add items
int numNewPlatforms = platformList.size();
- if (numNewPlatforms > 0)
+ if (rand()%4 == 0)
{
- JumpPlatform* itemPlatform = platformList[rand()%numNewPlatforms];
-
- switch (ITEM_BOOTS)
+ if (rand()%2 == 0)
{
- case ITEM_SPRING:
- addSpring(itemPlatform);
- break;
- case ITEM_ROCKET:
- addRocket(itemPlatform);
- break;
- case ITEM_PROPELLER:
- addPropeller(itemPlatform);
- break;
- case ITEM_BOOTS:
- addBoots(itemPlatform);
- break;
- case ITEM_SHIELD:
- addShield(itemPlatform);
- break;
- default:
- break;
+ switch (itemType)
+ {
+ case ITEM_ROCKET:
+ addRocket(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
+ break;
+ case ITEM_PROPELLER:
+ addPropeller(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
+ break;
+ case ITEM_BOOTS:
+ addBoots(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
+ break;
+ case ITEM_SHIELD:
+ addShield(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
+ break;
+ default:
+ break;
+ }
}
+ else
+ {
+ switch (itemType)
+ {
+ case ITEM_ROCKET:
+ addRocket(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
+ break;
+ case ITEM_PROPELLER:
+ addPropeller(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
+ break;
+ case ITEM_BOOTS:
+ addBoots(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
+ break;
+ case ITEM_SHIELD:
+ addShield(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
+ break;
+ default:
+ break;
+ }
+ }
}
+ else
+ {
+ if (numNewPlatforms > 0)
+ {
+ JumpPlatform* itemPlatform = platformList[rand()%numNewPlatforms];
+ switch (itemType)
+ {
+ case ITEM_SPRING:
+ addSpring(itemPlatform);
+ break;
+ case ITEM_ROCKET:
+ addRocket(itemPlatform);
+ break;
+ case ITEM_PROPELLER:
+ addPropeller(itemPlatform);
+ break;
+ case ITEM_BOOTS:
+ addBoots(itemPlatform);
+ break;
+ case ITEM_SHIELD:
+ addShield(itemPlatform);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
if (sectionNumber_ >= 5 && rand()%3 == 0)
{
- // BEWEGUNG Verbessern, Grenzen anpassen !!!!!!!! Auch Vertikale Bewegung zulassen
-
-
switch(rand()%4)
{
case 0:
- addEnemy(1, randomXPosition(), randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth, fieldWidth, sectionBegin, sectionBegin + sectionLength, 5.0, 0.0);
+ addEnemy(1, randomXPosition(), randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/3*2, fieldWidth/3*2, sectionBegin, sectionBegin + sectionLength, randomSpeed(), 0.0);
break;
case 1:
- addEnemy(2, randomXPosition(), randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth, fieldWidth, sectionBegin, sectionBegin + sectionLength, 5.0, 0.0);
+ addEnemy(2, randomXPosition(), randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/3*2, fieldWidth/3*2, sectionBegin, sectionBegin + sectionLength, randomSpeed(), 0.0);
break;
case 2:
- addEnemy(3, randomXPosition(), randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth, fieldWidth, sectionBegin, sectionBegin + sectionLength, 5.0, 0.0);
+ addEnemy(3, randomXPosition(), randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/3*2, fieldWidth/3*2, sectionBegin, sectionBegin + sectionLength, randomSpeed(), 0.0);
break;
case 3:
- addEnemy(4, randomXPosition(), randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth, fieldWidth, sectionBegin, sectionBegin + sectionLength, 5.0, 0.0);
+ addEnemy(4, randomXPosition(), randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/3*2, fieldWidth/3*2, sectionBegin, sectionBegin + sectionLength, randomSpeed(), 0.0);
break;
}
}
@@ -1146,10 +1107,20 @@
case 0:
{
int numI = 10;
- for (int i = 0; i < numI; ++ i)
+ if (rand()%2 == 0)
{
- addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth+platformWidth_/2, sectionBegin+i*sectionLength/numI);
+ for (int i = 0; i < numI; ++ i)
+ {
+ addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth+platformWidth_/2, sectionBegin+i*sectionLength/numI);
+ }
}
+ else
+ {
+ for (int i = 0; i < numI; ++ i)
+ {
+ addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth+platformWidth_/2, sectionBegin+(numI-i)*sectionLength/numI);
+ }
+ }
break;
}
case 1:
@@ -1157,27 +1128,51 @@
int numI = 7;
addPlatformStatic(0.0, sectionBegin);
- for (int i = 1; i < numI; ++ i)
+ if (rand()%2 == 0)
{
- addPlatformStatic((fieldWidth-platformWidth_/2)*i/numI, sectionBegin+i*sectionLength/numI);
- addPlatformStatic(-(fieldWidth-platformWidth_/2)*i/numI, sectionBegin+i*sectionLength/numI);
+ for (int i = 1; i < numI; ++ i)
+ {
+ addPlatformStatic((fieldWidth-platformWidth_/2)*i/numI, sectionBegin+i*sectionLength/numI);
+ addPlatformStatic(-(fieldWidth-platformWidth_/2)*i/numI, sectionBegin+i*sectionLength/numI);
+ }
}
+ else
+ {
+ for (int i = 1; i < numI; ++ i)
+ {
+ addPlatformStatic((fieldWidth-platformWidth_/2)*i/numI, sectionBegin+(numI-i)*sectionLength/numI);
+ addPlatformStatic(-(fieldWidth-platformWidth_/2)*i/numI, sectionBegin+(numI-i)*sectionLength/numI);
+ }
+ }
break;
}
case 2:
{
int numI = 5;
- for (int i = 0; i < numI; ++ i)
+ for (int i = 0; i <= numI; ++ i)
{
- addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth+platformWidth_/2, sectionBegin);
- addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth+platformWidth_/2, sectionBegin+sectionLength/5);
- addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth+platformWidth_/2, sectionBegin+sectionLength*2/5);
- addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth+platformWidth_/2, sectionBegin+sectionLength*3/5);
- addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth+platformWidth_/2, sectionBegin+sectionLength*4/5);
+ addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth, sectionBegin);
+ addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth, sectionBegin+sectionLength/5);
+ addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth, sectionBegin+sectionLength*2/5);
+ addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth, sectionBegin+sectionLength*3/5);
+ addPlatformStatic((2*fieldWidth-platformWidth_)*i/numI-fieldWidth, sectionBegin+sectionLength*4/5);
addEnemy(4, (2*fieldWidth-platformWidth_)*i/numI-fieldWidth+platformWidth_/2, sectionBegin+sectionLength/2, -fieldWidth, fieldWidth, sectionBegin, sectionBegin + sectionLength, 0.0, 0.0);
}
break;
}
+ case 3:
+ {
+ addRocket(addPlatformStatic(0.0, sectionBegin));
+ addEnemy(2, 0.0, sectionBegin+sectionLength/5, 0.0,0.0, 0.0, 0.0, 0.0, 0.0);
+ break;
+ }
+ case 4:
+ {
+ addPropeller(addPlatformStatic(0.0, sectionBegin));
+ addPropeller(addPlatformStatic(-fieldWidth/2, sectionBegin));
+ addPropeller(addPlatformStatic(fieldWidth/2, sectionBegin));
+ break;
+ }
default:
return false;
}
@@ -1194,10 +1189,10 @@
float Jump::randomXPosition(int totalColumns, int culomn)
{
- float fieldWidth = center_->getFieldDimension().x; //Width of the half field
+ float fieldWidth = center_->getFieldDimension().x;
- float halfWidth = fieldWidth/totalColumns; //Width of a half column
- float leftBound = culomn*halfWidth*2-fieldWidth; //Left beginning of the column
+ float halfWidth = fieldWidth/totalColumns;
+ float leftBound = culomn*halfWidth*2-fieldWidth;
float rightBound = leftBound + 2*halfWidth;
return randomPosition(leftBound+platformWidth_/2, rightBound-platformWidth_/2);
@@ -1205,10 +1200,10 @@
float Jump::randomXPositionLeft(int totalColumns, int culomn)
{
- float fieldWidth = center_->getFieldDimension().x; //Width of the half field
+ float fieldWidth = center_->getFieldDimension().x;
- float halfWidth = fieldWidth/totalColumns; //Width of a half column
- float leftBound = culomn*halfWidth*2-fieldWidth; //LeftBeginning of the column
+ float halfWidth = fieldWidth/totalColumns;
+ float leftBound = culomn*halfWidth*2-fieldWidth;
float rightBound = leftBound + 2*halfWidth/3;
return randomPosition(leftBound+platformWidth_/2, rightBound-platformWidth_/2);
@@ -1216,9 +1211,9 @@
float Jump::randomXPositionRight(int totalColumns, int culomn)
{
- float fieldWidth = center_->getFieldDimension().x; //Width of the half field
+ float fieldWidth = center_->getFieldDimension().x;
- float halfWidth = fieldWidth/totalColumns; //Width of a half column
+ float halfWidth = fieldWidth/totalColumns;
float rightBound = (culomn+1)*halfWidth*2-fieldWidth;
float leftBound = rightBound - 2*halfWidth/3;
return randomPosition(leftBound+platformWidth_/2, rightBound-platformWidth_/2);
@@ -1226,9 +1221,9 @@
float Jump::randomZPosition(int totalRows, int row, float sectionBegin, float SectionEnd)
{
- float fieldHeight = SectionEnd - sectionBegin; //Heigt of the half field
- float halfHeight = fieldHeight/totalRows; //Height of a half row
- float lowerBound = row*halfHeight*2+sectionBegin; //Lower beginning of the row
+ float fieldHeight = SectionEnd - sectionBegin;
+ float halfHeight = fieldHeight/totalRows;
+ float lowerBound = row*halfHeight*2+sectionBegin;
float upperBound = lowerBound + 2*halfHeight;
return randomPosition(lowerBound+platformHeight_/2, upperBound-platformHeight_/2);
@@ -1236,9 +1231,9 @@
float Jump::randomZPositionLower(int totalRows, int row, float sectionBegin, float SectionEnd)
{
- float fieldHeight = SectionEnd - sectionBegin; //Heigt of the half field
- float rowHeight = fieldHeight/totalRows; //Height of a row
- float lowerBound = row*rowHeight+sectionBegin; //Lower beginning of the row
+ float fieldHeight = SectionEnd - sectionBegin;
+ float rowHeight = fieldHeight/totalRows;
+ float lowerBound = row*rowHeight+sectionBegin;
float upperBound = lowerBound + rowHeight/3;
return randomPosition(lowerBound+platformHeight_/2, upperBound-platformHeight_/2);
@@ -1246,9 +1241,9 @@
float Jump::randomZPositionUpper(int totalRows, int row, float sectionBegin, float SectionEnd)
{
- float fieldHeight = SectionEnd - sectionBegin; //Heigt of the half field
- float rowHeight = fieldHeight/totalRows; //Height of a row
- float lowerBound = (row+1)*rowHeight+sectionBegin; //Upper end of the row
+ float fieldHeight = SectionEnd - sectionBegin;
+ float rowHeight = fieldHeight/totalRows;
+ float lowerBound = (row+1)*rowHeight+sectionBegin;
float upperBound = lowerBound - rowHeight/3;
return randomPosition(lowerBound+platformHeight_/2, upperBound-platformHeight_/2);
Modified: code/branches/pickupsFS14/src/modules/jump/Jump.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/Jump.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/Jump.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -26,78 +26,36 @@
*
*/
-/**
- @file Jump.h
- @brief Declaration of the Jump class.
- @ingroup Jump
-*/
-
#ifndef _Jump_H__
#define _Jump_H__
#include "jump/JumpPrereqs.h"
-
#include "tools/Timer.h"
#include "graphics/Camera.h"
-
#include "gametypes/Deathmatch.h"
#include "JumpCenterpoint.h"
-
#include <list>
namespace orxonox
{
-
- /**
- @brief
- Implements a Jump minigame (<a href="http://en.wikipedia.org/wiki/Jump">Wikipedia::Jump</a>).
- It connects the different entities present in a game of Jump.
-
- - The @ref orxonox::JumpCenterpoint "JumpCenterpoint" is the playing field for the Jump minigame, it allows for configuration of the minigame, e.g. by setting the size of the playing field, or the length of the @ref orxonox::JumpFigure "JumpFigures". The playing field is always in the x,y-plane, the x-axis being the horizontal and the z-axis being the vertical axis.<br />
- The Jump class redistributes the important parameters defined in @ref orxonox::JumpCenterpoint "JumpCenterpoint" to the other entities, that need to know them, e.g. the @ref orxonox::JumpPlatform "JumpPlatform" and the @ref orxonox::JumpFigure "JumpFigures".<br />
- The @ref orxonox::JumpCenterpoint "JumpCenterpoint" needs to exist in a level with the @ref orxonox::Gametype "Gametype" <em>Jump</em>.
- - The @ref orxonox::JumpPlatform "JumpPlatform" is the ball both players play with. The @ref orxonox::JumpPlatform "JumpPlatform" both implements the movement of the ball, as well as the influence of the boundaries and consequently, also the bouncing (off the upper and lower delimiters, and as off the @ref orxonox::JumpFigure "JumpFigures") of the ball and the effects of the failure of a player to catch the ball (i.e. the scoring of the other player).
- - The two @ref orxonox::JumpFigure "JumpFigures" are the entities through which the players can actively participate in the game, by controlling them. The @ref orxonox::JumpFigure "JumpFigure" class manages the movement (and restrictions thereof) and the influence of the players on the bats.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport Jump : public Deathmatch
{
public:
- Jump(Context* context); //!< Constructor. Registers and initializes the object.
- virtual ~Jump(); //!< Destructor. Cleans up, if initialized.
-
+ Jump(Context* context);
+ virtual ~Jump();
virtual void tick(float dt);
-
- virtual void start(); //!< Starts the Jump minigame.
- virtual void end(); ///!< Ends the Jump minigame.
-
- virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
-
- virtual void playerScored(PlayerInfo* player, int score = 1); //!< Is called when the player scored.
-
+ virtual void start();
+ virtual void end();
+ virtual void spawnPlayer(PlayerInfo* player);
int getScore(PlayerInfo* player) const;
bool getDead(PlayerInfo* player) const;
-
- /**
- @brief Set the JumpCenterpoint (the playing field).
- @param center A pointer to the JumpCenterpoint to be set.
- */
void setCenterpoint(JumpCenterpoint* center)
{ center_ = center; }
- void setConfigValues(); //!< Makes scoreLimit configurable.
+ PlayerInfo* getPlayer() const;
- PlayerInfo* getPlayer() const; //!< Get the left player.
-
protected:
- void startBall(); //!< Starts the ball with some default speed.
- void cleanup(); //!< Cleans up the Gametype by destroying the ball and the bats.
-
+ void cleanup();
virtual void addPlatform(JumpPlatform* newPlatform, std::string platformTemplate, float xPosition, float zPosition);
-
virtual JumpPlatformStatic* addPlatformStatic(float xPosition, float zPosition);
virtual JumpPlatformHMove* addPlatformHMove(float xPosition, float zPosition, float leftBoundary, float rightBoundary, float speed);
virtual JumpPlatformVMove* addPlatformVMove(float xPosition, float zPosition, float lowerBoundary, float upperBoundary, float speed);
@@ -116,11 +74,9 @@
virtual void addBoots(JumpPlatform* platform);
virtual void addShield(float xPosition, float zPosition, float leftBoundary, float rightBoundary, float lowerBoundary, float upperBoundary, float xVelocity, float zVelocity);
virtual void addShield(JumpPlatform* platform);
-
virtual void addStartSection();
virtual void addSection();
virtual bool addAdventure(int number);
-
virtual float randomXPosition();
virtual float randomXPosition(int totalColumns, int culomn);
virtual float randomXPositionLeft(int totalColumns, int culomn);
@@ -128,17 +84,14 @@
virtual float randomZPosition(int totalRows, int row, float sectionBegin, float SectionEnd);
virtual float randomZPositionLower(int totalRows, int row, float sectionBegin, float SectionEnd);
virtual float randomZPositionUpper(int totalRows, int row, float sectionBegin, float SectionEnd);
-
virtual float randomPosition(float lowerBoundary, float upperBoundary);
virtual float randomSpeed();
- WeakPtr<JumpCenterpoint> center_; //!< The playing field.
- WeakPtr<JumpFigure> figure_; //!< The two bats.
+ WeakPtr<JumpCenterpoint> center_;
+ WeakPtr<JumpFigure> figure_;
WeakPtr<Camera> camera;
- int scoreLimit_; //!< If a player scored that much points, the game is ended.
-
- float totalScreenShift;
- float screenShiftSinceLastUpdate;
+ float totalScreenShift_;
+ float screenShiftSinceLastUpdate_;
int sectionNumber_;
int adventureNumber_;
float platformWidth_;
Modified: code/branches/pickupsFS14/src/modules/jump/JumpBoots.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpBoots.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpBoots.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,7 +28,7 @@
/**
@file JumpBoots.cc
- @brief Implementation of the JumpBoots class.
+ @brief These boots give the figure a speed bonus when it jumpes.
*/
#include "JumpBoots.h"
@@ -47,15 +47,12 @@
{
RegisterClass(JumpBoots);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpBoots::JumpBoots(Context* context) : JumpItem(context)
{
RegisterObject(JumpBoots);
fuel_ = 3.0;
+ attachedToFigure_ = false;
setPosition(Vector3(0,0,0));
setVelocity(Vector3(0,0,0));
@@ -63,28 +60,16 @@
setProperties(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
- /**
- @brief
- Destructor.
- */
JumpBoots::~JumpBoots()
{
}
- //xml port for loading sounds
void JumpBoots::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpBoots, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpBoots::tick(float dt)
{
SUPER(JumpBoots, tick, dt);
@@ -115,9 +100,5 @@
JumpItem::touchFigure();
attachedToFigure_ = figure_->StartBoots(this);
- if (attachedToFigure_)
- {
- //Starte Feuer-Animation
- }
}
}
Modified: code/branches/pickupsFS14/src/modules/jump/JumpBoots.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpBoots.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpBoots.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,42 +20,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpBoots.h
- @brief Declaration of the JumpBoots class.
- @ingroup Jump
-*/
-
#ifndef _JumpBoots_H__
#define _JumpBoots_H__
#include "jump/JumpPrereqs.h"
-
#include "util/Math.h"
-
#include "worldentities/MovableEntity.h"
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpBoots : public JumpItem
{
public:
Modified: code/branches/pickupsFS14/src/modules/jump/JumpCenterpoint.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpCenterpoint.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpCenterpoint.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,41 +28,30 @@
/**
@file JumpCenterpoint.cc
- @brief Implementation of the JumpCenterpoint class.
+ @brief The JumpCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the JumpCenterpoint.
*/
#include "JumpCenterpoint.h"
-
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-
#include "Jump.h"
namespace orxonox
{
RegisterClass(JumpCenterpoint);
- /**
- @brief
- Constructor. Registers and initializes the object and checks whether the gametype is actually Jump.
- */
JumpCenterpoint::JumpCenterpoint(Context* context) : StaticEntity(context)
{
RegisterObject(JumpCenterpoint);
- // Variablen hier veraendern nuetzt nichts! Diese Variablen koennen in Level-File initialisiert werden.
- width_ = 200;
- height_ = 120;
- sectionLength_ = 120;
- platformSpeed_ = 20.0;
+ width_ = 0.0;
+ height_ = 0.0;
+ sectionLength_ = 0.0;
+ platformSpeed_ = 0.0;
checkGametype();
}
- /**
- @brief
- Method to create a JumpCenterpoint through XML.
- */
void JumpCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpCenterpoint, XMLPort, xmlelement, mode);
@@ -90,25 +79,16 @@
XMLPortParam(JumpCenterpoint, "enemy4Template", setEnemy4Template, getEnemy4Template, xmlelement, mode);
}
- /**
- @brief
- Is called when the gametype has changed.
- */
void JumpCenterpoint::changedGametype()
{
SUPER(JumpCenterpoint, changedGametype);
- // Check, whether it's still Jump.
checkGametype();
}
- /**
- @brief
- Checks whether the gametype is Jump and if it is, sets its centerpoint.
- */
void JumpCenterpoint::checkGametype()
{
- if (this->getGametype() != NULL && this->getGametype()->isA(Class(Jump)))
+ if (getGametype() != NULL && this->getGametype()->isA(Class(Jump)))
{
Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype().get());
jumpGametype->setCenterpoint(this);
Modified: code/branches/pickupsFS14/src/modules/jump/JumpCenterpoint.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpCenterpoint.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpCenterpoint.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,18 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpCenterpoint.h
- @brief Declaration of the JumpCenterpoint class.
- @ingroup Jump
-*/
-
#ifndef _JumpCenterpoint_H__
#define _JumpCenterpoint_H__
@@ -111,191 +105,123 @@
All parameters are specified. And also two @ref orxonox::Model "Models" (for the upper and lower boundary) are attached.
For a more elaborate example, have a look at the <code>jump.oxw</code> level file.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
+
*/
class _JumpExport JumpCenterpoint : public StaticEntity
{
public:
JumpCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Jump.
virtual ~JumpCenterpoint() {}
-
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a JumpCenterpoint through XML.
-
- virtual void changedGametype(); //!< Is called when the gametype has changed.
-
-
+ virtual void changedGametype();
void setPlatformStaticTemplate(const std::string& balltemplate)
{ this->platformStaticTemplate_ = balltemplate; }
-
const std::string& getPlatformStaticTemplate() const
{ return this->platformStaticTemplate_; }
-
void setPlatformHMoveTemplate(const std::string& balltemplate)
{ this->platformHMoveTemplate_ = balltemplate; }
-
const std::string& getPlatformHMoveTemplate() const
{ return this->platformHMoveTemplate_; }
-
void setPlatformVMoveTemplate(const std::string& balltemplate)
{ this->platformVMoveTemplate_ = balltemplate; }
-
const std::string& getPlatformVMoveTemplate() const
{ return this->platformVMoveTemplate_; }
-
void setPlatformDisappearTemplate(const std::string& balltemplate)
{ this->platformDisappearTemplate_ = balltemplate; }
-
const std::string& getPlatformDisappearTemplate() const
{ return this->platformDisappearTemplate_; }
-
void setPlatformTimerTemplate(const std::string& balltemplate)
{ this->platformTimerTemplate_ = balltemplate; }
-
const std::string& getPlatformTimerTemplate() const
{ return this->platformTimerTemplate_; }
-
void setPlatformFakeTemplate(const std::string& balltemplate)
{ this->platformFakeTemplate_ = balltemplate; }
-
const std::string& getPlatformFakeTemplate() const
{ return this->platformFakeTemplate_; }
-
void setProjectileTemplate(const std::string& newTemplate)
{ this->projectileTemplate_ = newTemplate; }
-
const std::string& getProjectileTemplate() const
{ return this->projectileTemplate_; }
-
void setSpringTemplate(const std::string& newTemplate)
{ this->springTemplate_ = newTemplate; }
-
const std::string& getSpringTemplate() const
{ return this->springTemplate_; }
-
void setRocketTemplate(const std::string& newTemplate)
{ this->rocketTemplate_ = newTemplate; }
-
const std::string& getRocketTemplate() const
{ return this->rocketTemplate_; }
-
void setPropellerTemplate(const std::string& newTemplate)
{ this->propellerTemplate_ = newTemplate; }
-
const std::string& getPropellerTemplate() const
{ return this->propellerTemplate_; }
-
void setBootsTemplate(const std::string& newTemplate)
{ this->bootsTemplate_ = newTemplate; }
-
const std::string& getBootsTemplate() const
{ return this->bootsTemplate_; }
-
void setShieldTemplate(const std::string& newTemplate)
{ this->shieldTemplate_ = newTemplate; }
-
const std::string& getShieldTemplate() const
{ return this->shieldTemplate_; }
-
void setFigureTemplate(const std::string& newTemplate)
{ this->figureTemplate_ = newTemplate; }
-
const std::string& getFigureTemplate() const
{ return this->figureTemplate_; }
-
void setEnemy1Template(const std::string& newTemplate)
{ this->enemy1Template_ = newTemplate; }
-
const std::string& getEnemy1Template() const
{ return this->enemy1Template_; }
-
void setEnemy2Template(const std::string& newTemplate)
{ this->enemy2Template_ = newTemplate; }
-
const std::string& getEnemy2Template() const
{ return this->enemy2Template_; }
-
void setEnemy3Template(const std::string& newTemplate)
{ this->enemy3Template_ = newTemplate; }
-
const std::string& getEnemy3Template() const
{ return this->enemy3Template_; }
-
void setEnemy4Template(const std::string& newTemplate)
{ this->enemy4Template_ = newTemplate; }
-
const std::string& getEnemy4Template() const
{ return this->enemy4Template_; }
-
-
- /**
- @brief Set the dimensions of the playing field.
- @param dimension A vector with the width of the playing field as first component and the height as second.
- */
void setFieldDimension(const Vector2& dimension)
{ this->width_ = dimension.x; this->height_ = dimension.y; }
- /**
- @brief Get the dimensions of the playing field.
- @return Returns a vector with the width of the playing field as first component and the height as second.
- */
Vector2 getFieldDimension() const
{ return Vector2(this->width_, this->height_); }
-
- /**
- @brief Set the dimensions of the playing field.
- @param dimension A vector with the width of the playing field as first component and the height as second.
- */
void setSectionLength(const float sectionLength)
{ this->sectionLength_ = sectionLength; }
- /**
- @brief Get the dimensions of the playing field.
- @return Returns a vector with the width of the playing field as first component and the height as second.
- */
float getSectionLength() const
{ return sectionLength_; }
-
void setPlatformSpeed(const float platformSpeed)
{ this->platformSpeed_ = platformSpeed; }
-
float getPlatformSpeed() const
{ return platformSpeed_; }
-
void setCameraOffset(const float cameraOffset)
{ this->cameraOffset_ = cameraOffset; }
-
float getCameraOffset() const
{ return cameraOffset_; }
-
-
private:
- void checkGametype(); //!< Checks whether the gametype is Jump and if it is, sets its centerpoint.
-
- std::string platformStaticTemplate_; //!< The template for the ball.
- std::string platformHMoveTemplate_; //!< The template for the ball.
- std::string platformVMoveTemplate_; //!< The template for the ball.
- std::string platformDisappearTemplate_; //!< The template for the ball.
- std::string platformTimerTemplate_; //!< The template for the ball.
- std::string platformFakeTemplate_; //!< The template for the ball.
- std::string projectileTemplate_; //!< The template for the ball.
- std::string springTemplate_; //!< The template for the ball.
- std::string rocketTemplate_; //!< The template for the ball.
- std::string propellerTemplate_; //!< The template for the ball.
- std::string bootsTemplate_; //!< The template for the ball.
- std::string shieldTemplate_; //!< The template for the ball.
- std::string figureTemplate_; //!< The template for the bats.
- std::string enemy1Template_; //!< The template for the bats.
- std::string enemy2Template_; //!< The template for the bats.
- std::string enemy3Template_; //!< The template for the bats.
- std::string enemy4Template_; //!< The template for the bats.
-
- float width_; //!< The height of the playing field.
- float height_; //!< The width of the playing field.
- float sectionLength_; //!< Height of one section
- float platformSpeed_; //!< Height of one section
- float cameraOffset_; //!< Height of one section
+ void checkGametype();
+ std::string platformStaticTemplate_;
+ std::string platformHMoveTemplate_;
+ std::string platformVMoveTemplate_;
+ std::string platformDisappearTemplate_;
+ std::string platformTimerTemplate_;
+ std::string platformFakeTemplate_;
+ std::string projectileTemplate_;
+ std::string springTemplate_;
+ std::string rocketTemplate_;
+ std::string propellerTemplate_;
+ std::string bootsTemplate_;
+ std::string shieldTemplate_;
+ std::string figureTemplate_;
+ std::string enemy1Template_;
+ std::string enemy2Template_;
+ std::string enemy3Template_;
+ std::string enemy4Template_;
+ float width_;
+ float height_;
+ float sectionLength_;
+ float platformSpeed_;
+ float cameraOffset_;
};
}
Modified: code/branches/pickupsFS14/src/modules/jump/JumpEnemy.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpEnemy.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpEnemy.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,7 +28,7 @@
/**
@file JumpEnemy.cc
- @brief Implementation of the JumpEnemy class.
+ @brief All enemies in the minigame inherit from this class. This class manages the movement of all enemies and allows enemies to touch the figure to kill it.
*/
#include "JumpEnemy.h"
Modified: code/branches/pickupsFS14/src/modules/jump/JumpEnemy.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpEnemy.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpEnemy.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -44,48 +44,19 @@
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpEnemy : public MovableEntity
{
public:
JumpEnemy(Context* context);
virtual ~JumpEnemy();
-
virtual void tick(float dt);
-
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
- /**
- @brief Set the dimensions of the playing field.
- @param width The width of the playing field.
- @param height The height of the playing field.
- */
void setFieldDimension(float width, float height)
{ this->fieldWidth_ = width; this->fieldHeight_ = height; }
- /**
- @brief Get the dimensions of the playing field.
- @param dimension A vector with the width as the first and height as the second component.
- */
void setFieldDimension(const Vector2& dimension)
{ this->setFieldDimension(dimension.x, dimension.y); }
- /**
- @brief Get the dimensions of the playing field.
- @return Returns a vector with the width as the first and height as the second component.
- */
Vector2 getFieldDimension() const
{ return Vector2(this->fieldWidth_, this->fieldHeight_); }
-
void setWidth(const float width)
{ this->width_ = width; }
float getWidth() const
@@ -96,24 +67,19 @@
{ return height_; }
virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed);
-
- void setFigure(WeakPtr<JumpFigure> bats); //!< Set the bats for the ball.
+ void setFigure(WeakPtr<JumpFigure> bats);
virtual void touchFigure();
bool dead_;
protected:
-
float width_;
float height_;
-
- float fieldWidth_; //!< The width of the playing field.
- float fieldHeight_; //!< The height of the playing field.
-
+ float fieldWidth_;
+ float fieldHeight_;
float leftBoundary_;
float rightBoundary_;
float lowerBoundary_;
float upperBoundary_;
-
- WeakPtr<JumpFigure> figure_; //!< An array with the two bats.
+ WeakPtr<JumpFigure> figure_;
};
}
Modified: code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,7 +28,7 @@
/**
@file JumpFigure.cc
- @brief Implementation of the JumpFigure class.
+ @brief This class represents your figure when you play the minigame. Here the movement of the figure, activating items, ... are handled.
*/
#include "JumpFigure.h"
@@ -40,20 +40,15 @@
{
RegisterClass(JumpFigure);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpFigure::JumpFigure(Context* context) : ControllableEntity(context)
{
RegisterObject(JumpFigure);
+ // initialize variables
leftHand_ = NULL;
rightHand_ = NULL;
-
fieldHeight_ = 0;
fieldWidth_ = 0;
-
jumpSpeed_ = 0.0;
handSpeed_ = 0.0;
handMaxAngle_ = 0.0;
@@ -61,37 +56,28 @@
rocketPos_ = 0.0;
propellerPos_ = 0.0;
bootsPos_ = 0.0;
-
- moveUpPressed = false;
- moveDownPressed = false;
- moveLeftPressed = false;
- moveDownPressed = false;
- firePressed = false;
- fireSignal = false;
- timeSinceLastFire = 0.0;
-
- gravityAcceleration = 8.0;
+ moveUpPressed_ = false;
+ moveDownPressed_ = false;
+ moveLeftPressed_ = false;
+ moveDownPressed_ = false;
+ firePressed_ = false;
+ fireSignal_ = false;
+ timeSinceLastFire_ = 0.0;
+ gravityAcceleration_ = 8.0;
mouseFactor_ = 75.0;
- maxFireRate = 0.3;
-
+ maxFireRate_ = 0.3;
handAngle_ = 0.0;
animateHands_ = false;
turnUp_ = false;
-
rocketActive_ = false;
propellerActive_ = false;
bootsActive_ = false;
shieldActive_ = false;
rocketSpeed_ = 0.0;
propellerSpeed_ = 0.0;
-
dead_ = false;
}
- /**
- @brief
- Method to create a JumpCenterpoint through XML.
- */
void JumpFigure::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpFigure, XMLPort, xmlelement, mode);
@@ -109,21 +95,13 @@
XMLPortParam(JumpFigure, "handSpeed", setHandSpeed, getHandSpeed, xmlelement, mode);
}
- /**
- @brief
- Is called each tick.
- Moves the bat.
- @param dt
- The time since last tick.
- */
void JumpFigure::tick(float dt)
{
SUPER(JumpFigure, tick, dt);
- // If the bat is controlled (but not over the network).
if (hasLocalController())
{
- timeSinceLastFire += dt;
+ timeSinceLastFire_ += dt;
// Move up/down
Vector3 velocity = getVelocity();
@@ -137,7 +115,7 @@
}
else
{
- velocity.z -= gravityAcceleration;
+ velocity.z -= gravityAcceleration_;
}
// Animate Hands
@@ -173,7 +151,7 @@
// Move left/right
if (dead_ == false)
{
- velocity.x = -mouseFactor_*horizontalSpeed;
+ velocity.x = -mouseFactor_*horizontalSpeed_;
}
else
{
@@ -181,26 +159,25 @@
}
// Cheats
- if (moveUpPressed == true)
+ /*if (moveUpPressed_ == true)
{
- velocity.z = 200.0f;
- moveUpPressed = false;
+ velocity.z = 400.0f;
+ moveUpPressed_ = false;
dead_ = false;
}
- if (moveDownPressed == true)
+ if (moveDownPressed_ == true)
{
- moveDownPressed = false;
- }
+ moveDownPressed_ = false;
+ }*/
setVelocity(velocity);
- if (firePressed && timeSinceLastFire >= maxFireRate)
+ if (firePressed_ && timeSinceLastFire_ >= maxFireRate_)
{
- firePressed = false;
- timeSinceLastFire = 0.0;
- fireSignal = true;
- //orxout() << "fired signal set" << endl;
+ firePressed_ = false;
+ timeSinceLastFire_ = 0.0;
+ fireSignal_ = true;
}
}
@@ -217,11 +194,11 @@
setPosition(position);
// Reset key variables
- moveUpPressed = false;
- moveDownPressed = false;
- moveLeftPressed = false;
- moveDownPressed = false;
- firePressed = false;
+ moveUpPressed_ = false;
+ moveDownPressed_ = false;
+ moveLeftPressed_ = false;
+ moveDownPressed_ = false;
+ firePressed_ = false;
}
void JumpFigure::JumpFromPlatform(JumpPlatform* platform)
@@ -364,51 +341,37 @@
attach(rightHand_);
}
- /**
- @briefhandPosition_
- Overloaded the function to steer the bat up and down.
- @param value
- A vector whose first component is the inverse direction in which we want to steer the bat.
- */
void JumpFigure::moveFrontBack(const Vector2& value)
{
if (value.x > 0)
{
- //orxout() << "up pressed" << endl;
- moveUpPressed = true;
- moveDownPressed = false;
+ moveUpPressed_ = true;
+ moveDownPressed_ = false;
}
else
{
- //orxout() << "down pressed" << endl;
- moveUpPressed = false;
- moveDownPressed = true;
+ moveUpPressed_ = false;
+ moveDownPressed_ = true;
}
}
- /**
- @brief
- Overloaded the function to steer the bat up and down.
- @param value
- A vector whose first component is the direction in which we wnat to steer the bat.
- */
void JumpFigure::moveRightLeft(const Vector2& value)
{
if (value.x > 0)
{
- moveLeftPressed = false;
- moveRightPressed = true;
+ moveLeftPressed_ = false;
+ moveRightPressed_ = true;
}
else
{
- moveLeftPressed = true;
- moveRightPressed = false;
+ moveLeftPressed_ = true;
+ moveRightPressed_ = false;
}
}
void JumpFigure::rotateYaw(const Vector2& value)
{
- horizontalSpeed = value.x;
+ horizontalSpeed_ = value.x;
}
void JumpFigure::rotatePitch(const Vector2& value)
@@ -425,12 +388,11 @@
void JumpFigure::fire(unsigned int firemode)
{
- //SUPER(JumpFigure, fire, firemode);
+
}
void JumpFigure::fired(unsigned int firemode)
{
- //SUPER(JumpFigure, fired, firemode);
- firePressed = true;
+ firePressed_ = true;
}
}
Modified: code/branches/pickupsFS14/src/modules/jump/JumpFigure.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpFigure.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpFigure.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,18 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpFigure.h
- @brief Declaration of the JumpFigure class.
- @ingroup Jump
-*/
-
#ifndef _JumpFigure_H__
#define _JumpFigure_H__
@@ -41,38 +35,20 @@
namespace orxonox
{
-
- /**
- @brief
- The JumpFigure class manages the bats for @ref orxonox::Jump "Jump", which are the elements controlled by the players.
-
- It is responsible for the movement (controlled by the players) of the bat.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpFigure : public ControllableEntity
{
public:
JumpFigure(Context* context); //!< Constructor. Registers and initializes the object.
virtual ~JumpFigure() {}
-
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
virtual void tick(float dt);
-
virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
-
virtual void rotateYaw(const Vector2& value);
virtual void rotatePitch(const Vector2& value);
virtual void rotateRoll(const Vector2& value);
-
void fire(unsigned int firemode);
virtual void fired(unsigned int firemode);
-
virtual void JumpFromPlatform(JumpPlatform* platform);
virtual void JumpFromSpring(JumpSpring* spring);
virtual void CollisionWithEnemy(JumpEnemy* enemy);
@@ -84,113 +60,82 @@
virtual void StopBoots(JumpBoots* boots);
virtual bool StartShield(JumpShield* shield);
virtual void StopShield(JumpShield* shield);
-
virtual void InitializeAnimation(Context* context);
void setFieldDimension(float width, float height)
{ fieldWidth_ = width; fieldHeight_ = height; }
-
void setFieldDimension(const Vector2& dimension)
{ setFieldDimension(dimension.x, dimension.y); }
-
Vector2 getFieldDimension() const
{ return Vector2(fieldWidth_, fieldHeight_); }
-
void setMouseFactor(const float mouseFactor)
{ mouseFactor_ = mouseFactor; }
-
const float getMouseFactor() const
{ return mouseFactor_; }
-
void setModelLeftHand(const std::string& modelLeftHand)
{ modelLeftHand_ = modelLeftHand; }
-
const std::string& getModelLeftHand() const
{ return modelLeftHand_; }
-
void setModelRightHand(const std::string& modelRightHand)
{ modelRightHand_ = modelRightHand; }
-
const std::string& getModelRightHand() const
{ return modelRightHand_; }
-
void setRocketPos(const float rocketPos)
{ rocketPos_ = rocketPos; }
-
const float getRocketPos() const
{ return rocketPos_; }
-
void setPropellerPos(const float propellerPos)
{ propellerPos_ = propellerPos; }
-
const float getPropellerPos() const
{ return propellerPos_; }
-
void setBootsPos(const float bootsPos)
{ bootsPos_ = bootsPos; }
-
const float getBootsPos() const
{ return bootsPos_; }
-
void setJumpSpeed(const float jumpSpeed)
{ jumpSpeed_ = jumpSpeed; }
-
const float getJumpSpeed() const
{ return jumpSpeed_; }
-
void setRocketSpeed(const float rocketSpeed)
{ rocketSpeed_ = rocketSpeed; }
-
const float getRocketSpeed() const
{ return rocketSpeed_; }
-
void setPropellerSpeed(const float propellerSpeed)
{ propellerSpeed_ = propellerSpeed; }
-
const float getPropellerSpeed() const
{ return propellerSpeed_; }
-
void setHandMinAngle(const float handMinAngle)
{ handMinAngle_ = handMinAngle; }
-
const float getHandMinAngle() const
{ return handMinAngle_; }
-
void setHandMaxAngle(const float handMaxAngle)
{ handMaxAngle_ = handMaxAngle; }
-
const float getHandMaxAngle() const
{ return handMaxAngle_; }
-
void setHandSpeed(const float handSpeed)
{ handSpeed_ = handSpeed; }
-
const float getHandSpeed() const
{ return handSpeed_; }
- bool fireSignal;
+ bool fireSignal_;
+ bool rocketActive_;
+ bool propellerActive_;
bool dead_;
-
private:
std::string modelLeftHand_;
std::string modelRightHand_;
-
Model* leftHand_;
Model* rightHand_;
-
float fieldWidth_;
float fieldHeight_;
- float timeSinceLastFire;
-
- bool moveUpPressed;
- bool moveDownPressed;
- bool moveLeftPressed;
- bool moveRightPressed;
- bool firePressed;
-
- float gravityAcceleration;
+ float timeSinceLastFire_;
+ bool moveUpPressed_;
+ bool moveDownPressed_;
+ bool moveLeftPressed_;
+ bool moveRightPressed_;
+ bool firePressed_;
+ float gravityAcceleration_;
float mouseFactor_;
-
float jumpSpeed_;
float handSpeed_;
float handMaxAngle_;
@@ -198,16 +143,11 @@
float rocketPos_;
float propellerPos_;
float bootsPos_;
- float maxFireRate;
-
- float horizontalSpeed;
-
+ float maxFireRate_;
+ float horizontalSpeed_;
float handAngle_;
bool animateHands_;
bool turnUp_;
-
- bool rocketActive_;
- bool propellerActive_;
bool bootsActive_;
bool shieldActive_;
float rocketSpeed_;
Modified: code/branches/pickupsFS14/src/modules/jump/JumpItem.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpItem.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpItem.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,7 +28,7 @@
/**
@file JumpItem.cc
- @brief Implementation of the JumpItem class.
+ @brief All items in this minigame inherit from this class. Items can move around like platforms and enemies.
*/
#include "JumpItem.h"
@@ -47,10 +47,6 @@
{
RegisterClass(JumpItem);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpItem::JumpItem(Context* context) : MovableEntity(context)
{
RegisterObject(JumpItem);
@@ -65,16 +61,11 @@
setAcceleration(Vector3(0,0,0));
}
- /**
- @brief
- Destructor.
- */
JumpItem::~JumpItem()
{
}
- //xml port for loading sounds
void JumpItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpItem, XMLPort, xmlelement, mode);
@@ -83,13 +74,6 @@
XMLPortParam(JumpItem, "width", setWidth, getWidth, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpItem::tick(float dt)
{
SUPER(JumpItem, tick, dt);
@@ -124,12 +108,6 @@
setVelocity(Vector3(newHSpeed,0,newVSpeed));
}
- /**
- @brief
- Set the bats for the ball.
- @param bats
- An array (of size 2) of weak pointers, to be set as the new bats.
- */
void JumpItem::setFigure(WeakPtr<JumpFigure> newFigure)
{
figure_ = newFigure;
Modified: code/branches/pickupsFS14/src/modules/jump/JumpItem.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpItem.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpItem.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -44,18 +44,6 @@
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpItem : public MovableEntity
{
public:
@@ -73,7 +61,6 @@
{ this->setFieldDimension(dimension.x, dimension.y); }
Vector2 getFieldDimension() const
{ return Vector2(this->fieldWidth_, this->fieldHeight_); }
-
void setWidth(const float width)
{ this->width_ = width; }
float getWidth() const
@@ -88,11 +75,9 @@
protected:
float fieldWidth_; //!< The width of the playing field.
float fieldHeight_; //!< The height of the playing field.
-
WeakPtr<JumpFigure> figure_; //!< An array with the two bats.
float height_;
float width_;
-
float leftBoundary_;
float rightBoundary_;
float lowerBoundary_;
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatform.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatform.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatform.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,7 +28,7 @@
/**
@file JumpPlatform.cc
- @brief Implementation of the JumpPlatform class.
+ @brief All platforms in this minigame inherit from this class. The basic functions of a platform (interact with figure) is implemented here. Special functions are implemented in the specialized classes.
*/
#include "JumpPlatform.h"
@@ -47,12 +47,6 @@
{
RegisterClass(JumpPlatform);
- const float JumpPlatform::MAX_REL_Z_VELOCITY = 1.5;
-
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpPlatform::JumpPlatform(Context* context) : MovableEntity(context)
{
RegisterObject(JumpPlatform);
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatform.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatform.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatform.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -36,26 +36,11 @@
#define _JumpPlatform_H__
#include "jump/JumpPrereqs.h"
-
#include "util/Math.h"
-
#include "worldentities/MovableEntity.h"
-
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpPlatform : public MovableEntity
{
public:
@@ -66,8 +51,6 @@
void setFigure(WeakPtr<JumpFigure> bats); //!< Set the bats for the ball.
virtual void touchFigure();
- static const float MAX_REL_Z_VELOCITY;
-
void setDefScoreSound(const std::string& engineSound);
const std::string& getDefScoreSound();
void setDefBatSound(const std::string& engineSound);
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformDisappear.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformDisappear.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformDisappear.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,7 +28,7 @@
/**
@file JumpPlatformDisappear.cc
- @brief Implementation of the JumpPlatform class.
+ @brief This platform disappears after contact with the figure.
*/
#include "JumpPlatformDisappear.h"
@@ -47,10 +47,6 @@
{
RegisterClass(JumpPlatformDisappear);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpPlatformDisappear::JumpPlatformDisappear(Context* context) : JumpPlatform(context)
{
RegisterObject(JumpPlatformDisappear);
@@ -58,29 +54,16 @@
setProperties(true);
}
- /**
- @brief
- Destructor.
- */
JumpPlatformDisappear::~JumpPlatformDisappear()
{
}
-
- //xml port for loading sounds
void JumpPlatformDisappear::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpPlatformDisappear, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpPlatformDisappear::tick(float dt)
{
SUPER(JumpPlatformDisappear, tick, dt);
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformDisappear.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformDisappear.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformDisappear.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -36,41 +36,22 @@
#define _JumpPlatformDisappear_H__
#include "jump/JumpPrereqs.h"
-
#include "util/Math.h"
-
#include "worldentities/MovableEntity.h"
-
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpPlatformDisappear : public JumpPlatform
{
public:
JumpPlatformDisappear(Context* context);
virtual ~JumpPlatformDisappear();
-
virtual void tick(float dt);
-
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
virtual void setProperties(bool active);
virtual bool isActive();
virtual void touchFigure();
-
protected:
bool active_;
};
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformFake.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformFake.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformFake.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,18 +28,14 @@
/**
@file JumpPlatformFake.cc
- @brief Implementation of the JumpPlatform class.
+ @brief This platform has a hole in it. You cannot jump from this platform. It has no touchFigure function.
*/
#include "JumpPlatformFake.h"
-
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
-
#include "gametypes/Gametype.h"
-
#include "JumpFigure.h"
-
#include "sound/WorldSound.h"
#include "core/XMLPort.h"
@@ -47,37 +43,21 @@
{
RegisterClass(JumpPlatformFake);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpPlatformFake::JumpPlatformFake(Context* context) : JumpPlatform(context)
{
RegisterObject(JumpPlatformFake);
}
- /**
- @brief
- Destructor.
- */
JumpPlatformFake::~JumpPlatformFake()
{
}
- //xml port for loading sounds
void JumpPlatformFake::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpPlatformFake, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpPlatformFake::tick(float dt)
{
SUPER(JumpPlatformFake, tick, dt);
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformFake.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformFake.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformFake.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -44,24 +44,11 @@
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpPlatformFake : public JumpPlatform
{
public:
JumpPlatformFake(Context* context);
virtual ~JumpPlatformFake();
-
virtual void tick(float dt);
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
};
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformHMove.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformHMove.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformHMove.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,31 +28,21 @@
/**
@file JumpPlatformHMove.cc
- @brief Implementation of the JumpPlatform class.
+ @brief This platform can move horizontally.
*/
#include "JumpPlatformHMove.h"
-
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
-
#include "gametypes/Gametype.h"
-
#include "JumpFigure.h"
-
#include "sound/WorldSound.h"
#include "core/XMLPort.h"
-#include "graphics/Backlight.h"
-
namespace orxonox
{
RegisterClass(JumpPlatformHMove);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpPlatformHMove::JumpPlatformHMove(Context* context) : JumpPlatform(context)
{
RegisterObject(JumpPlatformHMove);
@@ -60,57 +50,46 @@
setProperties(-100,100,5);
}
- /**
- @brief
- Destructor.
- */
JumpPlatformHMove::~JumpPlatformHMove()
{
}
- //xml port for loading sounds
void JumpPlatformHMove::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpPlatformHMove, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpPlatformHMove::tick(float dt)
{
SUPER(JumpPlatformHMove, tick, dt);
// Get the current position, velocity and acceleration of the ball.
- Vector3 position = this->getPosition();
- Vector3 velocity = this->getVelocity();
+ Vector3 position = getPosition();
+ Vector3 velocity = getVelocity();
if ((position.x < leftBoundary_ && velocity.x < 0) || (position.x > rightBoundary_ && velocity.x > 0))
{
- //orxout() << "refelected platformHMove at " << position.x << endl;
velocity.x = -velocity.x;
}
// Set the position, velocity and acceleration of the ball, if they have changed.
- if (velocity != this->getVelocity())
- this->setVelocity(velocity);
+ if (velocity != getVelocity())
+ {
+ setVelocity(velocity);
+ }
if (position != this->getPosition())
- this->setPosition(position);
+ {
+ setPosition(position);
+ }
}
void JumpPlatformHMove::setProperties(float leftBoundary, float rightBoundary, float speed)
{
leftBoundary_ = leftBoundary;
rightBoundary_ = rightBoundary;
-
- this->setVelocity(Vector3(speed,0,0));
-
+ setVelocity(Vector3(speed,0,0));
}
void JumpPlatformHMove::touchFigure()
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformHMove.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformHMove.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformHMove.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,18 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpPlatformHMove.h
- @brief Declaration of the JumpPlatform class.
- @ingroup Jump
-*/
-
#ifndef _JumpPlatformHMove_H__
#define _JumpPlatformHMove_H__
@@ -45,26 +39,13 @@
namespace orxonox
{
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpPlatformHMove : public JumpPlatform
{
public:
JumpPlatformHMove(Context* context);
virtual ~JumpPlatformHMove();
-
virtual void tick(float dt);
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
virtual void setProperties(float leftBoundary, float rightBoundary, float speed);
virtual void touchFigure();
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformStatic.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformStatic.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformStatic.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,18 +28,14 @@
/**
@file JumpPlatformStatic.cc
- @brief Implementation of the JumpPlatformStatic class.
+ @brief This is the most simple platform in this minigame.
*/
#include "JumpPlatformStatic.h"
-
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
-
#include "gametypes/Gametype.h"
-
#include "JumpFigure.h"
-
#include "sound/WorldSound.h"
#include "core/XMLPort.h"
@@ -47,20 +43,12 @@
{
RegisterClass(JumpPlatformStatic);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpPlatformStatic::JumpPlatformStatic(Context* context) : JumpPlatform(context)
{
RegisterObject(JumpPlatformStatic);
}
- /**
- @brief
- Destructor.
- */
JumpPlatformStatic::~JumpPlatformStatic()
{
@@ -72,13 +60,6 @@
SUPER(JumpPlatformStatic, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpPlatformStatic::tick(float dt)
{
SUPER(JumpPlatformStatic, tick, dt);
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformStatic.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformStatic.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformStatic.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,18 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpPlatformStatic.h
- @brief Declaration of the JumpPlatformStatic class.
- @ingroup Jump
-*/
-
#ifndef _JumpPlatformStatic_H__
#define _JumpPlatformStatic_H__
@@ -44,18 +38,6 @@
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpPlatformStatic : public JumpPlatform
{
public:
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformTimer.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformTimer.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformTimer.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,18 +28,14 @@
/**
@file JumpPlatformTimer.cc
- @brief Implementation of the JumpPlatform class.
+ @brief This platform will explode if you wait for too long time.
*/
#include "JumpPlatformTimer.h"
-
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
-
#include "gametypes/Gametype.h"
-
#include "JumpFigure.h"
-
#include "sound/WorldSound.h"
#include "core/XMLPort.h"
@@ -47,30 +43,21 @@
{
RegisterClass(JumpPlatformTimer);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpPlatformTimer::JumpPlatformTimer(Context* context) : JumpPlatform(context)
{
RegisterObject(JumpPlatformTimer);
- particleSpawner = NULL;
+ particleSpawner_ = NULL;
setProperties(3.0);
}
- /**
- @brief
- Destructor.
- */
JumpPlatformTimer::~JumpPlatformTimer()
{
}
- //xml port for loading sounds
void JumpPlatformTimer::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpPlatformTimer, XMLPort, xmlelement, mode);
@@ -79,28 +66,21 @@
XMLPortParam(JumpPlatformTimer, "effectStartTime", setEffectStartTime, getEffectStartTime, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpPlatformTimer::tick(float dt)
{
SUPER(JumpPlatformTimer, tick, dt);
time_ -= dt;
- if (time_ < effectStartTime_ && particleSpawner == NULL)
+ if (time_ < effectStartTime_ && particleSpawner_ == NULL)
{
- particleSpawner = new ParticleSpawner(getContext());
- particleSpawner->setSource(effectPath_);
- particleSpawner->setLoop(false);
- particleSpawner->setLOD(LODParticle::Low);
- particleSpawner->setLifetime(effectStartTime_);
+ particleSpawner_ = new ParticleSpawner(getContext());
+ particleSpawner_->setSource(effectPath_);
+ particleSpawner_->setLoop(false);
+ particleSpawner_->setLOD(LODParticle::Low);
+ particleSpawner_->setLifetime(effectStartTime_);
- attach(particleSpawner);
+ attach(particleSpawner_);
}
}
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformTimer.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformTimer.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformTimer.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -45,27 +45,13 @@
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpPlatformTimer : public JumpPlatform
{
public:
JumpPlatformTimer(Context* context);
virtual ~JumpPlatformTimer();
-
virtual void tick(float dt);
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
virtual void setProperties(float time);
virtual bool isActive(void);
virtual void touchFigure();
@@ -84,7 +70,7 @@
protected:
float time_;
- ParticleSpawner* particleSpawner;
+ ParticleSpawner* particleSpawner_;
std::string effectPath_;
float effectStartTime_;
};
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformVMove.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformVMove.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformVMove.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,18 +28,14 @@
/**
@file JumpPlatformVMove.cc
- @brief Implementation of the JumpPlatform class.
+ @brief This platform can move vertically.
*/
#include "JumpPlatformVMove.h"
-
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
-
#include "gametypes/Gametype.h"
-
#include "JumpFigure.h"
-
#include "sound/WorldSound.h"
#include "core/XMLPort.h"
@@ -47,10 +43,6 @@
{
RegisterClass(JumpPlatformVMove);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpPlatformVMove::JumpPlatformVMove(Context* context) : JumpPlatform(context)
{
RegisterObject(JumpPlatformVMove);
@@ -58,47 +50,38 @@
setProperties(0,80,10);
}
- /**
- @brief
- Destructor.
- */
JumpPlatformVMove::~JumpPlatformVMove()
{
}
- //xml port for loading sounds
void JumpPlatformVMove::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpPlatformVMove, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpPlatformVMove::tick(float dt)
{
SUPER(JumpPlatformVMove, tick, dt);
// Get the current position, velocity and acceleration of the ball.
- Vector3 position = this->getPosition();
- Vector3 velocity = this->getVelocity();
+ Vector3 position = getPosition();
+ Vector3 velocity = getVelocity();
if ((position.z < lowerBoundary_ && velocity.z < 0) || (position.z > upperBoundary_ && velocity.z > 0))
{
- //orxout() << "refelected platformVMove at " << position.z << endl;
velocity.z = -velocity.z;
}
// Set the position, velocity and acceleration of the ball, if they have changed.
- if (velocity != this->getVelocity())
- this->setVelocity(velocity);
- if (position != this->getPosition())
- this->setPosition(position);
+ if (velocity != getVelocity())
+ {
+ setVelocity(velocity);
+ }
+ if (position != getPosition())
+ {
+ setPosition(position);
+ }
}
void JumpPlatformVMove::setProperties(float lowerBoundary, float upperBoundary, float speed)
@@ -106,7 +89,7 @@
lowerBoundary_ = lowerBoundary;
upperBoundary_ = upperBoundary;
- this->setVelocity(Vector3(0,0,speed));
+ setVelocity(Vector3(0,0,speed));
}
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPlatformVMove.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPlatformVMove.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPlatformVMove.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,51 +20,28 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpPlatformVMove.h
- @brief Declaration of the JumpPlatform class.
- @ingroup Jump
-*/
-
#ifndef _JumpPlatformVMove_H__
#define _JumpPlatformVMove_H__
#include "jump/JumpPrereqs.h"
-
#include "util/Math.h"
-
#include "worldentities/MovableEntity.h"
-
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpPlatformVMove : public JumpPlatform
{
public:
JumpPlatformVMove(Context* context);
virtual ~JumpPlatformVMove();
-
virtual void tick(float dt);
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-
virtual void setProperties(float leftBoundary, float rightBoundary, float speed);
virtual void touchFigure();
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPrereqs.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPrereqs.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPrereqs.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Reto Grieder
+ * Fabien Vultier
* Co-authors:
* ...
*
Modified: code/branches/pickupsFS14/src/modules/jump/JumpProjectile.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpProjectile.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpProjectile.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,18 +28,15 @@
/**
@file JumpProjectile.cc
- @brief Implementation of the JumpProjectile class.
+ @brief projectiles are created by the gametype if the figure shoots. All projectiles check every tick, whether they hit an enemy.
*/
#include "JumpProjectile.h"
-
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
#include "graphics/Model.h"
#include "gametypes/Gametype.h"
-
#include "JumpFigure.h"
-
#include "sound/WorldSound.h"
#include "core/XMLPort.h"
@@ -47,62 +44,26 @@
{
RegisterClass(JumpProjectile);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpProjectile::JumpProjectile(Context* context) : MovableEntity(context)
{
RegisterObject(JumpProjectile);
figure_ = 0;
-
- registerVariables();
-
setPosition(Vector3(0,0,0));
setVelocity(Vector3(0,0,250.0));
setAcceleration(Vector3(0,0,0));
}
- /**
- @brief
- Destructor.
- */
JumpProjectile::~JumpProjectile()
{
- /*if (this->isInitialized())
- {
- if (this->bDeleteBats_)
- delete this->figure_;
- delete[] this->batID_;
- }*/
}
- //xml port for loading sounds
void JumpProjectile::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpProjectile, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Register variables to synchronize over the network.
- */
- void JumpProjectile::registerVariables()
- {
- registerVariable( this->fieldWidth_ );
- registerVariable( this->fieldHeight_ );
- //registerVariable( this->batID_[1], VariableDirection::ToClient, new NetworkCallback<JumpProjectile>( this, &JumpProjectile::applyBats) );
- }
-
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpProjectile::tick(float dt)
{
SUPER(JumpProjectile, tick, dt);
@@ -122,12 +83,6 @@
}
}
- /**
- @brief
- Set the bats for the ball.
- @param bats
- An array (of size 2) of weak pointers, to be set as the new bats.
- */
void JumpProjectile::setFigure(WeakPtr<JumpFigure> figure)
{
figure_ = figure;
Modified: code/branches/pickupsFS14/src/modules/jump/JumpProjectile.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpProjectile.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpProjectile.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,42 +20,22 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpProjectile.h
- @brief Declaration of the JumpProjectile class.
- @ingroup Jump
-*/
-
#ifndef _JumpProjectile_H__
#define _JumpProjectile_H__
#include "jump/JumpPrereqs.h"
-
#include "util/Math.h"
-
#include "worldentities/MovableEntity.h"
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpProjectile : public MovableEntity
{
public:
@@ -75,15 +55,12 @@
Vector2 getFieldDimension() const
{ return Vector2(this->fieldWidth_, this->fieldHeight_); }
-
void setFigure(WeakPtr<JumpFigure> figure);
protected:
- void registerVariables();
-
- float fieldWidth_; //!< The width of the playing field.
- float fieldHeight_; //!< The height of the playing field.
- WeakPtr<JumpFigure> figure_; //!< An array with the two bats.
+ float fieldWidth_;
+ float fieldHeight_;
+ WeakPtr<JumpFigure> figure_;
};
}
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPropeller.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPropeller.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPropeller.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,7 +28,7 @@
/**
@file JumpPropeller.cc
- @brief Implementation of the JumpPropeller class.
+ @brief If this propeller is created, attachedToFigure_ is set to false. When the figure picks it up, the variable is set to true and the figure starts flying until the fuel is reduced to zero.
*/
#include "JumpPropeller.h"
@@ -47,15 +47,12 @@
{
RegisterClass(JumpPropeller);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpPropeller::JumpPropeller(Context* context) : JumpItem(context)
{
RegisterObject(JumpPropeller);
fuel_ = 3.0;
+ attachedToFigure_ = false;
setPosition(Vector3(0,0,0));
setVelocity(Vector3(0,0,0));
@@ -63,28 +60,16 @@
setProperties(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
- /**
- @brief
- Destructor.
- */
JumpPropeller::~JumpPropeller()
{
}
- //xml port for loading sounds
void JumpPropeller::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpPropeller, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpPropeller::tick(float dt)
{
SUPER(JumpPropeller, tick, dt);
Modified: code/branches/pickupsFS14/src/modules/jump/JumpPropeller.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPropeller.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPropeller.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,18 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpPropeller.h
- @brief Declaration of the JumpPropeller class.
- @ingroup Jump
-*/
-
#ifndef _JumpPropeller_H__
#define _JumpPropeller_H__
@@ -44,18 +38,6 @@
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpPropeller : public JumpItem
{
public:
Modified: code/branches/pickupsFS14/src/modules/jump/JumpRocket.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpRocket.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpRocket.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,18 +28,15 @@
/**
@file JumpRocket.cc
- @brief Implementation of the JumpRocket class.
+ @brief If this rocket is created, attachedToFigure_ is set to false. When the figure picks it up, the variable is set to true and the figure starts flying fast until the fuel is reduced to zero.
*/
#include "JumpRocket.h"
-
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
#include "graphics/Model.h"
#include "gametypes/Gametype.h"
-
#include "JumpFigure.h"
-
#include "sound/WorldSound.h"
#include "core/XMLPort.h"
@@ -47,15 +44,12 @@
{
RegisterClass(JumpRocket);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpRocket::JumpRocket(Context* context) : JumpItem(context)
{
RegisterObject(JumpRocket);
fuel_ = 3.0;
+ attachedToFigure_ = false;
setPosition(Vector3(0,0,0));
setVelocity(Vector3(0,0,0));
@@ -63,28 +57,16 @@
setProperties(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
- /**
- @brief
- Destructor.
- */
JumpRocket::~JumpRocket()
{
}
- //xml port for loading sounds
void JumpRocket::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpRocket, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpRocket::tick(float dt)
{
SUPER(JumpRocket, tick, dt);
@@ -115,9 +97,5 @@
JumpItem::touchFigure();
attachedToFigure_ = figure_->StartRocket(this);
- if (attachedToFigure_)
- {
- //Starte Feuer-Animation
- }
}
}
Modified: code/branches/pickupsFS14/src/modules/jump/JumpRocket.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpRocket.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpRocket.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,42 +20,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpRocket.h
- @brief Declaration of the JumpRocket class.
- @ingroup Jump
-*/
-
#ifndef _JumpRocket_H__
#define _JumpRocket_H__
#include "jump/JumpPrereqs.h"
-
#include "util/Math.h"
-
#include "worldentities/MovableEntity.h"
-
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpRocket : public JumpItem
{
public:
Modified: code/branches/pickupsFS14/src/modules/jump/JumpScore.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpScore.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpScore.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,28 +28,21 @@
/**
@file JumpScore.cc
- @brief Implementation of the JumpScore class.
+ @brief HUD of thejump minigame. If showScore_ is set, it displays the score. If showMessages_ is set, it displays the game over message.
*/
#include "JumpScore.h"
-
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "util/Convert.h"
-
#include "infos/PlayerInfo.h"
-
#include "Jump.h"
-#include "sound/WorldSound.h" /////////////////////////////
+#include "sound/WorldSound.h"
namespace orxonox
{
RegisterClass(JumpScore);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpScore::JumpScore(Context* context) : OverlayText(context)
{
RegisterObject(JumpScore);
@@ -59,19 +52,11 @@
showMessages_ = false;
}
- /**
- @brief
- Destructor.
- */
JumpScore::~JumpScore()
{
}
- /**
- @brief
- Method to create a JumpScore through XML.
- */
void JumpScore::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpScore, XMLPort, xmlelement, mode);
@@ -81,20 +66,11 @@
XMLPortParam(JumpScore, "gameOverText", setGameOverText, getGameOverText, xmlelement, mode);
}
- /**
- @brief
- Is called each tick.
- Creates and sets the caption to be displayed by the JumpScore.
- @param dt
- The time that has elapsed since the last tick.
- */
void JumpScore::tick(float dt)
{
SUPER(JumpScore, tick, dt);
- // If the owner is set. The owner being a Jump game.
-
- if (this->owner_ != NULL)
+ if (owner_ != NULL)
{
if (!owner_->hasEnded())
{
@@ -119,11 +95,6 @@
}
}
- /**
- @brief
- Is called when the owner changes.
- Sets the owner to NULL, if it is not a pointer to a Jump game.
- */
void JumpScore::changedOwner()
{
SUPER(JumpScore, changedOwner);
Modified: code/branches/pickupsFS14/src/modules/jump/JumpScore.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpScore.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpScore.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,18 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpScore.h
- @brief Declaration of the JumpScore class.
- @ingroup Jump
-*/
-
#ifndef _JumpScore_H__
#define _JumpScore_H__
@@ -43,25 +37,15 @@
namespace orxonox
{
-
- /**
- @brief
- The JumpScore class displays the score for a game of @ref orxonox::Jump "Jump".
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpScore : public OverlayText, public Tickable
{
public:
JumpScore(Context* context);
virtual ~JumpScore();
- virtual void tick(float dt); //!< Creates and sets the caption to be displayed by the JumpScore.
+ virtual void tick(float dt);
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void changedOwner(); //!< Is called when the owner changes.
+ virtual void changedOwner();
void setShowScore(const bool showScore)
{ showScore_ = showScore; }
@@ -82,13 +66,12 @@
{ return this->gameOverText_; }
private:
- Jump* owner_; //!< The Jump game that owns this JumpScore.
- WeakPtr<PlayerInfo> player_; //!< Store information about left player permanently.
+ Jump* owner_;
+ WeakPtr<PlayerInfo> player_;
WorldSound* scoreSound_;
bool showScore_;
bool showMessages_;
std::string gameOverText_;
-
};
}
#endif /* _JumpScore_H__ */
Modified: code/branches/pickupsFS14/src/modules/jump/JumpShield.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpShield.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpShield.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,7 +28,7 @@
/**
@file JumpShield.cc
- @brief Implementation of the JumpShield class.
+ @brief If this shield is created, attachedToFigure_ is set to false. When the figure picks it up, the variable is set to true and the figure is protected until the fuel is reduced to zero.
*/
#include "JumpShield.h"
@@ -47,15 +47,12 @@
{
RegisterClass(JumpShield);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpShield::JumpShield(Context* context) : JumpItem(context)
{
RegisterObject(JumpShield);
fuel_ = 7.0;
+ attachedToFigure_ = false;
setPosition(Vector3(0,0,0));
setVelocity(Vector3(0,0,0));
@@ -63,28 +60,16 @@
setProperties(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
- /**
- @brief
- Destructor.
- */
JumpShield::~JumpShield()
{
}
- //xml port for loading sounds
void JumpShield::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpShield, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpShield::tick(float dt)
{
SUPER(JumpShield, tick, dt);
@@ -115,9 +100,5 @@
JumpItem::touchFigure();
attachedToFigure_ = figure_->StartShield(this);
- if (attachedToFigure_)
- {
- //Starte Feuer-Animation
- }
}
}
Modified: code/branches/pickupsFS14/src/modules/jump/JumpShield.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpShield.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpShield.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,18 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpShield.h
- @brief Declaration of the JumpShield class.
- @ingroup Jump
-*/
-
#ifndef _JumpShield_H__
#define _JumpShield_H__
@@ -44,18 +38,6 @@
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpShield : public JumpItem
{
public:
Modified: code/branches/pickupsFS14/src/modules/jump/JumpSpring.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpSpring.cc 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpSpring.cc 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
@@ -28,18 +28,15 @@
/**
@file JumpSpring.cc
- @brief Implementation of the JumpSpring class.
+ @brief If this spring is touched by the figure, it jumps higher then from a platform.
*/
#include "JumpSpring.h"
-
#include "core/CoreIncludes.h"
#include "core/GameMode.h"
#include "graphics/Model.h"
#include "gametypes/Gametype.h"
-
#include "JumpFigure.h"
-
#include "sound/WorldSound.h"
#include "core/XMLPort.h"
@@ -47,10 +44,6 @@
{
RegisterClass(JumpSpring);
- /**
- @brief
- Constructor. Registers and initializes the object.
- */
JumpSpring::JumpSpring(Context* context) : JumpItem(context)
{
RegisterObject(JumpSpring);
@@ -64,28 +57,16 @@
setProperties(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
- /**
- @brief
- Destructor.
- */
JumpSpring::~JumpSpring()
{
}
- //xml port for loading sounds
void JumpSpring::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(JumpSpring, XMLPort, xmlelement, mode);
}
- /**
- @brief
- Is called every tick.
- Handles the movement of the ball and its interaction with the boundaries and bats.
- @param dt
- The time since the last tick.
- */
void JumpSpring::tick(float dt)
{
SUPER(JumpSpring, tick, dt);
Modified: code/branches/pickupsFS14/src/modules/jump/JumpSpring.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpSpring.h 2014-11-05 15:04:51 UTC (rev 10110)
+++ code/branches/pickupsFS14/src/modules/jump/JumpSpring.h 2014-11-05 15:06:09 UTC (rev 10111)
@@ -20,18 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
*
*/
-/**
- @file JumpSpring.h
- @brief Declaration of the JumpSpring class.
- @ingroup Jump
-*/
-
#ifndef _JumpSpring_H__
#define _JumpSpring_H__
@@ -44,18 +38,6 @@
namespace orxonox
{
-
- /**
- @brief
- This class manages the ball for @ref orxonox::Jump "Jump".
-
- It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::JumpCenterpoint "JumpCenterpoint") and the @ref orxonox::JumpFigure "JumpFigures". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
-
- @author
- Fabian 'x3n' Landau
-
- @ingroup Jump
- */
class _JumpExport JumpSpring : public JumpItem
{
public:
More information about the Orxonox-commit
mailing list