[Orxonox-commit 7805] r12397 - in code/branches/Boxhead_FS19: data/levels data/levels/scripts src/modules/hover
kofrey at orxonox.net
kofrey at orxonox.net
Fri May 17 15:00:54 CEST 2019
Author: kofrey
Date: 2019-05-17 15:00:54 +0200 (Fri, 17 May 2019)
New Revision: 12397
Modified:
code/branches/Boxhead_FS19/data/levels/Hover.oxw
code/branches/Boxhead_FS19/data/levels/scripts/ScriptableControllerSpawn.lua
code/branches/Boxhead_FS19/src/modules/hover/Hover.cc
code/branches/Boxhead_FS19/src/modules/hover/HoverShip.cc
code/branches/Boxhead_FS19/src/modules/hover/HoverShip.h
Log:
abc
Modified: code/branches/Boxhead_FS19/data/levels/Hover.oxw
===================================================================
--- code/branches/Boxhead_FS19/data/levels/Hover.oxw 2019-05-17 11:32:44 UTC (rev 12396)
+++ code/branches/Boxhead_FS19/data/levels/Hover.oxw 2019-05-17 13:00:54 UTC (rev 12397)
@@ -74,7 +74,7 @@
<SpawnPoint
team=0
- position="50,20,50"
+ position="500,20,50"
lookat="100,20,100"
spawnclass=HoverShip
pawndesign=spaceshiphover
@@ -86,9 +86,15 @@
</templates>
</SpaceShip>
+ <SpaceShip position="500,10000,500" lookat="50,20,50" name="enemy" health="200" maxhealth="200" initialhealth="200" >
+ <templates>
+ <Template link=spaceshipzombie />
+ </templates>
+ </SpaceShip>
+
</Scene>
</Level>
Modified: code/branches/Boxhead_FS19/data/levels/scripts/ScriptableControllerSpawn.lua
===================================================================
--- code/branches/Boxhead_FS19/data/levels/scripts/ScriptableControllerSpawn.lua 2019-05-17 11:32:44 UTC (rev 12396)
+++ code/branches/Boxhead_FS19/data/levels/scripts/ScriptableControllerSpawn.lua 2019-05-17 13:00:54 UTC (rev 12397)
@@ -104,7 +104,7 @@
mytestfunction(3.0, 4.0)
-spawn_dummy_after_timeout(5)
+spawn_dummy_after_timeout(10)
Modified: code/branches/Boxhead_FS19/src/modules/hover/Hover.cc
===================================================================
--- code/branches/Boxhead_FS19/src/modules/hover/Hover.cc 2019-05-17 11:32:44 UTC (rev 12396)
+++ code/branches/Boxhead_FS19/src/modules/hover/Hover.cc 2019-05-17 13:00:54 UTC (rev 12397)
@@ -50,6 +50,7 @@
+
namespace orxonox
{
RegisterUnloadableClass(Hover);
@@ -63,80 +64,8 @@
this->setHUDTemplate("HoverHUD");
}
- // void Hover::spawnZombie(std::string id)
- // {
- // Identifier *identifier = ClassByString("SpaceShip");
- // if(!identifier)
- // {
- // orxout(user_error) << "Script tried to spawn unknown object" << std::endl;
- // return;
- // }
- // if(!identifier->isLoadable())
- // {
- // orxout(user_error) << "Script tried to spawn unloadable object" << std::endl;
- // return;
- // }
-
-
- // WorldEntity *entity;
- // Identifiable *obj = identifier->fabricate(this->controller_->getWorldEntityByID("Player")->getContext());
-
-
-
- // orxout(user_status) << "First hit!" << std::endl;
-
- // if(obj->isA(ClassIdentifier<WorldEntity>::getIdentifier()))
- // {
- // orxout(user_status) << "Is WorldEntity!" << std::endl;
- // entity = orxonox_cast<WorldEntity*>(obj);
- // }
- // else if(obj->isA(ClassIdentifier<PlayerInfo>::getIdentifier()))
- // {
- // // TODO This does not work yet because somehow the controllable entity is not set
- // // yet at this stage.
- // // entity = orxonox_cast<PlayerInfo*>(obj)->getControllableEntity();
-
- // orxout(user_status) << "Is PlayerInfo!" << std::endl;
-
- // //use TEMPLATES in the map to define objects that are not present on the map yet
- // return;
- // }
- // else
- // {
- // orxout(user_warning) << "Script tried to spawn an object that is neither a WorldEntity, nor a PlayerInfo" << std::endl;
-
- // return;
- // }
-
- // if(entity->isA(ClassIdentifier<MobileEntity>::getIdentifier())) {
- // orxout(user_status) << "Is MobileEntity!" << std::endl;
- // this->controller_->registerMobileEntity(id, orxonox_cast<MobileEntity*>(entity));
- // }
-
-
-
- // if(entity->isA(ClassIdentifier<Pawn>::getIdentifier())) {
- // orxout(user_status) << "Is Pawn!" << std::endl;
- // this->controller_->registerPawn(id, orxonox_cast<Pawn*>(entity));
- // }
-
- // this->controller_->registerWorldEntity(id, orxonox_cast<WorldEntity*>(entity));
-
-
- // ///////////////GOLD!!!!!!!!!!!!!!!////////////////////////
- // Pawn* pawn = this->controller_->getPawnByID(id);
-
- // //Attach to pawn
- // SpaceShip* drone = new SpaceShip(pawn->getContext()); // this is neccessary because the projectiles fired need a valid creator for the particlespawner (when colliding against something)
-
- // drone->addTemplate("spaceshipzombie"); //ScriptableControllerDroneTemplate spaceshipescort
-
- // Vector3 spawnPosition = pawn->getWorldPosition() + Vector3(500,20,500);
- // drone->setPosition(spawnPosition);
- // }
-
void Hover::tick(float dt)
{
SUPER(Hover, tick, dt);
@@ -202,7 +131,7 @@
// numberOfFlags_ = flags_.size();
//Spawn Zombies
- //spawnZombie(z1);
+ //spawnZombie(1);
}
Modified: code/branches/Boxhead_FS19/src/modules/hover/HoverShip.cc
===================================================================
--- code/branches/Boxhead_FS19/src/modules/hover/HoverShip.cc 2019-05-17 11:32:44 UTC (rev 12396)
+++ code/branches/Boxhead_FS19/src/modules/hover/HoverShip.cc 2019-05-17 13:00:54 UTC (rev 12397)
@@ -47,11 +47,21 @@
jumpBoost_ = 0;
}
+ // //moves slightly right and left, that zombieship approaches
+ // void HoverShip::leftright(const Vector2& value)
+ // {
+ // this->steering_.z += 5;
+ // this->steering_.z -= 5;
+ // }
+
void HoverShip::moveFrontBack(const Vector2& value)
{ this->steering_.z -= value.x; }
void HoverShip::moveRightLeft(const Vector2& value)
- { this->steering_.x += value.x; }
+ { this->steering_.x += value.x;
+ // value.x += 0.001;
+ // value.x -= 0.001;
+ }
void HoverShip::moveUpDown(const Vector2& value)
{ this->steering_.y += value.x; }
Modified: code/branches/Boxhead_FS19/src/modules/hover/HoverShip.h
===================================================================
--- code/branches/Boxhead_FS19/src/modules/hover/HoverShip.h 2019-05-17 11:32:44 UTC (rev 12396)
+++ code/branches/Boxhead_FS19/src/modules/hover/HoverShip.h 2019-05-17 13:00:54 UTC (rev 12397)
@@ -52,6 +52,9 @@
inline float getJumpBoost() const
{ return this->jumpBoost_; }
+ /////moves slightly right and left, that zombieship approaches
+ // virtual void leftright(const Vector2& value);
+
virtual void moveFrontBack(const Vector2& value) override;
virtual void moveRightLeft(const Vector2& value) override;
More information about the Orxonox-commit
mailing list