[Orxonox-commit 7775] r12367 - in code/branches/OrxoBlox_FS19: data/levels data/levels/templates src/modules/OrxoBlox
ahuwyler at orxonox.net
ahuwyler at orxonox.net
Thu May 16 11:00:58 CEST 2019
Author: ahuwyler
Date: 2019-05-16 11:00:57 +0200 (Thu, 16 May 2019)
New Revision: 12367
Modified:
code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.h
Log:
We have a spaceship!
Modified: code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw 2019-05-09 15:15:43 UTC (rev 12366)
+++ code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw 2019-05-16 09:00:57 UTC (rev 12367)
@@ -83,7 +83,7 @@
>
<!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> -->
<Light type=directional position="-100, 10000, -700" direction="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
- <SpawnPoint team=0 position="0,150,0" lookat="0,0,0" spawnclass= Asteroids2DShip />
+ <SpawnPoint team=0 position="0,150,0" lookat="0,0,0" spawnclass= OrxoBloxShip pawndesign=spaceshipOrxoBlox/>
<!--<Model mesh="axes.mesh" scale=10 position="0,0,0" /> -->
Modified: code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt 2019-05-09 15:15:43 UTC (rev 12366)
+++ code/branches/OrxoBlox_FS19/data/levels/templates/spaceshipOrxoBlox.oxt 2019-05-16 09:00:57 UTC (rev 12367)
@@ -6,17 +6,6 @@
spawnparticleduration = 3
explosionchunks = 4
- health = 10
- maxhealth = 10
- initialhealth = 10
-
- shieldhealth = 20
- initialshieldhealth = 20
- maxshieldhealth = 20
- shieldabsorption = 0.1
- shieldrechargerate = 1
- shieldrechargewaittime = 1
-
primaryThrust = 150
auxilaryThrust = 30
rotationThrust = 100
@@ -36,9 +25,6 @@
mass = 4200000
linearDamping = 0.9
angularDamping = 0.9999999
-
- collisiondamage = 100
- enablecollisiondamage = true
>
<engines>
@@ -46,19 +32,13 @@
<MultiStateEngine position="-7.6, 0, 0" template=spaceshipOrxoBloxengine />
</engines>
<attached>
- <Model position="0,0,0" yaw=90 pitch=0 roll=0 scale=4 mesh="escortShip.mesh" />
- <Model position="0,0,0" yaw=180 pitch=90 roll=0 scale=4 mesh="escortWeapon.mesh" />
+ <Model position="0,0,0" direction="0,100,0" roll=0 scale=1 mesh="escortShip.mesh" />
+ <Model position="0,0,0" direction="0,100,0" roll=0 scale=1 mesh="escortWeapon.mesh" />
<!--Model mesh="cube.mesh" mass=10 position="0,0,3" scale3D="10,4,8" />
<Model mesh="cube.mesh" mass=10 position="12.6,-2,3" scale3D="2.8,2.8,11" />
<Model mesh="cube.mesh" mass=10 position="-12.6,-2,3" scale3D="2.8,2.8,11" />
<Model mesh="cube.mesh" mass=10 position="0,0,-12" scale3D="4,4,7" /-->
</attached>
- <collisionShapes>
- <BoxCollisionShape position="0 ,0 , 3" halfExtents="10, 4,8" />
- <BoxCollisionShape position="12.6 ,-2, 3" halfExtents="2.8,2.8,11"/>
- <BoxCollisionShape position="-12.6,-2, 3" halfExtents="2.8,2.8,11"/>
- <BoxCollisionShape position="0, 0,-12" halfExtents="4 , 4 ,7" />
- </collisionShapes>
<explosion >
<ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
<ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
@@ -79,13 +59,8 @@
<Template name=spaceshipescortcameras defaults=0>
<OrxoBloxShip>
<camerapositions>
- <!--<CameraPosition position="0,100,180" direction="0, -0.2, -1" drag=false mouselook=true />
- <CameraPosition position="0,200,250" direction="0, -0.4, -1" drag=false mouselook=true />
- <CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true />
- <CameraPosition position="0,1300,-100" direction="0, -1, 0" drag=false mouselook=true />
--->
- <CameraPosition position="0,600,0" pitch=-90 absolute=true drag = false mouselook=true/>
- <CameraPosition position="0,50,160" drag=true mouselook=true />
+ <CameraPosition position="0,100,0" pitch=-90 absolute=true drag = false mouselook=true/>
+ <CameraPosition position="0,0,0" drag=true mouselook=true />
<CameraPosition position="0,40,125" drag=true mouselook=true />
<CameraPosition position="0,30, 90" drag=true mouselook=true />
</camerapositions>
@@ -96,11 +71,6 @@
<MultiStateEngine
boostfactor = 2.2
- speedfront = 200
- speedback = 200
- speedleftright = 100
- speedupdown = 100
-
defEngineSndNormal = "sounds/Engine_low.ogg"
defEngineSndBoost = "sounds/Engine_high.ogg"
@@ -111,27 +81,6 @@
accelerationupdown = 500
>
- <!-- backlight error if you fly over the edge
- <EffectContainer condition="idle">
- <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
- </EffectContainer>
- <EffectContainer condition="not idle">
- <FadingBillboard mainstate=activity active=false scale=0.09 position="12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
- <FadingBillboard mainstate=activity active=false scale=0.09 position="-12, -2, 13" colour="0.2, 1.0, 0.65, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
- </EffectContainer>
- <EffectContainer condition="normal or brake">
- </EffectContainer>
- <EffectContainer condition="normal or boost">
- <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
- <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.2, 1.0, 0.65, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
- </EffectContainer>
- <EffectContainer condition="boost">
- <Backlight mainstate=activity active=false scale=0.33 name=bltest position=" 12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
- <Backlight mainstate=activity active=false scale=0.33 name=bltest position="-12, 0, 10" colour="0.6, 0.8, 0.75, 0.7" width=25 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
- </EffectContainer>
-
- -->
-
</MultiStateEngine>
</Template>
\ No newline at end of file
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt 2019-05-09 15:15:43 UTC (rev 12366)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt 2019-05-16 09:00:57 UTC (rev 12367)
@@ -6,8 +6,8 @@
OrxoBloxCenterpoint.cc
OrxoBloxStones.cc
OrxoBloxScore.cc
+ OrxoBloxShip.cc
-
)
ORXONOX_ADD_LIBRARY(OrxoBlox
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc 2019-05-09 15:15:43 UTC (rev 12366)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc 2019-05-16 09:00:57 UTC (rev 12367)
@@ -128,6 +128,7 @@
Starts the OrxoBlox minigame.
*/
void OrxoBlox::start()
+
{
if (this->center_ != nullptr) // There needs to be a OrxoBloxCenterpoint, i.e. the area the game takes place.
{
@@ -168,7 +169,7 @@
// Set variable to temporarily force the player to spawn.
// Set variable to temporarily force the player to spawn.
- bool temp = this->bForceSpawn_;
+ //bool temp = this->bForceSpawn_;
this->bForceSpawn_ = true;
// Call start for the parent class.
@@ -175,7 +176,7 @@
Deathmatch::start();
// Reset the variable.
- this->bForceSpawn_ = temp;
+ //this->bForceSpawn_ = temp;
}
@@ -205,17 +206,17 @@
return this->player_;
}
- void OrxoBlox::spawnPlayer(PlayerInfo* player)
- {
- assert(player);
+ // void OrxoBlox::spawnPlayer(PlayerInfo* player)
+ // {
+ // assert(player);
- if(this->player_ == nullptr)
- {
- this->player_ = player;
- this->players_[player].state_ = PlayerState::Alive;
- }
+ // if(this->player_ == nullptr)
+ // {
+ // this->player_ = player;
+ // this->players_[player].state_ = PlayerState::Alive;
+ // }
- }
+ // }
void OrxoBlox::LevelUp(){
level_++;
@@ -286,7 +287,7 @@
OrxoBloxStones* OrxoBlox::CheckForCollision(OrxoBloxBall* Ball) {
- orxout() << "Checking for Collision" << endl;
+ //orxout() << "Checking for Collision" << endl;
Vector3 BallPosition = Ball->getPosition();
for(OrxoBloxStones* someStone : this->stones_)
{
@@ -294,7 +295,7 @@
{
continue;
}
- orxout() << "Checking a stone" << endl;
+ //orxout() << "Checking a stone" << endl;
const Vector3& StonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
int size = someStone->getSize()/2;
if((BallPosition.x - Ball->getRadius() >= StonePosition.x - size && BallPosition.x + Ball->getRadius() <= StonePosition.x + size) &&
@@ -306,5 +307,10 @@
orxout() << "Found nothing...." << endl;
return nullptr;
}
+
+ void OrxoBlox::playerPreSpawn(PlayerInfo* player)
+ {
+ this->player_ = player;
+ }
}
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h 2019-05-09 15:15:43 UTC (rev 12366)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h 2019-05-16 09:00:57 UTC (rev 12367)
@@ -73,8 +73,10 @@
virtual void end() override; ///!< Ends the OrxoBlox minigame.
PlayerInfo* getPlayer();
- void spawnPlayer(PlayerInfo* Player) override;
+ // void spawnPlayer(PlayerInfo* Player) override;
+ virtual void playerPreSpawn(PlayerInfo* player) override;
+
void LevelUp();
/**
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc 2019-05-09 15:15:43 UTC (rev 12366)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc 2019-05-16 09:00:57 UTC (rev 12367)
@@ -33,6 +33,7 @@
*/
#include "OrxoBloxShip.h"
+#include "OrxoBlox.h"
#include "core/CoreIncludes.h"
namespace orxonox
@@ -46,7 +47,7 @@
this->bImmune = false;
this->width = 120;
this->height = 100;
- orxout() << "Spawned" << std::endl;
+ orxout() << "SPACESHIP Spawned" << std::endl;
//timer.setTimer(3.5f, true, createExecutor(createFunctor(&OrxoBloxShip::showorientation, this)));
}
@@ -70,14 +71,6 @@
SUPER(OrxoBloxShip, tick, dt);
Vector3 pos = this->getPosition();
- //ensure that the ship stays in playing field
- if(pos.x > width/2) pos.x = -width/2;
- if(pos.x < -width/2) pos.x = width/2;
-
- //2D movement, position should always = 0 on y-axis
- if(pos.y!=0) pos.y = 0;
- this->setPosition(pos);
- if(pos.z!=50) pos.z = 50;
}
OrxoBlox* OrxoBloxShip::getGame()
@@ -96,3 +89,4 @@
SpaceShip::death();
}
}
+
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.h 2019-05-09 15:15:43 UTC (rev 12366)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.h 2019-05-16 09:00:57 UTC (rev 12367)
@@ -35,7 +35,7 @@
#define _OrxoBloxShip_H__
-#include "asteroids2D/Asteroids2DPrereqs.h"
+#include "OrxoBloxPrereqs.h"
#include "worldentities/pawns/SpaceShip.h"
#include "tools/Timer.h"
More information about the Orxonox-commit
mailing list