Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 5, 2007, 8:43:21 PM (17 years ago)
Author:
rgrieder
Message:
  • merged "includ" folder into the "src" folder
  • started writing the weaponManager
  • renamed 2 files with capital letters
Location:
code/branches/main_reto_vs05/src
Files:
13 added
10 edited

Legend:

Unmodified
Added
Removed
  • code/branches/main_reto_vs05/src/ammunition_dump.cc

    r161 r169  
    2929
    3030
    31 namespace Orxonox {
     31namespace orxonox {
    3232
    3333  AmmunitionDump::AmmunitionDump()
  • code/branches/main_reto_vs05/src/bullet.cc

    r161 r169  
    3333
    3434
    35 namespace Orxonox {
     35namespace orxonox {
    3636  using namespace Ogre;
    3737
    38   Bullet::Bullet(SceneNode *mNode, Entity *mEntity, Vector3 mSpeed)
    39         : mNode(mNode), mEntity(mEntity), mSpeed(mSpeed)
     38  Bullet::Bullet(SceneNode *node, Entity *entity, Vector3 speed)
     39    : node_(node), entity_(entity), speed_(speed)
    4040  {
    41           mNode->attachObject(mEntity);
     41          node_->attachObject(entity_);
    4242  }
    4343
  • code/branches/main_reto_vs05/src/camera_manager.cc

    r161 r169  
    3131#include "camera_manager.h"
    3232
    33 namespace Orxonox {
     33namespace orxonox {
    3434  using namespace Ogre;
    3535
  • code/branches/main_reto_vs05/src/main.cc

    r161 r169  
    4545    try {
    4646      // create an orxonox aplication and run it
    47       Orxonox::Orxonox myApp;
     47      orxonox::Orxonox myApp;
    4848
    4949      myApp.go();
  • code/branches/main_reto_vs05/src/ogre_control.cc

    r161 r169  
    3939
    4040
    41 namespace Orxonox {
     41namespace orxonox {
    4242  using namespace Ogre;
    4343
  • code/branches/main_reto_vs05/src/orxonox.cc

    r161 r169  
    4141
    4242
    43 namespace Orxonox {
     43namespace orxonox {
    4444
    4545  /**
  • code/branches/main_reto_vs05/src/orxonox_scene.cc

    r161 r169  
    3636#include "orxonox_scene.h"
    3737
    38 namespace Orxonox {
     38namespace orxonox {
    3939  using namespace Ogre;
    4040
  • code/branches/main_reto_vs05/src/orxonox_ship.cc

    r161 r169  
    3535
    3636#include "orxonox_ship.h"
    37 
    38 namespace Orxonox {
     37#include "weapon_manager.h"
     38
     39
     40namespace orxonox {
    3941  using namespace Ogre;
    4042
     
    5254
    5355
    54 
    55 
    5656  /**
    5757  * Standard constructor, that only initalizes a few variables. Some of them
     
    9999          fishNode->attachObject(shipEntity_);
    100100          fishNode->setScale(Vector3(10, 10, 10));
     101
     102    // initialise weapon(s)
     103    SceneNode *mainWeaponNode = rootNode_->createChildSceneNode("mainWeaponNode");
     104    mainWeapon_ = new WeaponManager(sceneMgr_, mainWeaponNode, 1);
    101105
    102106          return true;
  • code/branches/main_reto_vs05/src/run_manager.cc

    r161 r169  
    2525*/
    2626
    27 
    28 /**
    29 * RunManager is the basic control object during the game.
    30 *
    31 * The RunManger class is designed to actually "run" the main part of the
    32 * game. The Idea is, that you could derive from the RunManager in order
    33 * to distinguish between a first person shooter or a space craft shooter.
    34 * RunManager loads and initialises everything in the scene (like the ship,
    35 * the enemies in the scene, any scripts, the physics, window events,
    36 * environment, HUD, etc.).
    37 * It also captures any input from keyboard, mous, joystick (optional) or
    38 * Ogre (window events).
    39 */
    4027
    4128#include "Ogre.h"
     
    6956#include "run_manager.h"
    7057
    71 namespace Orxonox {
     58namespace orxonox {
    7259  using namespace Ogre;
     60
     61  /**
     62  * RunManager is the basic control object during the game.
     63  *
     64  * The RunManger class is designed to actually "run" the main part of the
     65  * game. The Idea is, that you could derive from the RunManager in order
     66  * to distinguish between a first person shooter or a space craft shooter.
     67  * RunManager loads and initialises everything in the scene (like the ship,
     68  * the enemies in the scene, any scripts, the physics, window events,
     69  * environment, HUD, etc.).
     70  * It also captures any input from keyboard, mous, joystick (optional) or
     71  * Ogre (window events).
     72  */
     73
    7374
    7475  /**
     
    240241    for (int i = 0; i < bulletsIndex_; i++)
    241242    {
    242       bullets_[i]->mNode->translate(bullets_[i]->mSpeed*deltaTime);
    243       bullets_[i]->mNode->yaw(Degree(deltaTime*100));
    244       bullets_[i]->mNode->roll(Degree(deltaTime*300));
     243      bullets_[i]->node_->translate(bullets_[i]->speed_*deltaTime);
     244      bullets_[i]->node_->yaw(Degree(deltaTime*100));
     245      bullets_[i]->node_->roll(Degree(deltaTime*300));
    245246    }
    246247
  • code/branches/main_reto_vs05/src/weapon_manager.cc

    r161 r169  
    2828#include "OgreSceneManager.h"
    2929
     30#include "weapon.h"
    3031#include "weapon_manager.h"
    3132
    3233
    33 namespace Orxonox {
     34namespace orxonox {
    3435  using namespace Ogre;
    3536
    36   WeaponManager::WeaponManager(SceneManager *mSceneMgr)
     37  Weapon** WeaponManager::weaponList_s = NULL;
     38
     39  WeaponManager::WeaponManager(SceneManager *sceneMgr, SceneNode *node,
     40        int slotSize)
     41        : sceneMgr_(sceneMgr), node_(node), slotSize_(slotSize), slotIndex_(0)
    3742  {
    38        
     43        slots_ = new Weapon*[slotSize];
    3944  }
    4045
     
    4247  WeaponManager::~WeaponManager()
    4348  {
     49    if (slots_)
     50      delete slots_;
     51  }
     52
     53
     54  bool WeaponManager::addWeapon(const Ogre::String &name)
     55  {
     56    if (name == weaponList_s[0]->name_)
     57    {
     58      // this is ugly, but for the time being, it has to fit.
     59      slots_[slotIndex_++] = weaponList_s[0];
     60      return true;
     61    }
     62    else
     63      return false;
     64  }
     65
     66
     67  // static
     68  bool WeaponManager::loadWeapons()
     69  {
     70    weaponList_s[0] = new Weapon("Barrel Gun", 10, 2);
     71    return true;
     72  }
     73
     74
     75  // static
     76  void WeaponManager::destroyWeapons()
     77  {
     78    delete weaponList_s[0];
    4479  }
    4580
Note: See TracChangeset for help on using the changeset viewer.