Changeset 9955 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Nov 24, 2006, 6:42:57 PM (18 years ago)
- Location:
- branches/playability/src/world_entities/space_ships
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/space_ships/spacecraft_2d_new.cc
r9952 r9955 17 17 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY 18 18 19 #include "spacecraft_2d .h"19 #include "spacecraft_2d_new.h" 20 20 21 21 #include "weapons/weapon_manager.h" … … 39 39 40 40 #include "class_id_DEPRECATED.h" 41 ObjectListDefinitionID(Spacecraft2D , CL_SPACECRAFT_2D);42 CREATE_FACTORY(Spacecraft2D );43 44 CREATE_SCRIPTABLE_CLASS(Spacecraft2D ,41 ObjectListDefinitionID(Spacecraft2Dnew, CL_SPACECRAFT_2D_new); 42 CREATE_FACTORY(Spacecraft2Dnew); 43 44 CREATE_SCRIPTABLE_CLASS(Spacecraft2Dnew, 45 45 addMethod("hasPlayer", Executor0ret<Playable, lua_State*,bool>(&Playable::hasPlayer)) 46 46 //Coordinates … … 56 56 /** 57 57 * @brief loads a Spacecraft2D information from a specified file. 58 * @param fileName the name of the File to load the spacecraft_2d from (absolute path)58 * @param fileName the name of the File to load the spacecraft_2d_new from (absolute path) 59 59 */ 60 Spacecraft2D ::Spacecraft2D(const std::string& fileName)60 Spacecraft2Dnew::Spacecraft2Dnew(const std::string& fileName) 61 61 { 62 62 this->init(); … … 65 65 if(!doc.LoadFile()) 66 66 { 67 PRINTF(2)("Loading file %s failed for Spacecraft2D .\n", fileName.c_str());67 PRINTF(2)("Loading file %s failed for Spacecraft2Dnew.\n", fileName.c_str()); 68 68 return; 69 69 } … … 78 78 @todo add more parameters to load 79 79 */ 80 Spacecraft2D ::Spacecraft2D(const TiXmlElement* root)80 Spacecraft2Dnew::Spacecraft2Dnew(const TiXmlElement* root) 81 81 { 82 82 this->init(); … … 114 114 * @brief destructs the spacecraft_2d, deletes alocated memory 115 115 */ 116 Spacecraft2D ::~Spacecraft2D()116 Spacecraft2Dnew::~Spacecraft2Dnew () 117 117 { 118 118 this->setPlayer(NULL); … … 124 124 * @brief initializes a Spacecraft2D 125 125 */ 126 void Spacecraft2D ::init()126 void Spacecraft2Dnew::init() 127 127 { 128 128 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); … … 229 229 * @param root the XML-element to load the Spaceship's properties from 230 230 */ 231 void Spacecraft2D ::loadParams(const TiXmlElement* root)231 void Spacecraft2Dnew::loadParams(const TiXmlElement* root) 232 232 { 233 233 Playable::loadParams(root); … … 238 238 } 239 239 240 void Spacecraft2D ::setPlayDirection(const Quaternion& rot, float speed)240 void Spacecraft2Dnew::setPlayDirection(const Quaternion& rot, float speed) 241 241 { 242 242 this->direction = Quaternion (rot.getHeading(), Vector(0,1,0)); 243 243 } 244 244 245 void Spacecraft2D ::setTravelSpeed(float travelSpeed)245 void Spacecraft2Dnew::setTravelSpeed(float travelSpeed) 246 246 { 247 247 this->travelSpeed = travelSpeed; … … 249 249 250 250 251 void Spacecraft2D ::setTravelHeight(float travelHeight)251 void Spacecraft2Dnew::setTravelHeight(float travelHeight) 252 252 { 253 253 if (this->toTravelHeight == NULL) … … 257 257 258 258 259 void Spacecraft2D ::setTravelDistance(const Vector2D& distance)259 void Spacecraft2Dnew::setTravelDistance(const Vector2D& distance) 260 260 { 261 261 this->travelDistance = distance; 262 262 } 263 263 264 void Spacecraft2D ::setTravelDistance(float x, float y)264 void Spacecraft2Dnew::setTravelDistance(float x, float y) 265 265 { 266 266 this->setTravelDistance(Vector2D(x, y)); … … 269 269 270 270 271 void Spacecraft2D ::enter()271 void Spacecraft2Dnew::enter() 272 272 { 273 273 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true); … … 277 277 } 278 278 279 void Spacecraft2D ::leave()279 void Spacecraft2Dnew::leave() 280 280 { 281 281 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); … … 285 285 286 286 287 void Spacecraft2D ::enterPlaymode(Playable::Playmode playmode)287 void Spacecraft2Dnew::enterPlaymode(Playable::Playmode playmode) 288 288 { 289 289 switch(playmode) … … 337 337 * @brief effect that occurs after the Spacecraft2D is spawned 338 338 */ 339 void Spacecraft2D ::postSpawn ()339 void Spacecraft2Dnew::postSpawn () 340 340 { 341 341 //setCollision(new CollisionCluster(1.0, Vector(0,0,0))); … … 345 345 * @brief the action occuring if the spacecraft_2d left the game 346 346 */ 347 void Spacecraft2D ::leftWorld ()347 void Spacecraft2Dnew::leftWorld () 348 348 {} 349 349 … … 354 354 * Implement behaviour like damage application or other miscellaneous collision stuff in this function 355 355 */ 356 void Spacecraft2D ::collidesWith(WorldEntity* entity, const Vector& location)356 void Spacecraft2Dnew::collidesWith(WorldEntity* entity, const Vector& location) 357 357 { 358 358 Playable::collidesWith(entity, location); … … 365 365 * @param time The timespan passed since last update 366 366 */ 367 void Spacecraft2D ::tick (float dt)367 void Spacecraft2Dnew::tick (float dt) 368 368 { 369 369 // this->debugNode(1); … … 382 382 * @param time the timeslice since the last frame 383 383 */ 384 void Spacecraft2D ::movement (float dt)384 void Spacecraft2Dnew::movement (float dt) 385 385 { 386 386 Vector accel(0.0, 0.0, 0.0); … … 483 483 484 484 485 void Spacecraft2D ::draw() const485 void Spacecraft2Dnew::draw() const 486 486 { 487 487 WorldEntity::draw(); … … 491 491 * @todo switch statement ?? 492 492 */ 493 void Spacecraft2D ::process(const Event &event)493 void Spacecraft2Dnew::process(const Event &event) 494 494 { 495 495 Playable::process(event); … … 505 505 else if( event.type == EV_MOUSE_MOTION) 506 506 { 507 508 509 510 507 if (this->getPlaymode() == Playable::Full3D) 511 508 { -
branches/playability/src/world_entities/space_ships/spacecraft_2d_new.h
r9952 r9955 1 1 2 2 /*! 3 * @file spacecraft_2d .h4 * Implements the Control of a Spacecraft2D 3 * @file spacecraft_2d_new.h 4 * Implements the Control of a Spacecraft2D version 2 (PPS 3) 5 5 */ 6 6 7 #ifndef _SPACECRAFT_2D_ H8 #define _SPACECRAFT_2D_ H7 #ifndef _SPACECRAFT_2D_NEW_H 8 #define _SPACECRAFT_2D_NEW_H 9 9 10 10 #include "playable.h" … … 14 14 class ParticleSystem; 15 15 16 class Spacecraft2D : public Playable16 class Spacecraft2Dnew : public Playable 17 17 { 18 ObjectListDeclaration(Spacecraft2D );18 ObjectListDeclaration(Spacecraft2Dnew); 19 19 public: 20 Spacecraft2D (const std::string& fileName);21 Spacecraft2D (const TiXmlElement* root = NULL);22 virtual ~Spacecraft2D ();20 Spacecraft2Dnew(const std::string& fileName); 21 Spacecraft2Dnew(const TiXmlElement* root = NULL); 22 virtual ~Spacecraft2Dnew(); 23 23 24 24 virtual void loadParams(const TiXmlElement* root);
Note: See TracChangeset
for help on using the changeset viewer.