[Orxonox-commit 6764] r11392 - in code/branches/SuperOrxoBros_FS17: data/levels src/modules/superorxobros
jkindle at orxonox.net
jkindle at orxonox.net
Thu Apr 6 15:32:37 CEST 2017
Author: jkindle
Date: 2017-04-06 15:32:35 +0200 (Thu, 06 Apr 2017)
New Revision: 11392
Added:
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.cc
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.h
Modified:
code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/CMakeLists.txt
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/Orxo.h
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBPrereqs.h
Log:
Lululululululululu
Modified: code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw
===================================================================
--- code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw 2017-03-30 14:05:43 UTC (rev 11391)
+++ code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw 2017-04-06 13:32:35 UTC (rev 11392)
@@ -3,19 +3,19 @@
description = "Jump as high as you can. Use the mouse to guide the jumper."
tags = "minigame"
screenshot = "jump.png"
-/>
+ />
-<?lua
- include("HUDTemplates3.oxo")
- include("jumpHUD.oxo")
- include("stats.oxo")
- include("templates/lodInformation.oxt")
-?>
+ <?lua
+ include("HUDTemplates3.oxo")
+ include("jumpHUD.oxo")
+ include("stats.oxo")
+ include("templates/lodInformation.oxt")
+ ?>
-<Template name=sobfigurecameras defaults=0>
+ <Template name=sobfigurecameras defaults=0>
<SOBFigure>
<camerapositions>
- <CameraPosition position="0,-150,0" absolute=true mouselook=false drag=false lookat="0,0,0"/>
+ <CameraPosition position="0,-150,30" absolute=true mouselook=false drag=false direction="0,1,0"/>
</camerapositions>
</SOBFigure>
</Template>
@@ -24,73 +24,81 @@
<Template name=sobFigureTemplate>
- <SOBFigure camerapositiontemplate=sobfigurecameras collisionType="dynamic">
+ <SOBFigure camerapositiontemplate=sobfigurecameras collisionType="dynamic" position="0,0,30">
<attached>
- <Model position="0,0,0" mesh="JumpFigure.mesh" scale=1 pitch=90/>
+ <Model mesh="Orxo.mesh" scale=2.5 pitch=0 roll=90 yaw=90/>
</attached>
- <collisionShapes>
-<!-- <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" />
- --> <SphereCollisionShape yaw="20" pitch="20" roll="20" position="0,0,0" radius="10" />
- </collisionShapes>
+ <collisionShapes>
+ <BoxCollisionShape position="-2,0,2" halfExtents="3,1,10" />
+<!-- <SphereCollisionShape yaw="20" pitch="20" roll="20" radius="10" position="0,0,10" /> -->
+ </collisionShapes>
-
- </SOBFigure>
+
+ </SOBFigure>
</Template>
<Level
plugins = "superorxobros"
gametype = "SOB"
->-
+ >-
- <templates>
- <Template link=lodtemplate_default />
- </templates>
- <?lua include("includes/notifications.oxi") ?>
+ <templates>
+ <Template link=lodtemplate_default />
+</templates>
+<?lua include("includes/notifications.oxi") ?>
- <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
-
+<WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
- <Scene ambientlight="1.0, 1.0, 1.0" skybox="Orxonox/skyBoxBasic">
- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
- <SpawnPoint position="991.729, -110.11, 435.404" orientation="0.534038, 0.563456, 0.212168, 0.593553" />
+<Scene ambientlight="1.0, 1.0, 1.0" skybox="Orxonox/skyBoxBasic">
+ <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
+ <SpawnPoint position="991.729, -110.11, 435.404" orientation="0.534038, 0.563456, 0.212168, 0.593553" />
- <MovableEntity>
- <attached>
- <SOBCenterpoint
- name=jumpcenter
-
- cameraOffset="10"
-
- figureTemplate=sobFigureTemplate
-
- >
- <attached>
-
- </attached>
- </SOBCenterpoint>
- </attached>
- </MovableEntity>
- <StaticEntity position="0,-1,-10" collisionType="static">
- <attached>
- <Model mesh="cube.mesh" scale3D="110,76,1" />
- </attached>
+ <MovableEntity>
+ <attached>
+ <SOBCenterpoint name=jumpcenter cameraOffset="10" figureTemplate=sobFigureTemplate>
+ <attached>
+ </attached>
+ </SOBCenterpoint>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="110,76,1" />
- </collisionShapes>
- </StaticEntity>
+ </attached>
+ </MovableEntity>
-
- </Scene>
+
+
+<?lua
+ for i = 0, 100, 1
+ do
+ j = math.random()
+ ?>
+
+ <SOBItem position="<?lua print(i*10) ?>,0,-20" collisionType="static">
+ <attached>
+ <Model mesh="MarioCube.mesh" scale="10" />
+ </attached>
+
+</SOBItem>
+
+ <?lua
+ end
+ ?>
+
+<StaticEntity collisionType="static">
+ <collisionShapes>
+ <BoxCollisionShape position="500,0,-20" halfExtents="500,5,5" />
+ </collisionShapes>
+</StaticEntity>
+
+
+</Scene>
</Level>
Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/CMakeLists.txt
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/CMakeLists.txt 2017-03-30 14:05:43 UTC (rev 11391)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/CMakeLists.txt 2017-04-06 13:32:35 UTC (rev 11392)
@@ -3,6 +3,7 @@
SOBCenterpoint.cc
SOB.cc
SOBFigure.cc
+ SOBItem.cc
)
Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/Orxo.h
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/Orxo.h 2017-03-30 14:05:43 UTC (rev 11391)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/Orxo.h 2017-04-06 13:32:35 UTC (rev 11392)
@@ -48,6 +48,7 @@
virtual void tick(float dt) override;
+
// overwrite for 2d movement
virtual void moveFrontBack(const Vector2& value) override;
virtual void moveRightLeft(const Vector2& value) override;
@@ -56,7 +57,7 @@
virtual void boost(bool bBoost) override;
//no rotation!
- virtual void rotateYaw(const Vector2& value) override{};
+ virtual void rotateYaw(const Vector2& value) override{};
virtual void rotatePitch(const Vector2& value) override{};
//return to main menu if game has ended.
virtual void rotateRoll(const Vector2& value) override;
Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc 2017-03-30 14:05:43 UTC (rev 11391)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc 2017-04-06 13:32:35 UTC (rev 11392)
@@ -49,7 +49,7 @@
namespace orxonox
{
-
+
RegisterUnloadableClass(SOB);
/**
@@ -88,11 +88,11 @@
if (figure_ == nullptr)
{
figure_ = new SOBFigure(center_->getContext());
- figure_->addTemplate(center_->getFigureTemplate());
+ figure_->addTemplate(center_->getFigureTemplate());
// figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
}
- center_->attach(figure_);
+ center_->attach(figure_);
figure_->setPosition(0, 0, 0);
}
else // If no centerpoint was specified, an error is thrown and the level is exited.
@@ -110,14 +110,6 @@
camera = figure_->getCamera();
}
- // totalScreenShift_ = 0.0;
- // screenShiftSinceLastUpdate_ = 0.0;
- //sectionNumber_ = 0;
- //adventureNumber_ = 0;
-
- //addStartSection();
- // addSection();
- // addSection();
}
void SOB::end()
@@ -124,7 +116,7 @@
{
cleanup();
GSLevel::startMainMenu();
-
+
Deathmatch::end();
}
@@ -152,6 +144,6 @@
}
-
-
+
+
}
Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h 2017-03-30 14:05:43 UTC (rev 11391)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h 2017-04-06 13:32:35 UTC (rev 11392)
@@ -47,7 +47,8 @@
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a SOBCenterpoint through XML.
void setFigureTemplate(const std::string& newTemplate)
- { this->figureTemplate_ = newTemplate; }
+ { this->figureTemplate_ = newTemplate;
+ }
const std::string& getFigureTemplate() const
{ return this->figureTemplate_; }
@@ -56,6 +57,8 @@
{ this->cameraOffset_ = cameraOffset; }
float getCameraOffset() const
{ return cameraOffset_; }
+
+
private:
void checkGametype();
Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc 2017-03-30 14:05:43 UTC (rev 11391)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc 2017-04-06 13:32:35 UTC (rev 11392)
@@ -38,7 +38,6 @@
#include "graphics/Model.h"
#include "graphics/Camera.h"
-
namespace orxonox
{
RegisterClass(SOBFigure);
@@ -57,7 +56,8 @@
timeSinceLastFire_ = 0.0;
lastSpeed_z = 0.0;
- gravityAcceleration_ = 250.0;//8.0
+ gravityAcceleration_ = 250.0;
+ pitch_ = 0.0;
dead_ = false;
setAngularFactor(0.0);
@@ -98,12 +98,17 @@
//If player hits space and does not move in z-dir
if (firePressed_ && std::abs(velocity.z) < 0.07 && std::abs(lastSpeed_z) < 0.07) {
velocity.z = 150;
- }
+ }
+ // rotate(1,getOrientation()* WorldEntity::FRONT)
+
//Left-right movement with acceleration
if (moveRightPressed_) {
if (std::abs(velocity.x) < maxvelocity_x) {
velocity.x += speedAddedPerTick;
+ // if (pitch_ > 0.0) {
+ // pitch -= turn_fac*dt);
+ // }
}
} else if (moveLeftPressed_) {
if (std::abs(velocity.x) < maxvelocity_x) {
@@ -111,9 +116,9 @@
}
} else {
velocity.x /= 1.1;
- }
-
+ }
+
velocity.z -= gravityAcceleration_*dt;
setVelocity(velocity);
@@ -133,6 +138,7 @@
+
}
// Move through the left and right screen boundaries
@@ -153,19 +159,7 @@
- /* void SOBFigure::CollisionWithEnemy(SOBEnemy* enemy)
- {
- if (rocketActive_ == nullptr && propellerActive_ == nullptr && shieldActive_ == nullptr)
- {
- dead_ = true;
- }
- }*/
-
-
-
-
-
void SOBFigure::moveFrontBack(const Vector2& value)
{
if (value.x > 0)
Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h 2017-03-30 14:05:43 UTC (rev 11391)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h 2017-04-06 13:32:35 UTC (rev 11392)
@@ -47,6 +47,7 @@
virtual void boost(bool boost) override;
+
//virtual void CollisionWithEnemy(SOBEnemy* enemy);
@@ -65,6 +66,8 @@
float gravityAcceleration_;
float timeSinceLastFire_;
float lastSpeed_z;
+ SOBCenterpoint* sobcenterpoint;
+ float pitch_;
Added: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.cc
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.cc (rev 0)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.cc 2017-04-06 13:32:35 UTC (rev 11392)
@@ -0,0 +1,83 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Fabien Vultier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file SOBItem.cc
+ @brief All items in this minigame inherit from this class. Items can move around like platforms and enemies.
+*/
+
+#include "SOBItem.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "SOBFigure.h"
+#include "util/Output.h"
+
+
+namespace orxonox
+{
+ RegisterClass(SOBItem);
+
+ SOBItem::SOBItem(Context* context) : StaticEntity(context)
+ {
+ RegisterObject(SOBItem);
+
+ attachedToFigure_ = false;
+
+ figure_ = nullptr;
+ this->enableCollisionCallback();
+
+ }
+
+
+
+ void SOBItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(SOBItem, XMLPort, xmlelement, mode);
+
+
+ }
+
+
+ bool SOBItem::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) {
+
+orxout() << "Watshc bum baem" << endl;
+return true;
+ }
+
+
+ void SOBItem::setFigure(SOBFigure* newFigure)
+ {
+ figure_ = newFigure;
+ }
+
+ void SOBItem::touchFigure()
+ {
+
+ }
+}
Added: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.h
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.h (rev 0)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBItem.h 2017-04-06 13:32:35 UTC (rev 11392)
@@ -0,0 +1,63 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Fabien Vultier
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file SOBItem.h
+ @brief Declaration of the SOBItem class.
+ @ingroup SOB
+*/
+
+#ifndef _SOBItem_H__
+#define _SOBItem_H__
+
+#include "superorxobros/SOBPrereqs.h"
+#include "worldentities/StaticEntity.h"
+
+
+namespace orxonox
+{
+ class _SOBExport SOBItem : public StaticEntity
+ {
+ public:
+ SOBItem(Context* context);
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+ virtual void setFigure(SOBFigure* newFigure);
+ virtual void touchFigure();
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
+
+
+ bool attachedToFigure_;
+
+ protected:
+
+ WeakPtr<SOBFigure> figure_;
+
+ };
+}
+
+#endif /* _SOBItem_H__ */
Modified: code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBPrereqs.h
===================================================================
--- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBPrereqs.h 2017-03-30 14:05:43 UTC (rev 11391)
+++ code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBPrereqs.h 2017-04-06 13:32:35 UTC (rev 11392)
@@ -76,6 +76,7 @@
class SOB;
class SOBFigure;
+ class SOBItem;
/*
class PongScore;*/
}
More information about the Orxonox-commit
mailing list