[Orxonox-commit 5045] r9709 - in code/branches/invaders: data/levels data/levels/templates src/modules/invader
zifloria at orxonox.net
zifloria at orxonox.net
Mon Oct 21 15:53:13 CEST 2013
Author: zifloria
Date: 2013-10-21 15:53:13 +0200 (Mon, 21 Oct 2013)
New Revision: 9709
Modified:
code/branches/invaders/data/levels/Invaders.oxw
code/branches/invaders/data/levels/templates/spaceshipInvader.oxt
code/branches/invaders/src/modules/invader/CMakeLists.txt
code/branches/invaders/src/modules/invader/Invader.cc
code/branches/invaders/src/modules/invader/Invader.h
code/branches/invaders/src/modules/invader/InvaderPrereqs.h
Log:
InvaderShip created
Modified: code/branches/invaders/data/levels/Invaders.oxw
===================================================================
--- code/branches/invaders/data/levels/Invaders.oxw 2013-10-21 12:51:41 UTC (rev 9708)
+++ code/branches/invaders/data/levels/Invaders.oxw 2013-10-21 13:53:13 UTC (rev 9709)
@@ -29,7 +29,9 @@
>
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
- <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipinvader />
+ <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=InvaderShip pawndesign=spaceshipinvader />
+
+ <InvaderCenterPoint name=invadercenter />
</Scene>
</Level>
Modified: code/branches/invaders/data/levels/templates/spaceshipInvader.oxt
===================================================================
--- code/branches/invaders/data/levels/templates/spaceshipInvader.oxt 2013-10-21 12:51:41 UTC (rev 9708)
+++ code/branches/invaders/data/levels/templates/spaceshipInvader.oxt 2013-10-21 13:53:13 UTC (rev 9709)
@@ -1,5 +1,5 @@
<Template name=spaceshipinvader>
- <SpaceShip
+ <InvaderShip
hudtemplate = spaceshiphud
camerapositiontemplate = spaceshipescortcameras
spawnparticlesource = "Orxonox/fairytwirl"
@@ -58,18 +58,18 @@
<?lua
include("../includes/weaponSettingsEscort.oxi")
?>
- </SpaceShip>
+ </InvaderShip>
</Template>
<Template name=spaceshipescortcameras defaults=0>
- <SpaceShip>
+ <InvaderShip>
<camerapositions>
- <CameraPosition position="0,15, 60" drag=true mouselook=true />
+<!-- <CameraPosition position="0,15, 60" drag=true mouselook=true />
<CameraPosition position="0,20, 90" drag=true mouselook=true />
- <CameraPosition position="0,30,120" drag=true mouselook=true />
+ <CameraPosition position="0,30,120" drag=true mouselook=true /> -->
<CameraPosition position="0,300,-100" direction="0, -1, 0" drag=true mouselook=true />
</camerapositions>
- </SpaceShip>
+ </InvaderShip>
</Template>
<Template name=spaceshipescortengine baseclass=MultiStateEngine>
Modified: code/branches/invaders/src/modules/invader/CMakeLists.txt
===================================================================
--- code/branches/invaders/src/modules/invader/CMakeLists.txt 2013-10-21 12:51:41 UTC (rev 9708)
+++ code/branches/invaders/src/modules/invader/CMakeLists.txt 2013-10-21 13:53:13 UTC (rev 9709)
@@ -1,6 +1,8 @@
SET_SOURCE_FILES(Invader_SRC_FILES
BUILD_UNIT InvaderBuildUnit.cc
Invader.cc
+ InvaderCenterPoint.cc
+ InvaderShip.cc
END_BUILD_UNIT
)
Modified: code/branches/invaders/src/modules/invader/Invader.cc
===================================================================
--- code/branches/invaders/src/modules/invader/Invader.cc 2013-10-21 12:51:41 UTC (rev 9708)
+++ code/branches/invaders/src/modules/invader/Invader.cc 2013-10-21 13:53:13 UTC (rev 9709)
@@ -41,6 +41,12 @@
#include "gamestates/GSLevel.h"
#include "chat/ChatManager.h"
+#include "InvaderShip.h"
+// ! HACK
+#include "infos/PlayerInfo.h"
+
+#include "InvaderCenterPoint.h"
+
namespace orxonox
{
RegisterUnloadableClass(Invader);
@@ -49,17 +55,33 @@
{
RegisterObject(Invader);
+ this->center_ = 0;
+ //this->context = context;
}
Invader::~Invader()
{
}
+ // inject custom player controller
+ /** void Invader::spawnPlayer(PlayerInfo* player)
+ {
+ assert(player);
+
+ //player->startControl(new InvaderShip(this->center_->getContext() ) );
+ }*/
+
void Invader::start()
{
// Set variable to temporarily force the player to spawn.
this->bForceSpawn_ = true;
+ if (this->center_ == NULL) // abandon mission!
+ {
+ orxout(internal_error) << "Invader: No Centerpoint specified." << endl;
+ GSLevel::startMainMenu();
+ return;
+ }
// Call start for the parent class.
Deathmatch::start();
}
Modified: code/branches/invaders/src/modules/invader/Invader.h
===================================================================
--- code/branches/invaders/src/modules/invader/Invader.h 2013-10-21 12:51:41 UTC (rev 9708)
+++ code/branches/invaders/src/modules/invader/Invader.h 2013-10-21 13:53:13 UTC (rev 9709)
@@ -39,6 +39,8 @@
#include "gametypes/Deathmatch.h"
+#include "InvaderCenterPoint.h"
+
namespace orxonox
{
@@ -50,6 +52,14 @@
virtual void start(); //!< Starts the Invader minigame.
virtual void end(); ///!< Ends the Invader minigame.
+
+ //virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
+
+ void setCenterpoint(InvaderCenterPoint* center)
+ { this->center_ = center; }
+ private:
+ WeakPtr<InvaderCenterPoint> center_;
+ //Context* context;
};
}
Modified: code/branches/invaders/src/modules/invader/InvaderPrereqs.h
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderPrereqs.h 2013-10-21 12:51:41 UTC (rev 9708)
+++ code/branches/invaders/src/modules/invader/InvaderPrereqs.h 2013-10-21 13:53:13 UTC (rev 9709)
@@ -68,6 +68,8 @@
namespace orxonox
{
class Invader;
+ class InvaderCenterPoint;
+ class InvaderShip;
}
#endif /* _InvaderPrereqs_H__ */
More information about the Orxonox-commit
mailing list